Skip to content

Chat windows: always show the Agents title bar across the top - #346529

Merged
Sandeep Somavarapu (sandy081) merged 8 commits into
mainfrom
agents/chat-window-full-titlebar
Nov 6, 2026
Merged

Sandeep Somavarapu (sandy081) merged 8 commits into
mainfrom
agents/chat-window-full-titlebar

Conversation

@sandy081

@sandy081 Sandeep Somavarapu (sandy081) commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Stacked PR. Based on the strip PR's branch (#346528, agents/chat-window-activity-bar-strip); once it merges, GitHub retargets this to main and it will be rebased.

What

A chat window of the Agents window now always shows the Agents window's title bar as its first row, across the full width of the window, in every layout mode (Side by Side, Chat Only, Stacked, Editor Only) and density, so its title bar looks and acts like the main window's:

  • Command center in every chat window. It names the session of the window's active chat, and its actions act on that session, because the title bar is created with the window's services (session host and context keys).
  • Picking a session from the command center or the Sessions picker in a chat window (including F1 → Show Sessions Picker while the chat window is focused) opens it as a tab of that window:
    • a session already a tab there is activated;
    • a session shown in the main window's grid moves into the window, together with the editors the main window shows for it;
    • a session shown in another chat window is revealed there, not duplicated;
    • Ctrl/Alt+Enter opens it beside the window's active chat, in a group of its own;
    • New Session still opens in the main window (current behavior, marked in code).
  • Main-window navigation and app-wide items stay in the main window: the sessions list toggle, Back/Forward, New Session, Account/status, Update, and Remote Connections. The chat window's title bar adds the window's layout actions.
  • The title bar spans the window edge to edge, while the cards and the strip keep the window's outer insets, so Windows/Linux window controls sit in the window's corner and the macOS traffic lights keep the main window's spacing. The grid keeps the row's room as its pinned first row, and the title bar is laid over it.
  • The session header is in the chat's card, as in the main window. It hides while the chat shows only its input in Stacked mode.
  • The title bar height is the main window's title bar height for the current density (44px Default, 35px Compact). With window.titleBarStyle: native, the Agents title row still shows below the OS title bar, without window controls of its own.
  • Opening a session into an existing chat window moves the main window's editors for it, as opening a new chat window for it already did. Editors that cannot leave the main window stay there.

What's removed

The "merged title" special cases that showed the title in the chat card's header row only when the layout needed it:

  • titleMerged, titleInChatColumn, titleRowsShow, createTitleRow, setChatWindowTitleInChatColumn;
  • the window-controls reservation (reserveChatWindowControls) and header-actions alignment (alignChatWindowHeaderActions, trackChatWindowHeaderActions);
  • the title-height and strip-inset helpers;
  • title double-click handling (chatWindowTitleDoubleClick);
  • the part grid's leading/top-edge exceptions and move-preview adjuster;
  • the titlebar part's chat-only header-hosting APIs and their CSS variables.

Against the strip branch: 37 files changed, +851/−2248.

Docs: src/vs/sessions/LAYOUT.md ("Chat windows") and src/vs/sessions/DESKTOP.md (the strip starts below the title bar).

How to test

  1. Enable chat windows (sessions.chatWindows.enabled) and open a session in a new chat window (session header "…" → Open in New Window).
  2. Cycle the window's layout modes (Side by Side, Chat Only, Stacked, Editor Only) and Layout Density (Default, Compact). The Agents title bar stays across the top with the command center, the window's layout actions and the window controls. The session header is in the chat card, hidden in Stacked while only the input shows.
  3. In the chat window, open the command center or press the Sessions picker key:
    • pick a session shown in the main window → it moves into this window as a tab, with its editors;
    • pick one already in this window → it activates;
    • pick one in another chat window → that window reveals it;
    • Ctrl/Alt+Enter → it opens beside, in its own group;
    • New Session → it opens in the main window.
  4. Check that Toggle Side Bar, Back/Forward, New Session, Account, Update and Remote Connections are not in the chat window's title bar.
  5. On Windows/Linux, check that the window controls are in the window's top-right corner in Default density.
  6. Check high contrast themes, chat.disableAIFeatures (the command center and session actions hide), and window.titleBarStyle: native after a restart.

Validation

Commands run on the final head:

Command Result
pnpm run typecheck-client passed
./scripts/test.sh --runGlob "**/{sessions,workbench/contrib/sessions,workbench/contrib/chatWindow}/**/*.test.js" passed: 10680 passing, 27 pending
pnpm run eslint <changed files> passed
pnpm run stylelint passed
pnpm run valid-layers-check passed
pnpm exec component-explorer render -p ./test/componentFixtures/component-explorer.json --fixture-id-regex "chatWindow/titleBar|sessionActivityBar/ChatWindowColumn" passed: 40 fixtures rendered, reviewed

New and updated tests cover:

  • the title row across the top in every mode and after moves;
  • the title row spanning the window with its controls at the corner, while the cards keep their insets (Default and Compact);
  • the editors moving into an existing chat window before it takes the chat (tab, beside, background; movable and non-movable editors);
  • the picker's chat-window routing and edge cases;
  • the main-window-only menu items;
  • the header in the card, and hidden in Stacked input-only.

Both new review-driven tests fail with the fix reverted.

New component fixtures: sessions/chatWindow/titleBar/, covering 4 modes × Default/Compact, high contrast (dark and light), and the Session Activity Bar at its Normal size.

Live check (Code OSS dev build, macOS)

Driven end to end against the branch build and the base build (the strip head):

  • Title bar items: pass. The chat window's command center names its own session; no main-only or app-wide items.
  • Layout matrix: pass, 14/14 (4 modes × 2 densities, Stacked input-only and conversation, a 720px-wide window). In every row the title bar is at the top and spans the window, and the cards and tabs are below it.
  • Edge-to-edge row: title bar at x=0 and the full window width. The base build had it inset by 4px on both sides.
  • Keyboard: pass. Tab reaches the title bar first, and the Sessions picker key opens the picker in the chat window.
  • Picker: pass, 5/5 (move in, activate, reveal in the other window, beside, New Session in the main window).
  • High contrast dark/light and AI disabled: checked.
  • Native title bar, restored windows: pass, 2/2.
  • Renderer errors: none.

Performance

No regression. Measured locally on a Code OSS dev build (macOS): the strip head without this change against this change, with the main window and 2 chat windows, medians of 3 runs.

Scenario Without With
Opening and closing 5 chat windows: toolbar re-renders 1131 1021 (−10%)
Opening and closing 5 chat windows: long tasks (count / total time) 20 / 4.7 s 14 / 2.7 s
Focus round trips between the main window and 2 chat windows (120 switches): toolbar re-renders / long tasks 0 / 0 0 / 0
Idle 30 s: re-renders / long tasks 0 / 0 0 / 0
Resize drag: long tasks 0 0
  • Opening and closing chat windows also used less renderer and main-process CPU, and event listeners return to the baseline after the windows close.
  • Restore and startup show no difference beyond run-to-run noise.
  • Not measured live: layout mode switches, the terminal toggle, density switches, and picking from the command center. These do less work by construction, with one title bar per window instead of one title per chat editor.

Base automatically changed from agents/chat-window-activity-bar-strip to main November 6, 2026 13:20
A chat window now shows the Agents window's title bar as its first row,
across the full width of the window, in every layout mode and whatever its
parts show, at the main window's title bar height for the density, also
under a native OS title bar. It is created with the window's services, so
its command center shows the session of the window's active chat and its
session actions act on it. The main window's navigation (sessions list,
Back/Forward, New Session) and app-wide items (account and status, update,
remote connections) stay in the main window's title bar.

- The session header of a chat is in the chat's card again, as in the main
  window, and hides while the chat shows only its input in Stacked; its
  title still drags the chat's editor, carrying the session.
- A session picked from the Sessions picker of a chat window opens as a tab
  of that window, through openChatInWindow: a chat shown in a window already
  is revealed there; Ctrl/Alt+Enter opens it beside the window's active chat.
- Removes the title merged into the chat's card and everything only it
  needed: titleMerged/titleInChatColumn, isChatWindowTitleMerged, the
  grid's chatLeads/titleReachesRightEdge and move-preview adjuster, the part
  grid's leadsWindow/reachesRightEdge/setMovePreviewAdjuster and edge
  classes, the window-controls reservation, the title row of every chat
  editor, the title bar's fixed title, fixed height and header hosting, and
  the tab-row double-click and drag-to-move of the window.
- A component fixture shows a chat window in every layout mode and density,
  and in high contrast.

Co-authored-by: Copilot <[email protected]>
…n open window

The title row's grid cell now only keeps its room inside the window's outer insets; the title bar is laid over it across the whole window, so its window controls reach the window's corners as in the main window. This drops the left-inset compensation for the traffic lights.

A chat picked from the main window into an existing chat window takes the editors the main window shows for it into that window's main part, before the window takes the chat, as opening a new window for it does.

The title bar fixture shows the real Session Activity Bar in the strip's column and the cards framed as in production.

Co-authored-by: Copilot <[email protected]>
…r at its normal size

The title bar fixture follows the size chosen for the Session Activity Bar, which its column takes, and shows Side by Side and Stacked (Compact density) at the normal size besides the default compact size.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 6, 2026 13:51
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: ab84e78c Current: fd204586

Changed (3)

chat/chatToolRiskBadge/GreenInContext/Light
Before After
before after
chat/chatToolRiskBadge/OrangeInContext/Light
Before After
before after
chat/chatToolRiskBadge/RedInContext/Light
Before After
before after

Added (10)

sessions/chatWindow/titleBar/chatWindowTitleBar/SideBySide/Light

current

sessions/chatWindow/titleBar/chatWindowTitleBar/ChatOnly/Light

current

sessions/chatWindow/titleBar/chatWindowTitleBar/Stacked/Light

current

sessions/chatWindow/titleBar/chatWindowTitleBar/EditorOnly/Light

current

sessions/chatWindow/titleBar/chatWindowTitleBar/SideBySideCompact/Light

current

sessions/chatWindow/titleBar/chatWindowTitleBar/ChatOnlyCompact/Light

current

sessions/chatWindow/titleBar/chatWindowTitleBar/StackedCompact/Light

current

sessions/chatWindow/titleBar/chatWindowTitleBar/EditorOnlyCompact/Light

current

sessions/chatWindow/titleBar/chatWindowTitleBar/SideBySideNormalSize/Light

current

sessions/chatWindow/titleBar/chatWindowTitleBar/StackedCompactNormalSize/Light

current

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Editor transfer can leave source editors moved without the chat if opening fails, and the command center’s session dropdown can open sessions in the main window instead of the originating chat window.

2 open issues
What changed in this PR

This PR gives Agents chat windows a persistent, full-width title bar, building on the separate Session Activity Bar strip. It replaces layout-dependent merged headers with the shared Agents title bar and window-scoped session navigation.

Changes:

  • Keep the title bar across the top in every layout mode, with session headers inside chat cards.
  • Route Sessions picker selections into the originating chat window and transfer associated editors.
  • Remove merged-title infrastructure and update tests, visual fixtures, and documentation.
