Skip to content

fix: align Modern UI sidebar sash with maximized panel - #333753

Open
xhugoliu wants to merge 1 commit into
microsoft:mainfrom
xhugoliu:fix/333303-modern-ui-sash
Open

fix: align Modern UI sidebar sash with maximized panel#333753
xhugoliu wants to merge 1 commit into
microsoft:mainfrom
xhugoliu:fix/333303-modern-ui-sash

Conversation

@xhugoliu

@xhugoliu xhugoliu commented Sep 1, 2026

Copy link
Copy Markdown

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:

  • treats a visible centered horizontal Panel as the middle-section card when the editor is hidden;
  • keeps Primary Side Bar and Auxiliary Bar edge ownership consistent on either side of the window; and
  • adds regression coverage for side bar positions, Activity Bar visibility, both side bars, and compact/default densities.

Testing

  • npm run compile
  • node build/eslint.ts src/vs/workbench/services/layout/browser/layoutService.ts src/vs/workbench/services/layout/test/browser/layoutService.test.ts
  • unset ELECTRON_RUN_AS_NODE && VSCODE_SKIP_PRELAUNCH=1 ./scripts/test.sh --run src/vs/workbench/services/layout/test/browser/layoutService.test.ts (11 passing)
  • Manual verification with Modern UI enabled: maximized centered Panel with a single Primary or Auxiliary Side Bar, both side bars visible, and sash dragging. The inter-card gap and grip alignment were correct immediately in each case.

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.

Copilot AI balanced review requested due to automatic review settings September 1, 2026 11:48
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Benjamin Christopher Simmonds (@benibenj)

Matched files:

  • src/vs/workbench/services/layout/browser/layoutService.ts
  • src/vs/workbench/services/layout/test/browser/layoutService.test.ts

@xhugoliu

xhugoliu commented Sep 1, 2026

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.
@xhugoliu

xhugoliu commented Sep 1, 2026

Copy link
Copy Markdown
Author
Screen.Recording.2026-09-01.at.19.39.43.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modern UI: sidebar sash becomes too wide and off-center with maximized Panel

5 participants