Skip to content

Fix macOS sidebar traffic light spacer rendering with custom titlebar#298669

Merged
benibenj merged 1 commit intomainfrom
benibenj/copilot-worktree-2026-03-02T08-58-26
Mar 2, 2026
Merged

Fix macOS sidebar traffic light spacer rendering with custom titlebar#298669
benibenj merged 1 commit intomainfrom
benibenj/copilot-worktree-2026-03-02T08-58-26

Conversation

@benibenj
Copy link
Contributor

@benibenj benibenj commented Mar 2, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 2, 2026 09:28
@vs-code-engineering vs-code-engineering bot added this to the March 2026 milestone Mar 2, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes the Agent Sessions sidebar “traffic light” spacer behavior on macOS so it only renders when the window is using a custom titlebar, avoiding incorrect spacing when the OS is rendering the native titlebar/traffic lights.

Changes:

  • Gate sidebar traffic-light spacer creation behind !hasNativeTitlebar(...) to avoid rendering it with native titlebars.
  • Inject configuration service + use window titlebar-style helpers to determine titlebar mode.
  • Update src/vs/sessions/LAYOUT.md to reflect the corrected behavior and add a changelog entry.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/vs/sessions/browser/parts/sidebarPart.ts Adds a native-titlebar guard so the 70px macOS traffic-light spacer is only created for custom titlebars.
src/vs/sessions/LAYOUT.md Updates layout documentation and changelog to match the new spacer behavior.

@benibenj
Copy link
Contributor Author

benibenj commented Mar 2, 2026

@copilot Sidebar traffic-light spacer logic doesn’t account for RTL locales on macOS. TitlebarPart detects RTL via Intl.Locale().textInfo.direction and treats traffic lights as being on the right; SidebarPart currently always prepends a 70px spacer on the left when using a custom titlebar, which would leave an unnecessary gap in RTL locales. Consider mirroring TitlebarPart’s primaryWindowControlsLocation detection and only adding the spacer when the traffic lights are on the left (or placing it on the correct side).

also, hasNativeTitlebar already falls back to getTitleBarStyle(configurationService) when titleBarStyle isn’t provided. You can simplify this condition to !hasNativeTitlebar(this.configurationService) and drop the getTitleBarStyle import to keep the code shorter and reduce coupling.

Copy link
Contributor

Copilot AI commented Mar 2, 2026

@benibenj I've opened a new pull request, #298678, to work on those changes. Once the pull request is ready, I'll request review from you.

@benibenj benibenj merged commit 4a38deb into main Mar 2, 2026
24 checks passed
@benibenj benibenj deleted the benibenj/copilot-worktree-2026-03-02T08-58-26 branch March 2, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants