Skip to content

Commit fe1f660

Browse files
sessions: refine Open in VS Code titlebar styling (#313056)
* sessions: refine Open in VS Code titlebar styling Align the sessions titlebar button more closely with the core Open in Agents affordance. Add the grayscale-to-color icon treatment with reduced-motion handling, switch the hover chrome to the secondary button background, and tune the separator and spacing around the adjacent Run split button. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * sessions: address PR review feedback on titlebar styling - Fix incorrect menu ID references in LAYOUT.md (OpenSubMenu/TitleBarRight -> TitleBarSessionMenu/TitleBarRightLayout) and update file references to openInVSCode.contribution.ts and openInVSCodeWidget.ts - Use --vscode-button-secondaryHoverBackground (hover token) instead of --vscode-button-secondaryBackground (resting token) for correct hover contrast - Strengthen CSS selector specificity for Run split button margin so it beats the conflicting margin-left: 0 rule in changesTitleBarWidget.css Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * sessions: fix run action titlebar spacing regression Target the Run split button's action-item wrapper so the 5px margin applies on the same element used by the titlebar action bar layout and the adjacent Changes override. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ffc280d commit fe1f660

4 files changed

Lines changed: 43 additions & 22 deletions

File tree

src/vs/sessions/LAYOUT.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,10 @@ The Run Script action:
124124
- Registered in `contrib/chat/browser/runScriptAction.ts`
125125

126126
The Open... action:
127-
- Displayed as a split button via `Menus.OpenSubMenu` on `Menus.TitleBarRight`
127+
- Contributed on `Menus.TitleBarSessionMenu` and laid out on `Menus.TitleBarRightLayout`
128128
- Contains "Open Terminal" (opens terminal at session worktree) and "Open in VS Code" (opens worktree in new VS Code window)
129-
- Registered in `contrib/chat/browser/chat.contribution.ts`
129+
- The "Open in VS Code" titlebar widget mirrors the core "Open in Agents" affordance: the product icon is greyscale at rest, returns to full color on hover/focus while respecting reduced-motion preferences, uses secondary-button hover chrome, and draws a separator before the adjacent Run split button
130+
- "Open in VS Code" is contributed in `contrib/chat/browser/openInVSCode.contribution.ts`, and its custom titlebar widget is registered in `contrib/chat/browser/openInVSCodeWidget.ts` (imported from `contrib/chat/browser/chat.contribution.ts`)
130131

131132
### 3.5 Panel Title Actions
132133

@@ -664,6 +665,7 @@ interface IPartVisibilityState {
664665

665666
| Date | Change |
666667
|------|--------|
668+
| 2026-04-28 | Updated the sessions "Open in VS Code" titlebar widget to match the core "Open in Agents" affordance more closely: the product icon is greyscale by default, animates back to full color on hover/focus when motion is enabled, uses secondary-button hover chrome instead of quality-tinted backgrounds, and draws a separator before the Run split button. |
667669
| 2026-04-27 | Made the sessions shell gradient background the default treatment by removing the `sessions.experimental.shellGradientBackground` opt-in, always applying the root shell gradient layer, and renaming the workbench CSS hook to `shell-gradient-background`. |
668670
| 2026-04-23 | Updated mobile layout policy platform detection to use shared `platform.isMobile`, and reduced phone-layout CSS `!important` usage where selector specificity already provides stable overrides. |
669671
| 2026-04-22 | Increased the sessions titlebar account widget's GitHub profile image from `16px × 16px` to `18px × 18px` while keeping the existing `22px × 22px` control footprint and avatar border treatment. |

src/vs/sessions/browser/parts/media/titlebarpart.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@
6363
align-items: center;
6464
}
6565

66+
.monaco-workbench .part.titlebar > .titlebar-container.sessions-titlebar-container .monaco-toolbar .actions-container {
67+
gap: 1px;
68+
}
69+
70+
.agent-sessions-workbench.monaco-workbench .part.titlebar > .sessions-titlebar-container > .titlebar-right > .titlebar-session-actions-container .monaco-toolbar .actions-container > .action-item.open-in-vscode-titlebar-widget + .action-item {
71+
margin-left: 5px;
72+
}
73+
6674
/* Add spacing between the session action group and the right layout actions. */
6775
.monaco-workbench .part.titlebar > .sessions-titlebar-container > .titlebar-right > .titlebar-session-actions-container:not(.has-no-actions) + .titlebar-right-layout-container:not(.has-no-actions) {
6876
margin-left: 4px;

src/vs/sessions/contrib/chat/browser/media/openInVSCode.css

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
align-items: center;
1010
height: 22px;
1111
padding: 0 4px;
12-
margin: 0;
12+
margin: 0 4px 0 2px;
1313
border-radius: 5px;
1414
cursor: pointer;
1515
color: var(--vscode-titleBar-activeForeground);
@@ -19,6 +19,17 @@
1919
touch-action: manipulation;
2020
}
2121

22+
.monaco-workbench .open-in-vscode-titlebar-widget::after {
23+
content: '';
24+
position: absolute;
25+
right: -6px;
26+
top: 4px;
27+
bottom: 4px;
28+
width: 1px;
29+
background-color: var(--vscode-widget-border, rgba(128, 128, 128, 0.5));
30+
pointer-events: none;
31+
}
32+
2233
.monaco-workbench .open-in-vscode-titlebar-widget > .open-in-vscode-titlebar-widget-icon {
2334
width: 16px;
2435
height: 16px;
@@ -31,6 +42,7 @@
3142
background-repeat: no-repeat;
3243
background-position: center center;
3344
background-size: contain;
45+
filter: grayscale(1);
3446
}
3547

3648
/* In production builds vscode-distro overlays vs/workbench/browser/media/code-icon.svg
@@ -42,6 +54,21 @@
4254
background-image: url('../../../../../workbench/browser/media/code-icon.svg');
4355
}
4456

57+
.monaco-enable-motion .monaco-workbench .open-in-vscode-titlebar-widget > .open-in-vscode-titlebar-widget-icon,
58+
.monaco-workbench.monaco-enable-motion .open-in-vscode-titlebar-widget > .open-in-vscode-titlebar-widget-icon {
59+
transition: filter 150ms ease;
60+
}
61+
62+
.monaco-reduce-motion .monaco-workbench .open-in-vscode-titlebar-widget > .open-in-vscode-titlebar-widget-icon,
63+
.monaco-workbench.monaco-reduce-motion .open-in-vscode-titlebar-widget > .open-in-vscode-titlebar-widget-icon {
64+
transition-duration: 0ms !important;
65+
}
66+
67+
.monaco-workbench .open-in-vscode-titlebar-widget:hover > .open-in-vscode-titlebar-widget-icon,
68+
.monaco-workbench .open-in-vscode-titlebar-widget:focus-visible > .open-in-vscode-titlebar-widget-icon {
69+
filter: none;
70+
}
71+
4572
.monaco-workbench .open-in-vscode-titlebar-widget > .open-in-vscode-titlebar-widget-label {
4673
display: inline-block;
4774
max-width: 0;
@@ -65,26 +92,10 @@
6592

6693
.monaco-workbench .open-in-vscode-titlebar-widget:hover,
6794
.monaco-workbench .open-in-vscode-titlebar-widget:focus-visible {
68-
background-color: var(--vscode-toolbar-hoverBackground);
95+
background-color: var(--vscode-button-secondaryHoverBackground, var(--vscode-toolbar-hoverBackground));
6996
outline: none;
7097
}
7198

72-
/* Quality-tinted hover/focus background — blue (stable), green (insider), orange (exploration). */
73-
.monaco-workbench .open-in-vscode-titlebar-widget[data-product-quality="stable"]:hover,
74-
.monaco-workbench .open-in-vscode-titlebar-widget[data-product-quality="stable"]:focus-visible {
75-
background-color: rgba(0, 122, 204, 0.18);
76-
}
77-
78-
.monaco-workbench .open-in-vscode-titlebar-widget[data-product-quality="insider"]:hover,
79-
.monaco-workbench .open-in-vscode-titlebar-widget[data-product-quality="insider"]:focus-visible {
80-
background-color: rgba(36, 187, 26, 0.20);
81-
}
82-
83-
.monaco-workbench .open-in-vscode-titlebar-widget[data-product-quality="exploration"]:hover,
84-
.monaco-workbench .open-in-vscode-titlebar-widget[data-product-quality="exploration"]:focus-visible {
85-
background-color: rgba(255, 140, 0, 0.22);
86-
}
87-
8899
.monaco-workbench .open-in-vscode-titlebar-widget:hover > .open-in-vscode-titlebar-widget-label,
89100
.monaco-workbench .open-in-vscode-titlebar-widget:focus-visible > .open-in-vscode-titlebar-widget-label {
90101
max-width: 200px;

src/vs/sessions/contrib/chat/browser/openInVSCodeWidget.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class OpenInVSCodeTitleBarWidget extends BaseActionViewItem {
4040
container.classList.add('open-in-vscode-titlebar-widget');
4141
container.setAttribute('role', 'button');
4242

43-
// Set quality attribute for quality-tinted hover styling and distro icon selection.
44-
// Only set when quality is known so that the CSS fallback icon is used in dev builds.
43+
// Set quality attribute for distro icon selection. Only set when quality is
44+
// known so that the CSS fallback icon is used in dev builds.
4545
const quality = this.productService.quality;
4646
if (quality) {
4747
container.setAttribute('data-product-quality', quality);

0 commit comments

Comments
 (0)