File Description
src/​vs/​workbench/​test/​browser/​parts/​partGrid/​partGrid.test.ts Updates drag behavior tests and removes edge-marker tests.
src/​vs/​workbench/​contrib/​sessions/​test/​browser/​parts/​sessionHeader.test.ts Updates the header drag API test.
src/​vs/​workbench/​contrib/​sessions/​browser/​parts/​sessionView.ts Removes external session-header hosting.
src/​vs/​workbench/​contrib/​sessions/​browser/​parts/​sessionHeaderBar.ts Separates editor dragging from window chrome.
src/​vs/​workbench/​contrib/​sessions/​browser/​parts/​sessionHeader.ts Exposes the simplified editor-drag API.
src/​vs/​workbench/​contrib/​sessions/​browser/​parts/​media/​chatCompositeBar.css Removes window-chrome header styling.
src/​vs/​workbench/​contrib/​chatWindow/​test/​browser/​chatWindow.test.ts Tests editor transfers into existing chat windows.
src/​vs/​workbench/​contrib/​chatWindow/​common/​chatWindowLayout.ts Removes merged-title state and logic.
src/​vs/​workbench/​contrib/​chatWindow/​browser/​chatWindowService.ts Transfers editors and removes merged-title tracking.
src/​vs/​workbench/​contrib/​chatWindow/​browser/​chatWindowGrid.ts Positions the title row edge to edge above the grid.
src/​vs/​workbench/​contrib/​chatWindow/​browser/​chatWindow.ts Updates title-row and editor-transfer contracts.
src/​vs/​workbench/​browser/​parts/​partGrid/​partGridDnd.ts Allows part dragging from all group-title empty space.
src/​vs/​workbench/​browser/​parts/​partGrid/​partGrid.ts Removes title-edge markers and preview exceptions.
src/​vs/​sessions/​test/​browser/​titlebarPart.test.ts Removes obsolete hosted-header tests.
src/​vs/​sessions/​test/​browser/​sessionViewTestUtils.ts Adds input-only behavior to the test chat view.
src/​vs/​sessions/​test/​browser/​sessionView.test.ts Removes external-header-hosting coverage.
src/​vs/​sessions/​sessions.desktop.main.ts Removes the special double-click contribution import.
src/​vs/​sessions/​LAYOUT.md Documents the persistent chat-window title bar.
src/​vs/​sessions/​DESKTOP.md Documents strip placement below the title bar.
src/​vs/​sessions/​contrib/​sessions/​test/​browser/​sessionsActions.test.ts Tests chat-window-aware picker routing.
src/​vs/​sessions/​contrib/​sessions/​browser/​sessionsTitleBarWidget.ts Enables the session command center in chat windows.
src/​vs/​sessions/​contrib/​sessions/​browser/​sessionsActions.ts Routes picker selections to the originating window.
src/​vs/​sessions/​contrib/​chatWindow/​test/​browser/​sessionsChatWindowProvider.test.ts Tests shared title-bar creation and density sizing.
src/​vs/​sessions/​contrib/​chatWindow/​test/​browser/​chatWindowTitleDoubleClick.test.ts Deletes obsolete double-click tests.
src/​vs/​sessions/​contrib/​chatWindow/​test/​browser/​chatWindowTitleBar.fixture.ts Adds layout, density, and theme fixtures.
src/​vs/​sessions/​contrib/​chatWindow/​test/​browser/​chatWindowContribution.test.ts Tests title-bar menu visibility by window type.
src/​vs/​sessions/​contrib/​chatWindow/​electron-browser/​chatWindowTitleDoubleClick.contribution.ts Deletes special native double-click wiring.
src/​vs/​sessions/​contrib/​chatWindow/​browser/​sessionsChatWindowProvider.ts Creates one shared Agents title bar per window.
src/​vs/​sessions/​contrib/​chatWindow/​browser/​media/​chatWindow.css Removes merged-title and floating-controls styling.
src/​vs/​sessions/​contrib/​chatWindow/​browser/​chatWindowTitleDoubleClick.ts Deletes tab-row double-click interception.
src/​vs/​sessions/​contrib/​chatEditor/​test/​browser/​chatEditor.test.ts Tests in-card headers and input-only visibility.
src/​vs/​sessions/​contrib/​chatEditor/​browser/​chatEditorContent.ts Keeps headers local and supports hiding them.
src/​vs/​sessions/​contrib/​chatEditor/​browser/​chatEditor.ts Removes per-editor title rows and updates sizing.
src/​vs/​sessions/​browser/​parts/​titlebarPart.ts Removes fixed-title and hosted-header APIs.
src/​vs/​sessions/​browser/​parts/​media/​titlebarpart.css Removes hosted-header title-bar styles.
build/​lib/​stylelint/​vscode-known-variables.json Removes obsolete chat-window CSS variables.

