Skip to content

fix(chat): hide the task dock with its last row - #1932

Merged
vastsa merged 2 commits into
vastsa:mainfrom
algerkong:fix/task-dock-hide-with-last-row
Oct 28, 2026
Merged

vastsa merged 2 commits into
vastsa:mainfrom
algerkong:fix/task-dock-hide-with-last-row

Conversation

@algerkong

Copy link
Copy Markdown
Contributor

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

  • TaskDock gates on the renderable rows and counts them for the live and header counts.
  • useBackgroundTasks gives the tab and badge rules the same description (sidesFor(visibleTasks, …) through sidesRef) and no longer exposes sessionTasks, so the registry history cannot silently become a presence source again.

Tests

  • New apps/desktop/test/background-tasks-dock-render.test.mjs renders 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.
  • No host / Rust change, so no cargo run was needed.

One commit on top of main (467bc51); check-pr-base passes 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.mjs still imports the removed BackgroundTasksBar component, so that E2E cannot run against this surface.

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.
@algerkong

Copy link
Copy Markdown
Contributor Author

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: Trusted extensions Electron E2E → step Run provider optional client certificate E2E. It is already red on main, without this change:

ref trusted-e2e
main 467bc51 (this PR's base) failure
main 49430ab failure
main 067a13a (on #1930) success

Root cause: scripts/e2e/provider-client-certificate.ts asserted that every tunnel the fixture proxy sees targets localhost. Chromium's own component updater also reaches the configured session proxy, and on a cold runner that CONNECT targets a gvt1.com CDN host, so the assertion fired through the uncaught-exception path after every probe step had already logged green.

Existing fix (not in main yet): 067a13a on #1930 — 067a13a

fix(e2e): ignore Chromium background CONNECTs in the certificate probe

It refuses a CONNECT for any host but the fixture with 502 and never counts it, so tunnels keeps measuring fixture traffic only, plus a self-check that asserts the refusal.

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 JS build / typecheck / lint / architecture / test, which is the one that covers this change.

@algerkong

Copy link
Copy Markdown
Contributor Author

The certificate-probe flake this PR's red check comes from is now proposed on its own as #1933 (single file, scripts/e2e/provider-client-certificate.ts, same change as 067a13a3 above). Nothing to change here: once #1933 is on main this branch only needs a rebase and the Electron job goes green.

@vastsa
vastsa merged commit 7a7b167 into vastsa:main Oct 28, 2026
6 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 47725634 Deployed Oct 28, 2026 by vercel[bot]
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.

2 participants