Repository navigation
fix(chat): hide the task dock with its last row - #1932
Conversation
The shared Todo/background-task container derived its presence, its live count, and its header count from every registry entry the session had ever produced, not from the rows it could render. host-core keeps a finished task so its output and exit code stay readable, so a stopped or self-exited command left a permanent "1 background tasks" header above the composer with no row to stop, dismiss, or read -- while the spec already says a container with nothing to show renders nothing. Gate and count on the renderable rows instead, and let the tab and badge rules read that same description so a task that already left the container cannot decide which panel is on screen.
|
Linking this PR's one red check to an existing fix, so the failure is not misread as a problem with this diff. Failing check:
Root cause: Existing fix (not in
It refuses a CONNECT for any host but the fixture with 502 and never counts it, so What this means here: nothing to fix in this PR. Once #1930 lands, this branch can be rebased onto that base and re-run; in the meantime a re-run of the failed job on the current head should clear it while the runner stays quiet. Every other check on this PR is green, including |
Problem
A background command that ended — stopped from the dock or exited on its own — left the shared Todo/task container on screen with a "1 background tasks" header and no rows inside it.
host-core keeps a finished task in its registry so its output and exit code stay readable, and the container derived its presence, its live count, and its header count from that full session list instead of the rows it could actually render. The spec already requires that "a container with nothing to show renders nothing" and that a finished task leaves the container after the grace window, so the renderer was drifting from documented behavior.
Fix
TaskDockgates on the renderable rows and counts them for the live and header counts.useBackgroundTasksgives the tab and badge rules the same description (sidesFor(visibleTasks, …)throughsidesRef) and no longer exposessessionTasks, so the registry history cannot silently become a presence source again.Tests
apps/desktop/test/background-tasks-dock-render.test.mjsrenders the real container (store + locale, task data layer stubbed). It fails on the old code: finished-only history rendered a header with an empty list.node --test test/background-tasks*.test.mjs test/todo-dock-rendering.test.mjs→ 55 passed.tsc -p apps/desktop/tsconfig.json --noEmit,node scripts/check-style-tokens.mjs,biome lint→ clean.One commit on top of
main(467bc51);check-pr-basepasses against that base.verify:ui:*was not run (no UI-E2E authorization for this change).Known, pre-existing drift left untouched:
scripts/e2e-background-tasks.mjsstill imports the removedBackgroundTasksBarcomponent, so that E2E cannot run against this surface.