Review effort: Balanced

…so in browser tests

Browser unit tests load no styles, so the title of an editor group lays out
outside its cell, and a press from its rect started the drag outside the grid.
Start it from the top right of the cell instead.

Co-authored-by: Copilot <[email protected]>
…n in the window; open blocked sessions in the chat window

- The editors a chat brings along from the main window into an open chat window
  move back to where they came from when the chat does not open there: it does
  not resolve, opening it fails, or it shows in another window. The move stays
  before the window takes the chat, which takes its session out of the main window.
- In a chat window, a session picked from the command center's "sessions require
  input" list opens in that window, through the same opener as the Sessions picker.

Co-authored-by: Copilot <[email protected]>
…ght along go back

When the editors a chat brings along into an open chat window go back because the
chat does not open there, an editor the window showed already is copied back to
where it came from rather than moved, so the window keeps its own tab. Only the
editors that actually left their group are put back.

Tests: the same editor already in the window, the group the editors came from gone
meanwhile, and the arguments a blocked session picked in a chat window opens with.

Co-authored-by: Copilot <[email protected]>
…brought along go back

Moving the editors in activates the main window's active editor in the window's
group. When they go back because the chat does not open there, the window shows
the editor it showed as active before again.

Co-authored-by: Copilot <[email protected]>
…ntains them

Moving editors into a chat window now checks which ones left their group; the mock
group of the reset test answers that the editor left once it moved.

Co-authored-by: Copilot <[email protected]>
@sandy081
Sandeep Somavarapu (sandy081) merged commit c0a88d2 into main Nov 6, 2026
51 checks passed
@sandy081
Sandeep Somavarapu (sandy081) deleted the agents/chat-window-full-titlebar branch November 6, 2026 14:38
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 6, 2026
Sandeep Somavarapu (sandy081) added a commit that referenced this pull request Nov 6, 2026
…control Configure Layout (#346599)

* Chat windows: inset the title bar's last actions and name the layout control Configure Layout

- The layout actions of a chat window's title bar end at the same inset as the
  main window's title bar actions, and keep the main window's gap after the
  session's actions. Since #346529 they ended flush against the window edge
  (macOS) or its window controls (Windows, Linux).
- The Layout menu in the title bar and the Session Activity Bar is named
  Configure Layout, as the workbench's layout control is, in every layout mode,
  rather than after the current mode ("Layout: Side by Side").

Co-authored-by: Copilot <[email protected]>

* Chat windows: inset the title bar's last actions as far as the main window's

The main window's title bar sits inside the grid's floating panel gap (and keeps
that inset in Compact), so its last actions end 8px + the gap from the window
edge. A chat window's title bar spans the window edge to edge, so its layout
actions add that gap to their 8px inset to end at the same distance.

Co-authored-by: Copilot <[email protected]>

* Chat windows: keep only the inset before window controls the title bar draws itself

With window.controlsStyle custom (Windows, Linux), the title bar draws the
window controls after its actions. The main window's gap is then after the
controls, so the actions keep only their 8px before them. The title bar marks
itself when it draws its controls, and a chat window's layout actions keep
only their 8px there too.

Co-authored-by: Copilot <[email protected]>

* Chat windows: keep the gap before hidden custom window controls

In full screen the custom window controls are hidden, as the
`.monaco-workbench.fullscreen` rule does, so the layout actions keep the
gap-inclusive inset then, as the main window's last actions do.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants