Fix TodoListWidget crash: extend Vertical instead of Widget to avoid visual=None
- SHA
28bf32a2ce4fbce129784528930918e3fb3cdd1e- Parents
-
f768f96 - Tree
1f9bc94
28bf32a
28bf32a2ce4fbce129784528930918e3fb3cdd1ef768f96
1f9bc94| Status | File | + | - |
|---|---|---|---|
| M |
src/loader/ui/widgets/todo_list.py
|
8 | 3 |
src/loader/ui/widgets/todo_list.pymodified@@ -4,7 +4,7 @@ from __future__ import annotations | ||
| 4 | 4 | |
| 5 | 5 | from rich.text import Text |
| 6 | 6 | from textual.app import ComposeResult |
| 7 | -from textual.widget import Widget | |
| 7 | +from textual.containers import Vertical | |
| 8 | 8 | from textual.widgets import Static |
| 9 | 9 | |
| 10 | 10 | _STATUS_ICONS = { |
@@ -14,8 +14,13 @@ _STATUS_ICONS = { | ||
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | |
| 17 | -class TodoListWidget(Widget): | |
| 18 | - """Renders the agent's current todo list with checkboxes and strikethrough.""" | |
| 17 | +class TodoListWidget(Vertical): | |
| 18 | + """Renders the agent's current todo list with checkboxes and strikethrough. | |
| 19 | + | |
| 20 | + Extends Vertical (not Widget) so Textual delegates rendering to the | |
| 21 | + child Static — a bare Widget requires a render() method and returns | |
| 22 | + visual=None without one, crashing the render pipeline. | |
| 23 | + """ | |
| 19 | 24 | |
| 20 | 25 | DEFAULT_CSS = """ |
| 21 | 26 | TodoListWidget { |