@@ -299,27 +313,35 @@ function SubagentsPanel({ subagents, onSelectSubagent, defaultExpanded = false }
* via its header row (`chevron`); todo/subagents start collapsed (headers
* always show live progress / running-summary), a new side question starts
* expanded. Rendered pinned above the chat input. */
-export function ComposerPanels({ todoPhases, subagents, onSelectSubagent, btw = null, defaultExpanded = false }: {
+export function ComposerPanels({ todoPhases, subagents, onSelectSubagent, btw = null, defaultExpanded = false, liveStatus = null }: {
todoPhases: TodoPhase[];
subagents: SubagentInfo[];
onSelectSubagent: (subagent: SubagentInfo) => void;
btw?: BtwPanelProps | null;
/** Initial expansion of both panels (default: collapsed). */
defaultExpanded?: boolean;
+ /** Transient live-agent status (the ChatInput status bar's text) to merge
+ * into an existing panel header row instead of mounting as its own line
+ * (#245). Hosted by the todo row when one exists, else by the subagent
+ * row; when neither exists the caller keeps the standalone bar so the
+ * status is never hidden. */
+ liveStatus?: string | null;
}) {
const [todoCollapsed, setTodoCollapsed] = useState(() => loadCollapsed(TODO_COLLAPSED_STORAGE_KEY, defaultExpanded));
if (todoPhases.length === 0 && subagents.length === 0 && !btw) return null;
+ const todoHostsLiveStatus = todoPhases.length > 0;
return (
{btw && }
{ saveCollapsed(TODO_COLLAPSED_STORAGE_KEY, collapsed); setTodoCollapsed(collapsed); }}
/>
-
+
);
}
diff --git a/components/TodoList.test.mjs b/components/TodoList.test.mjs
index 331336a6d..9886f945d 100644
--- a/components/TodoList.test.mjs
+++ b/components/TodoList.test.mjs
@@ -135,3 +135,14 @@ test("the scroll area is reachable by keyboard and named", () => {
assert.match(html, /]*aria-label="Tasks"/);
assert.doesNotMatch(html, /role="group"[^>]*aria-label="Tasks"/);
});
+
+test("merges live status into the tasks header row instead of a separate line (#245)", () => {
+ const html = renderToStaticMarkup(React.createElement(TodoList, {
+ phases: [{ name: "Implementation", tasks: [{ content: "Wire panels", status: "in_progress" }] }],
+ collapsible: true,
+ liveStatus: "Waiting for model...",
+ }));
+ assert.match(html, /Waiting for model\.\.\./);
+ assert.match(html, /0\/1 complete/);
+ assert.match(html, /role="status"/);
+});
diff --git a/components/TodoList.tsx b/components/TodoList.tsx
index 4f6fb7a43..7ed5c91ed 100644
--- a/components/TodoList.tsx
+++ b/components/TodoList.tsx
@@ -16,6 +16,11 @@ function TodoStatusIcon({ status }: { status: TodoItem["status"] }) {
interface TodoListProps {
phases?: TodoPhase[];
+ /** Transient live-agent status (e.g. "Waiting for model...") merged into
+ * this header row instead of mounting as a separate line above the
+ * composer (#245). The row already exists whenever phases exist, so the
+ * status text changes in place rather than popping a line in and out. */
+ liveStatus?: string | null;
/** Render as a composer-attached panel: the header row becomes a
* collapse/expand toggle and the section margin is dropped. */
collapsible?: boolean;
@@ -35,7 +40,7 @@ function previewTaskOrder(status: TodoItem["status"]): number {
return 2;
}
-export function TodoList({ phases = [], collapsible = false, defaultExpanded = false, collapsed: collapsedProp, onCollapsedChange }: TodoListProps) {
+export function TodoList({ phases = [], liveStatus = null, collapsible = false, defaultExpanded = false, collapsed: collapsedProp, onCollapsedChange }: TodoListProps) {
const { t } = useI18n();
const [expanded, setExpanded] = useState(false);
const [collapsedState, setCollapsedState] = useState(collapsible ? !defaultExpanded : false);
@@ -65,6 +70,20 @@ export function TodoList({ phases = [], collapsible = false, defaultExpanded = f
const headerRowClass = "flex items-center gap-2 px-3 py-2 text-xs text-text-muted";
const headerBorderClass = collapsed ? "" : "border-b border-border";
const progress = t("chatWindow.todoProgress", { done, total: tasks.length });
+ // Merged live status (#245): sits in this already-present header row so
+ // it changes in place instead of mounting a separate line above the
+ // composer. role="status" keeps the live announcement the old bar had.
+ const liveStatusNode = liveStatus ? (
+
+
+ {liveStatus}
+
+ ) : null;
return (
{t("chatWindow.todoList")}
- {progress}
+ {liveStatusNode}
+ {progress}
{t("chatWindow.todoList")}
- {progress}
+ {liveStatusNode}
+ {progress}
)}
{!collapsed && (