Skip to content

fix(composer): keep the task dock collapse across session switches - #1860

Merged
vastsa merged 1 commit into
mainfrom
fix/task-dock-collapse-memory
Oct 24, 2026
Merged

vastsa merged 1 commit into
mainfrom
fix/task-dock-collapse-memory

Conversation

@vastsa

@vastsa vastsa commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Problem

The Todo / background-task container above the composer forgot that the user had closed it: switching sessions reopened it, and it defaulted to expanded.

Cause

DockViewState stored collapsed inside each per-session entry, and toggleCollapsed / setCollapsed were session-scoped. Any session without its own entry read EMPTY_SESSION_DOCK.collapsed = false, so the first render after a session switch expanded what the user had just closed.

Fix

  • The collapse is now one container-wide condition on DockViewState; the tab choice and the badge stay per session.
  • DockViewState.collapsed defaults to true, so the container starts collapsed.
  • pruneDockView only drops per-session entries and never touches the collapse.
  • Tests pin both rules: default collapsed, and a closed container stays closed after switching sessions (while the tab choice stays per session).

Verification

  • node --test apps/desktop/test/background-tasks-dock-state.test.mjs — 19/19 pass
  • node --test apps/desktop/test/todo-dock-rendering.test.mjs — 2/2 pass
  • desktop suite (node --test test/*.test.mjs): 4396/4402 pass; the 3 failures + 1 file are environment-only in this worktree (duplicate React copy, Gemini adapter) and are unrelated to this change
  • scripts/check-style-tokens.mjs — OK
  • tsc reports no diagnostics in the touched files (the baseline already fails typecheck on unrelated gen-ui/settings symbols)
  • scripts/check-pr-base-main.mjs — passed

The Todo/background-task container stored its collapse inside the
per-session entry, so every session the user switched to started from
its own default and reopened a container they had just closed.

Move the collapse out of the per-session state: it is one container-wide
condition that survives session switches, while the tab choice and the
badge stay per session. The container now also starts collapsed, so the
composer keeps its room until the user opens it, and the state is no
longer pruned together with dead sessions.
Copilot AI balanced review requested due to automatic review settings October 24, 2026 10:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@vastsa
vastsa merged commit 68f3443 into main Oct 24, 2026
9 of 10 checks passed
@vastsa
vastsa deleted the fix/task-dock-collapse-memory branch November 6, 2026 04:24

This branch was previously deployed

1 inactive deployment
Preview — 672ed35e Deployed Oct 24, 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