Fix macOS sidebar traffic light spacer rendering with custom titlebar#298669
Fix macOS sidebar traffic light spacer rendering with custom titlebar#298669
Conversation
There was a problem hiding this comment.
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.mdto 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. |
|
@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. |
No description provided.