fix(workspace): stop layout jumps and stale chrome when switching workspaces - #224
Merged
Merged
Conversation
…kspaces The page instance is reused across workspace navigation, so the header, drawer, attention banner and run controls rendered the previous workspace's details until the new ones loaded, and the chat pane animated its side-panel padding from the previous workspace's layout. - Render header, drawer, tasks, roster and active run from details that belong to the current workspace; show the rail's title meanwhile. - Keep the drawer shell open with a loading state during the switch. - Key the chat pane by workspace so its padding applies without the 220ms transition. - Keep the title's rename padding stable while details load.
…left workspace - Rename the state to rawDetails; details is the workspace-gated value, so the fork-prompt effect, stop-lock clear and settings modal are gated too. - loadDetails and the title/pause optimistic updaters ignore results for a workspace the user has left. - Apply titleEditable only when the title is editable again. - Test the rail title during loading, the gated counts/attention banner, and a late reply from the previous workspace.
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
When you switched from workspace A to workspace B, the page kept showing A's data until B's details finished loading. That included A's header, drawer, counts and run state. So pressing Stop or Ctrl+C during that time could cancel A's run. The chat area's padding also animated on every switch.
Fix (
src/pages/Workspace.tsx)rawDetails. Every consumer now readsdetails, which is only set once it matches the currentworkspaceId, so everything is gated by default.Tests
Workspace.test.tsxcovers:Lint, typecheck and vitest (700 tests) pass locally.
Not covered
runNowBusy/pauseBusyflags andsetErrorcalls can still land on B, an existing error banner survives the switch, and the catch/finally guards have no test.