Skip to content

Mobile titlebar: live session title + web host widget on welcome#312261

Merged
osortega merged 5 commits intomainfrom
agents/what-does-the-phone-mobile-version-of-the-57372dd9
Apr 24, 2026
Merged

Mobile titlebar: live session title + web host widget on welcome#312261
osortega merged 5 commits intomainfrom
agents/what-does-the-phone-mobile-version-of-the-57372dd9

Conversation

@osortega
Copy link
Copy Markdown
Contributor

On phone layouts the desktop titlebar is hidden and replaced by a mobile-specific bar above the grid. Two issues fixed here:

  1. The title was hardcoded to "New Session" because setTitle() was never called. It now subscribes to ISessionsManagementService.activeSession.title via autorun and updates live.
  2. On the home/empty (welcome) screen there was no way to pick an agent host or connect on mobile web. The host filter widget (dropdown + connection status/connect button) from the web titlebar is now surfaced in the mobile titlebar's center slot while the welcome view is visible.

Implementation

  • New MobileTitlebarPart under browser/parts/mobile/ replaces the old MobileTopBar. It hosts a hamburger, a center slot with a title element and a MenuWorkbenchToolBar for a new Menus.MobileTitleBarCenter menu id, and a new-session button. The center slot switches between title and toolbar based on SessionsWelcomeVisibleContext AND whether the toolbar has any contributed items, so empty menus (e.g., desktop/electron) fall back to showing the title.
  • Instantiated via IInstantiationService.createInstance so it can consume ISessionsManagementService / IContextKeyService.
  • hostFilter.contribution.ts registers a second menu entry on Menus.MobileTitleBarCenter (gated by IsWeb && !AuxiliaryWindow && HasAgentHosts && SessionsWelcomeVisible) plus a matching IActionViewItemService.register() call reusing the existing HostFilterActionViewItem. No new widget code.
  • Layering is preserved: browser/ never imports from contrib/; the mobile part only knows about the menu id.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

On phone layouts the desktop titlebar is hidden and replaced by a mobile-specific bar above the grid. Two issues fixed here:

1. The title was hardcoded to "New Session" because `setTitle()` was never called. It now subscribes to `ISessionsManagementService.activeSession.title` via `autorun` and updates live.
2. On the home/empty (welcome) screen there was no way to pick an agent host or connect on mobile web. The host filter widget (dropdown + connection status/connect button) from the web titlebar is now surfaced in the mobile titlebar's center slot while the welcome view is visible.

## Implementation

- New `MobileTitlebarPart` under `browser/parts/mobile/` replaces the old `MobileTopBar`. It hosts a hamburger, a center slot with a title element and a `MenuWorkbenchToolBar` for a new `Menus.MobileTitleBarCenter` menu id, and a new-session button. The center slot switches between title and toolbar based on `SessionsWelcomeVisibleContext` AND whether the toolbar has any contributed items, so empty menus (e.g., desktop/electron) fall back to showing the title.
- Instantiated via `IInstantiationService.createInstance` so it can consume `ISessionsManagementService` / `IContextKeyService`.
- `hostFilter.contribution.ts` registers a second menu entry on `Menus.MobileTitleBarCenter` (gated by `IsWeb && !AuxiliaryWindow && HasAgentHosts && SessionsWelcomeVisible`) plus a matching `IActionViewItemService.register()` call reusing the existing `HostFilterActionViewItem`. No new widget code.
- Layering is preserved: `browser/` never imports from `contrib/`; the mobile part only knows about the menu id.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 23, 2026 23:34
Copy link
Copy Markdown
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

Updates the Agent Sessions (Agents window) phone layout to make the mobile titlebar reflect the active session title live and to expose the web agent-host picker on the welcome screen, bringing feature parity with the desktop/web titlebar while keeping layering intact.

Changes:

  • Replace the old MobileTopBar DOM component with a new DI-friendly MobileTitlebarPart that syncs to activeSession.title and can host a center-slot toolbar.
  • Introduce Menus.MobileTitleBarCenter and contribute the existing host filter widget to it on web while the welcome overlay is visible.
  • Update phone-layout CSS and documentation to match the new component and behavior.
Show a summary per file
File Description
src/vs/sessions/MOBILE.md Updates mobile layout documentation and references to the new mobile titlebar implementation.
src/vs/sessions/contrib/remoteAgentHost/browser/hostFilter.contribution.ts Adds a second menu location + action view item registration to surface the host filter in the mobile titlebar center slot on web welcome.
src/vs/sessions/browser/workbench.ts Wires creation/destruction of MobileTitlebarPart for phone layouts via DI and uses its height for layout offsets.
src/vs/sessions/browser/parts/mobile/mobileTopBar.ts Removes the old hardcoded-title mobile top bar implementation.
src/vs/sessions/browser/parts/mobile/mobileTitlebarPart.ts New mobile titlebar part: live session title via autorun, center-slot MenuWorkbenchToolBar, welcome-driven mode switch.
src/vs/sessions/browser/parts/mobile/mobileChatShell.css Adds layout/styles for the center slot and toggling between title vs. toolbar actions.
src/vs/sessions/browser/menus.ts Adds the new Menus.MobileTitleBarCenter menu id.

Copilot's findings

  • Files reviewed: 7/7 changed files
  • Comments generated: 2

Comment thread src/vs/sessions/browser/parts/mobile/mobileTitlebarPart.ts Outdated
osortega and others added 3 commits April 23, 2026 16:41
- MobileTitlebarPart: render the session title as a <button> so it is
  keyboard-focusable and handles touch via native button semantics.
- HostFilterActionViewItem: register Gesture.addTarget on both the
  dropdown pill and the connection button, and listen for TouchEventType.Tap
  alongside CLICK so iOS taps work reliably. Use dom.EventHelper.stop
  for consistency.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SessionsWelcomeVisibleContext is only true during the first-run
walkthrough overlay, not on the home/new-session screen. As a result
the host picker was never registered into the mobile titlebar's
center slot (the MenuWorkbenchToolBar reported zero items and the
title stayed visible). Switch the gate to IsNewChatSessionContext,
which is true whenever a new (empty) chat session is active, so the
widget shows on the phone home screen and hides once a real session
starts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The '.monaco-action-bar .action-item' base rule sets display:block with
higher specificity than '.agent-host-filter-combo', which caused the
dropdown pill and connect button inside the li to stack vertically on
the mobile titlebar. Qualify the combo selector with the action-item
class to override that rule and restore the intended horizontal layout.

Also switch '.mobile-top-bar-actions' to flex-direction: column so
future mobile titlebar actions can stack while each compound item
still lays out its internal controls as a row.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace hamburger unicode with [menu] to satisfy hygiene check.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@osortega osortega marked this pull request as ready for review April 24, 2026 18:45
@osortega osortega enabled auto-merge (squash) April 24, 2026 18:45
@osortega osortega merged commit 96d2420 into main Apr 24, 2026
40 of 41 checks passed
@osortega osortega deleted the agents/what-does-the-phone-mobile-version-of-the-57372dd9 branch April 24, 2026 19:25
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 24, 2026
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.

3 participants