sessions: update Open in VS Code titlebar button with hover animation and full-color icon#312250
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Agents/Sessions titlebar “Open in VS Code” entry to use a richer, expandable widget (icon-only at rest, label on hover/focus) and aligns menu ordering, while adding a dev-mode fallback for launching VS Code via protocol handler when a sibling app isn’t configured.
Changes:
- Adds a custom
BaseActionViewItem-based titlebar widget with hover/focus expand animation and a full-color VS Code logo asset + styling. - Reorders the “Open in VS Code” titlebar action earlier in the navigation group (order
9→7) and updates related ordering comments. - Enhances the electron-browser implementation to prefer
launchSiblingAppwhen configured, with a protocol-handler fallback for dev scenarios.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/contrib/chat/electron-browser/openInVSCode.contribution.ts | Adds sibling-app detection and protocol-handler fallback logic for opening VS Code from the Sessions window. |
| src/vs/sessions/contrib/chat/browser/openInVSCodeWidget.ts | Introduces the custom expandable titlebar widget and registers it via IActionViewItemService. |
| src/vs/sessions/contrib/chat/browser/openInVSCode.contribution.ts | Adjusts the titlebar menu order for the action. |
| src/vs/sessions/contrib/chat/browser/media/openInVSCode.css | Adds styling for hover/focus expansion, grayscale→color transition, and quality-tinted hover backgrounds. |
| src/vs/sessions/contrib/chat/browser/media/vscode-icon.svg | Adds a dev-time fallback full-color VS Code logo asset. |
| src/vs/sessions/contrib/chat/browser/chat.contribution.ts | Imports the new widget module to register it at runtime. |
| src/vs/sessions/contrib/changes/browser/changesTitleBarWidget.ts | Updates the ordering comment to reflect the new menu order. |
… and full-color icon - Add custom BaseActionViewItem widget that renders the Open in VS Code button with a slide-in label animation on hover/focus and a full-color VS Code logo that desaturates at rest via CSS filter - Reorder the button before the Run Tasks button (order 7 vs 8) - Use ICommandService.executeCommand directly in onClick to bypass precondition-gated ActionRunner.run() which silently blocked clicks - Add protocol handler fallback in electron-browser action for dev builds where no sibling app is configured (launchSiblingApp fails) - Quality-tinted hover backgrounds (blue/green/orange) based on product quality, matching the companion Open in Agents button in VS Code core Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1aa55e1 to
29178d2
Compare
- Only set data-product-quality attribute when productService.quality is defined (not in dev builds where quality is undefined) - CSS default background-image uses the bundled ./vscode-icon.svg shield (shown in dev builds where no quality attribute is present) - Added per-quality CSS rules pointing to ../../../../../workbench/browser/media/code-icon.svg — the file that vscode-distro overwrites at packaging time with the quality-specific branded VS Code icon (stable/insider/exploration) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- widget: replace ICommandService.executeCommand with this.action.run() and remove the now-unused ICommandService dependency - electron contribution: also check productService.embedded fields in hasSibling to align with launchSiblingApp's own resolution logic in siblingApp.ts which switches on process.isEmbeddedApp - CSS: scope filter and label transitions inside .monaco-enable-motion blocks and add .monaco-reduce-motion overrides, following the pattern established by other sessions titlebar widgets Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: sandy081 <10746682+sandy081@users.noreply.github.com>
Resolved the merge conflict in |
Feedback was addressed. Dismissing in order to merge.
Summary
Fixes #310014
Updates the "Open in VS Code" button in the Agents/Sessions titlebar with a rich expandable widget, mirroring the companion "Open in Agents" button in VS Code core (PR #312111).
Screen.Recording.2026-04-23.at.6.42.47.PM.mov
Changes
New widget with hover animation
BaseActionViewItemwidget (OpenInVSCodeTitleBarWidget) registered viaIActionViewItemServicemax-widthtransitionfilter: grayscale(1)touch-action: manipulationVS Code icon — dev fallback + distro integration
media/vscode-icon.svg— the VS Code shield logo bundled in the repo, used as a dev-time fallback whenproductService.qualityis undefinedvs/workbench/browser/media/code-icon.svgwith the quality-specific branded icon (stable/insider/exploration). The CSS[data-product-quality]attribute selectors switch to that path for all known qualitiesdata-product-qualityis only set on the widget element whenproductService.qualityis defined, ensuring the fallback SVG is shown in dev buildsButton reordering
Click fix
ICommandService.executeCommand()directly inonClickoverride to bypass the precondition-gatedActionRunner.run()check that silently blocked clicks when theMenuItemActionwas marked disabledDev fallback for electron-browser action
IOpenerService) for dev builds where no sibling app is configured (darwinSiblingBundleIdentifier/win32SiblingExeBasenameabsent)INativeHostService.launchSiblingAppas beforeFiles changed
openInVSCodeWidget.tsmedia/openInVSCode.cssmedia/vscode-icon.svgcode-icon.svgtakes precedence in prod)electron-browser/openInVSCode.contribution.tsbrowser/openInVSCode.contribution.tschat.contribution.tschangesTitleBarWidget.ts