Repository navigation
fix(composer): keep the task dock collapse across session switches - #1860
Merged
Merged
Conversation
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.
This branch was previously deployed
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.
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
DockViewStatestoredcollapsedinside each per-session entry, andtoggleCollapsed/setCollapsedwere session-scoped. Any session without its own entry readEMPTY_SESSION_DOCK.collapsed = false, so the first render after a session switch expanded what the user had just closed.Fix
DockViewState; the tab choice and the badge stay per session.DockViewState.collapseddefaults totrue, so the container starts collapsed.pruneDockViewonly drops per-session entries and never touches the collapse.Verification
node --test apps/desktop/test/background-tasks-dock-state.test.mjs— 19/19 passnode --test apps/desktop/test/todo-dock-rendering.test.mjs— 2/2 passnode --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 changescripts/check-style-tokens.mjs— OKtscreports no diagnostics in the touched files (the baseline already fails typecheck on unrelated gen-ui/settings symbols)scripts/check-pr-base-main.mjs— passed