Restore the toggleable task-list panel above the prompt box - #421
Merged
TheGreatAxios merged 3 commits intoAug 8, 2026
Merged
Conversation
The task list that rendered above the prompt box was lost in the OpenTUI cutover: the domain side (task tool writes, director.getTasks(), onTasksChange) survived, but the chrome had no real multi-row consumer, and subscribeChrome was optional wiring that type-checked cleanly even when never invoked. These tests assert the panel renders each task with its own status as a panel distinct from the agents panel, toggles independent of its live data, degrades before the prompt on a short terminal, and that a live chrome push actually reaches the shell end to end. They fail against the current implementation.
The task tool's writes and the director's onTasksChange callback survived the OpenTUI cutover, but the chrome zone reading them only ever rendered a single compact summary line, and the only toggle was a demo action that overwrote the live data with hardcoded content. Give tasks their own multi-row panel (chrome-state.ts's formatTasksPanel, mirroring the agents panel's formatAgentsPanel but keyed on status rather than liveness) so each task renders with a bracket status marker, distinct from the agents panel below it. The task zone now takes boolean|number visibility and a real row budget (TASKS_PANEL_MAX_VISIBLE, bounded and shrunk one row at a time under space pressure) the same way agents already did, so it degrades before the prompt box on a short terminal instead of growing unbounded or disappearing in one step. toggleTasksPanel hides/shows the panel independent of its live data — a hidden flag on the shell that persists for the session while the raw task list keeps updating underneath it, so un-hiding shows the current list rather than a stale snapshot. The palette's toggle_task action now drives this for real instead of stuffing fake content into the zone. Also make RunnerHostDeps.subscribeChrome required rather than optional: an omitted subscription used to type-check cleanly while silently freezing the task/agents panels at their mount-time snapshot — the same built-and-never-wired shape as the callback itself. runner-host.test.ts now drives a live subscribeChrome notify through mountRunnerHost end to end and asserts the panel actually repaints from it.
… the string task shape - docs/TUI.md: the subscribeChrome paragraph claimed making it required fixed an observed break; the production caller always passed it, so restate this as closing a shape that could have type-checked while omitted, not a fix for something that broke. - docs/TUI.md: the collapse-order paragraph conflated two mechanisms. COLLAPSE_ORDER/collapseOnce governs what collapse takes from zones ahead of prompt; PROMPT_CAP_FRACTION independently bounds the prompt's own requested height before collapse ever runs. Name both and what each guarantees. - shell.ts defaultVisibility: seed task: 0 alongside agents: 0, so the adjacent comment about avoiding a needless first relayout is true for both row-count fields it now describes. - chrome-state.ts: delete the string member of ChromeLiveState['task'] and formatTasksPanel's string branch. chromeFromSession never produces a string, so the only callers left were its own tests — a back-compat surface for callers this repo owns, which AGENTS.md forbids. Updated demo.ts and the tests that exercised the string shape accordingly. - Reworded 'session-persisted' to 'shell-lifetime, in memory, nothing written to storage' everywhere it appeared (docs, comments, a test title) — that is the actual design, the phrasing just claimed durability it doesn't have. - geometry.test.ts: corrected a test comment that attributed the short- terminal invariant solely to collapse order; across most of the tested range it actually holds via PROMPT_CAP_FRACTION capping the requested prompt before collapse runs at all.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[ ]todo,[~]doing,[x]done,[-]cancelled) and updates as the task tool writes, bounded toTASKS_PANEL_MAX_VISIBLErows with a+N moretrailer past that.toggle_task) independent of its live data: the hidden flag is held in memory on the shell for its lifetime (not written to storage), while the underlying task list keeps updating underneath it.COLLAPSE_ORDERdrainstaskto zero beforecollapseOnceever reducesprompt, andPROMPT_CAP_FRACTIONindependently bounds how tall a requested prompt starts before collapse runs at all — two separate mechanisms, not one.RunnerHostDeps.subscribeChromeis now required instead of optional. The production caller has always passed a real subscription, so this isn't fixing an observed break — it closes a shape that previously type-checked fine even if a caller omitted it, the same "callback that types clean when absent" hazard the task callback itself is named after in the tracking issue.Test plan
bun run typecheck(same 9 pre-existing vendoring errors asorigin/main, none new)bun run buildbun run test— 4206 pass, 1 pre-existing unrelated failure (lsp-availability.test.ts, fails identically onorigin/main, missing language server binary in this environment)