Skip to content

Restore the toggleable task-list panel above the prompt box - #421

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-5731-restore-the-toggleable-task-list-above-the-prompt-box
Aug 8, 2026
Merged

Restore the toggleable task-list panel above the prompt box#421
TheGreatAxios merged 3 commits into
mainfrom
cl-5731-restore-the-toggleable-task-list-above-the-prompt-box

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The task list lost in the OpenTUI cutover is back as its own multi-row panel above the prompt box, distinct from the agents panel — a task is a unit of work with a status, an agent is an executor, and they never merge into one zone.
  • Each task row shows a live status marker ([ ] todo, [~] doing, [x] done, [-] cancelled) and updates as the task tool writes, bounded to TASKS_PANEL_MAX_VISIBLE rows with a +N more trailer past that.
  • The panel toggles visible/hidden (palette 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.
  • It takes zero rows when empty or hidden. On a short terminal it degrades before the prompt box: COLLAPSE_ORDER drains task to zero before collapseOnce ever reduces prompt, and PROMPT_CAP_FRACTION independently bounds how tall a requested prompt starts before collapse runs at all — two separate mechanisms, not one.
  • RunnerHostDeps.subscribeChrome is 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 as origin/main, none new)
  • bun run build
  • bun run test — 4206 pass, 1 pre-existing unrelated failure (lsp-availability.test.ts, fails identically on origin/main, missing language server binary in this environment)
  • RED-first: first commit adds the task-panel/toggle/degrade/wiring tests against the unmodified code and they fail (missing exports); second commit implements and turns them green.

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.
@linear-code

linear-code Bot commented Aug 8, 2026

Copy link
Copy Markdown

CL-5731

… 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.
@TheGreatAxios
TheGreatAxios merged commit 959a96e into main Aug 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant