fix(workbench): collapse the right panel when its active rail button is clicked again - #1271
Open
130rockirt wants to merge 1 commit into
Open
fix(workbench): collapse the right panel when its active rail button is clicked again#1271130rockirt wants to merge 1 commit into
130rockirt wants to merge 1 commit into
Conversation
…is clicked again Clicking a side-rail button (e.g. provider quotas) always re-opened the same tab and there was no way to collapse the panel from the rail. Route rail clicks through resolveCodeRightToolClick so clicking the button of the currently visible tool collapses the panel, matching the pressed state shown on the button.
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.
Summary
Clicking a button in the right side rail (e.g. 用量与额度 / Provider quotas) always re-opened the same tab and there was no way to collapse the panel from the rail. This makes the rail buttons act as toggles: clicking the button of the tool that is currently visible collapses the right panel; clicking any other button (or clicking again while collapsed) opens it.
Changes
resolveCodeRightToolClick(id, rightPanelMode)inuseWorkbenchRightTools.tsthat maps a rail click toopen/collapse/toggle-terminal.openCodeRightToolnow routes through that decision: when the clicked tool is already visible it collapses the panel (closing the side conversation surface when applicable) instead of re-opening the same tab; the terminal keeps its own separate toggle path.rightPanelModefromWorkbench.tsxinto the hook so the decision uses exactly what the rail highlights as active.Tests
useWorkbenchRightTools.test.tscovering: clicking the visible tool collapses, clicking another tool or while collapsed opens, and the terminal keeps its toggle path.npx vitest run src/renderer/src/components/workbench src/renderer/src/components/chat/WorkbenchTopBar.test.ts- 42 files / 268 tests passed.npm run typecheckpassed.npm run check:file-linespassed.