Move agent host picker to sessions sidebar (web desktop)#313619
Merged
osortega merged 6 commits intoMay 1, 2026
Conversation
On web desktop (vscode.dev/agents), surface the agent host picker in a
new toolbar at the bottom of the sessions sidebar instead of the
titlebar's left layout. The new widget is modeled on
AICustomizationShortcutsWidget but is always expanded -- no collapse
chevron, no storage key.
Scope:
- Web desktop: picker moves to the sidebar (new SidebarAgentHost menu).
- Web phone: unchanged -- still rendered in MobileTitlebarPart.
- Electron: unchanged -- no host picker, never had one.
Visual alignment:
HostFilterActionViewItem gains a HostFilterAppearance ('titlebar' |
'sidebar') parameter so it can render the same Monaco Button +
.sidebar-action-button shell used by CustomizationLinkViewItem. The
sidebar appearance lays out the picker button as
[remote-icon] [host-name (flex:1)] [chevron-down], with the connect /
disconnect / re-discover indicator as an independent 26x26 sibling
control to the right. When there are no hosts the right slot becomes a
refresh button that triggers rediscover().
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
|
Contributor
There was a problem hiding this comment.
Pull request overview
Moves the agent host picker from the sessions titlebar (web desktop) into a new “Agent Host” toolbar at the bottom of the sessions sidebar, while keeping phone and Electron behavior unchanged.
Changes:
- Added a new sidebar-mounted
AgentHostShortcutsWidgetthat rendersMenus.SidebarAgentHostviaMenuWorkbenchToolBar. - Introduced a
HostFilterAppearanceoption to render the host picker either as the existing titlebar pill or as a full-width sidebar row (plus updated contribution wiring). - Added unit coverage for the new always-expanded toolbar widget rendering.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/contrib/sessions/browser/views/sessionsView.ts | Mounts the new sidebar agent host toolbar on web desktop. |
| src/vs/sessions/contrib/sessions/browser/agentHostShortcutsWidget.ts | New widget hosting a menu-driven toolbar for the sidebar “Agent Host” section. |
| src/vs/sessions/contrib/sessions/browser/media/agentHostToolbar.css | Styles the new bottom-of-sidebar toolbar layout. |
| src/vs/sessions/contrib/sessions/test/browser/agentHostShortcutsWidget.test.ts | New test asserting the toolbar renders always-expanded (no collapse affordance). |
| src/vs/sessions/browser/menus.ts | Adds Menus.SidebarAgentHost menu ID. |
| src/vs/sessions/contrib/remoteAgentHost/browser/hostFilter.contribution.ts | Re-targets registration to the new sidebar menu on web desktop and wires sidebar appearance. |
| src/vs/sessions/contrib/remoteAgentHost/browser/hostFilterActionViewItem.ts | Adds HostFilterAppearance and implements sidebar rendering path + rediscover UI. |
| src/vs/sessions/contrib/remoteAgentHost/browser/mobileHostFilterActionViewItem.ts | Updates super call to explicitly use the titlebar appearance. |
| src/vs/sessions/contrib/remoteAgentHost/browser/media/hostFilter.css | Adds sidebar-specific layout rules and rediscover styling. |
Copilot's findings
- Files reviewed: 9/9 changed files
- Comments generated: 6
…onViewItem.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…tsWidget.test.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Drop the icon-by-state enumeration from the HostFilterActionViewItem
class JSDoc.
- Sidebar picker no longer no-ops with 0 hosts: pass the click event
through to `_showMenu`, which already routes to `rediscover()` when
no hosts are known. Same affordance as the dedicated refresh slot.
- Widen `_showMenu(e)` to accept `Event`; this avoids fabricating a
synthetic `MouseEvent('click')` that would anchor the context menu
at (0,0) on touch/gesture activations. `dom.isMouseEvent(e)` keeps
the runtime check.
- Gate the `AgentHostShortcutsWidget` mount on
`IsSessionsWindowContext && !IsAuxiliaryWindowContext && !IsPhoneLayoutContext`
instead of `isWeb && !isPhoneLayout(...)`. Prevents an empty toolbar
shell in auxiliary windows and aligns the runtime gate with the
agents-window context the menu items target.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Hold stable references to the leading host icon and trailing chevron
as `_sidebarLeadingIcon` / `_sidebarTrailingIcon` fields, created
once in `_renderSidebar()`. `_renderSidebarButtonAffordances` now
attaches/detaches the chevron via `appendChild` / `remove` on the
stored reference instead of `querySelector(':scope > ...)`, fixing
the `no-restricted-syntax` ESLint warnings reported by CI.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
aeschli
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Surface the agent host picker in a new Agent Host toolbar at the bottom of
the sessions sidebar instead of the titlebar's left layout. The new widget is
modeled on
AICustomizationShortcutsWidgetbut is always expanded — nocollapse chevron, no storage key.
Scope
Menus.TitleBarLeftLayoutMenus.MobileTitleBarCenterIsWebContext)The new sidebar entry's
whenclause isIsWebContext && !IsAuxiliaryWindowContext && !IsPhoneLayoutContext, and the widget mount inSessionsView.createControls()is gated onisWeb && !isPhoneLayout(layoutService)so electron and phone layouts never render an empty toolbar shell.Visual alignment
HostFilterActionViewItemgains aHostFilterAppearance = 'titlebar' | 'sidebar'constructor parameter. The'sidebar'variant renders the same MonacoButton+.sidebar-action-buttonshell asCustomizationLinkViewItem, so the host row looks identical in rhythm to the customizations rows above:Button.label) so the chevron docks cleanly to the trailing edge.rediscover()— same shape as the disconnect button on a real host.Files
src/vs/sessions/contrib/sessions/browser/agentHostShortcutsWidget.tssrc/vs/sessions/contrib/sessions/browser/media/agentHostToolbar.csssrc/vs/sessions/contrib/sessions/test/browser/agentHostShortcutsWidget.test.tssrc/vs/sessions/browser/menus.ts— addsMenus.SidebarAgentHostsrc/vs/sessions/contrib/sessions/browser/views/sessionsView.ts— mounts the widget below the customizations widget on web desktop onlysrc/vs/sessions/contrib/remoteAgentHost/browser/hostFilterActionViewItem.ts— newHostFilterAppearanceparameter and'sidebar'rendering pathsrc/vs/sessions/contrib/remoteAgentHost/browser/mobileHostFilterActionViewItem.ts— explicit'titlebar'super argsrc/vs/sessions/contrib/remoteAgentHost/browser/media/hostFilter.css— sidebar layout + rediscover state stylingsrc/vs/sessions/contrib/remoteAgentHost/browser/hostFilter.contribution.ts— re-targets the desktop registration fromTitleBarLeftLayout→SidebarAgentHostTesting