fix: align Modern UI sidebar sash with maximized panel - #333753
Open
xhugoliu wants to merge 1 commit into
Open
Conversation
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Benjamin Christopher Simmonds (@benibenj)Matched files:
|
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes #333303 by correctly aligning Modern UI sidebars and sashes beside a maximized centered panel.
Changes:
- Treats the maximized horizontal panel as the middle layout card.
- Adds regression coverage across sidebar positions, densities, and Activity Bar visibility.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
layoutService.ts |
Corrects floating-card edge ownership. |
layoutService.test.ts |
Covers maximized-panel layout combinations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+189
to
+193
| // A maximized horizontal panel replaces the editor in the middle-section branch. Include it | ||
| // in the horizontal order so a side/aux bar next to it does not incorrectly claim the | ||
| // panel-facing edge's outer gutter. Without this, a single visible side bar gets a trailing | ||
| // outer margin in addition to the panel's leading margin, leaving a doubled gap while the | ||
| // grid sash still targets the normal inter-card gap. |
Comment on lines
+207
to
+211
| // on its placement side, and the editor in the middle. A centered horizontal panel is inserted | ||
| // next to the side bar group when it replaces the hidden editor in the middle-section branch. | ||
| // Each edge is resolved by walking this order inward to the first *visible* card. When no | ||
| // horizontal panel occupies that branch, a hidden editor lets a maximized side bar span the | ||
| // content width and own both edges. |
Comment on lines
+210
to
+212
| // With a maximized horizontal panel, the panel is the card immediately to the | ||
| // right/left of a single primary side bar. The side bar must keep its normal | ||
| // trailing inner margin so the sash occupies the one inter-card gap. |
Comment on lines
+134
to
+135
| // A maximized horizontal panel occupies the editor branch. It must therefore be | ||
| // considered when resolving the edge next to a single side bar. |
Author
Screen.Recording.2026-09-01.at.19.39.43.mov |
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.
Fixes #333303
Summary
The floating layout owner calculation skipped a centered horizontal Panel when the editor area was hidden by a maximized Panel. With only one side bar visible, the side bar could claim the outer edge while the Panel still reserved its leading gutter, producing a doubled gap and an off-center sash grip.
This change:
Testing
npm run compilenode build/eslint.ts src/vs/workbench/services/layout/browser/layoutService.ts src/vs/workbench/services/layout/test/browser/layoutService.test.tsunset ELECTRON_RUN_AS_NODE && VSCODE_SKIP_PRELAUNCH=1 ./scripts/test.sh --run src/vs/workbench/services/layout/test/browser/layoutService.test.ts(11 passing)A macOS verification recording is available locally. If GitHub does not accept the video while editing the PR, it will be attached in a follow-up comment.