Skip to content

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

Merged
Sandeep Somavarapu (sandy081) merged 4 commits into
mainfrom
agents/fix-agents-window-title-bar-bugs
Nov 6, 2026
Merged

Sandeep Somavarapu (sandy081) merged 4 commits into
mainfrom
agents/fix-agents-window-title-bar-bugs

Conversation

@sandy081

Copy link
Copy Markdown
Member

Fixes two issues in the title bar of Agents window chat windows. One is a regression from #346529.

Problem

  1. The last title bar action had no right inset. In a chat window, the layout actions (Show Editor, then the Layout menu) ended flush against the window's right edge on macOS, or against the window controls on Windows and Linux. The only right inset was on the main window's right toolbar (AgentsWindowMenus.TitleBarRightLayout). That toolbar is always empty in chat windows, so it hides and takes the inset with it. Before Chat windows: always show the Agents title bar across the top #346529, the session header's actions came last in a chat window's title bar and carried the inset. Chat windows: always show the Agents title bar across the top #346529 removed them without moving the inset.
  2. The layout control was named after the current mode. The Layout menu was registered once per layout mode as "Layout: {0}". The toolbar used that title for its tooltip and for the entries of its context menu, so the control read "Layout: Side by Side", with "Hide 'Layout: Side by Side'" next to the "Stacked" button toggle. The same applied in the Session Activity Bar when it shows the layout actions. This dates back to chat windows: chat windows of the Agents window on parts, with drag and drop between parts #345683.

Changes

  • The Layout menu is registered once per location (title bar and Session Activity Bar) as Configure Layout, the same name as the workbench's layout control. Its state still shows through the checks in the menu and the existing screen reader announcement when the layout changes. The now-unused short mode titles are removed.
  • A chat window's layout actions end at the same distance from the window edge as the main window's last action. The main window's title bar sits inside the window's floating panel gap, so its actions end at --vscode-spacing-size80 plus --vscode-agents-layout-floatingPanelGap from the edge. A chat window's title bar spans the window, so its layout actions add that gap to their inset.
  • With window.controlsStyle: custom on Windows and Linux, the title bar draws the window controls after its actions. The main window's gap then sits after the controls, so the actions keep only their 8px before them. The title bar now marks itself (custom-window-controls) when it draws its own controls, and a chat window's layout actions also keep only their 8px there.
  • A chat window's layout actions keep the main window's 4px (--vscode-spacing-size40) gap after the session's actions.
  • The main window is unchanged.

How to test

  1. In the Agents window, open a session in a chat window.
  2. Look at the right end of the chat window's title bar in each layout mode (Side by Side, Stacked, Chat Only, Editor Only) and in both Layout Densities. The last action ends as far from the window edge as the last action of the main window's title bar.
  3. Hover the layout control: its tooltip is "Configure Layout". Right-click it: the menu shows "Hide 'Configure Layout'" and a "Configure Layout" toggle, whatever the layout mode.
  4. Turn on sessions.sessionActivityBar.showLayoutActions and repeat step 3 on the Session Activity Bar's layout control.
  5. On Windows or Linux, check steps 2 and 3 with window.controlsStyle set to native and to custom.

Validation

  • ./scripts/test.sh --run src/vs/sessions/contrib/chatWindow/test/browser/chatWindowContribution.test.ts --grep "Layout menu": the new test failed before the fix with a per-mode title at both locations, and passes with it.
  • ./scripts/test.sh on chatWindowContribution, chatWindowLayoutActions, sessions titlebarPart (browser and electron-browser), sessionActivityBar and sessionsChatWindowProvider: 101 passing, 1 pending. The pending test is the new custom window controls test, which only runs on Windows and Linux.
  • pnpm run typecheck-client, pnpm run eslint on the changed files and node build/stylelint.ts on the changed CSS: all pass. pnpm run valid-layers-check passes on the first commit; the later commits add no imports.
  • Component fixtures sessions/chatWindow/titleBar/* (24): rendered before and after. Only the title bar's right-hand actions change. The committed screenshot baselines need updating.
  • Live, in a Code - OSS dev build of the Agents window on macOS, against main:
    • Before: the chat window's last action was 0px from the window edge in all layout modes.
    • After: it is the same distance as the main window's in all layout modes, in both densities.
    • The main window is unchanged.
    • The tooltip and context menu read "Configure Layout" in the title bar and the Session Activity Bar.
  • Windows and Linux window controls were not exercised live.

…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]>
…indow'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]>
…r 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]>
Copilot AI balanced review requested due to automatic review settings November 6, 2026 17:21
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: f18b2f2c Current: 39f04cd3

Changed (10)

sessions/chatWindow/titleBar/chatWindowTitleBar/SideBySide/Light
Before After
before after
sessions/chatWindow/titleBar/chatWindowTitleBar/ChatOnly/Light
Before After
before after
sessions/chatWindow/titleBar/chatWindowTitleBar/Stacked/Light
Before After
before after
sessions/chatWindow/titleBar/chatWindowTitleBar/EditorOnly/Light
Before After
before after
sessions/chatWindow/titleBar/chatWindowTitleBar/SideBySideCompact/Light
Before After
before after
sessions/chatWindow/titleBar/chatWindowTitleBar/ChatOnlyCompact/Light
Before After
before after
sessions/chatWindow/titleBar/chatWindowTitleBar/StackedCompact/Light
Before After
before after
sessions/chatWindow/titleBar/chatWindowTitleBar/EditorOnlyCompact/Light
Before After
before after
sessions/chatWindow/titleBar/chatWindowTitleBar/SideBySideNormalSize/Light
Before After
before after
sessions/chatWindow/titleBar/chatWindowTitleBar/StackedCompactNormalSize/Light
Before After
before after

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

The reduced title-bar inset remains active in fullscreen with custom window controls, placing the chat window’s last action closer to the edge than the main window’s.

1 open issue
What changed in this PR

This PR restores right-edge spacing for Agents chat-window title-bar actions and gives the layout control a consistent name.

Changes:

  • Registers “Configure Layout” once per location instead of using mode-specific titles.
  • Adds chat-window action insets and spacing, with an adjustment for custom window controls.
  • Adds regression tests and updates the title-bar fixture label.
File Description
src/​vs/​workbench/​contrib/​chatWindow/​browser/​chatWindowLayoutActions.ts Removes unused short layout-mode titles.
src/​vs/​sessions/​test/​electron-browser/​titlebarPart.test.ts Tests the custom-window-controls marker.
src/​vs/​sessions/​electron-browser/​parts/​titlebarPart.ts Marks title bars that draw custom window controls.
src/​vs/​sessions/​contrib/​chatWindow/​test/​browser/​chatWindowTitleBar.fixture.ts Updates the fixture label to “Configure Layout”.
src/​vs/​sessions/​contrib/​chatWindow/​test/​browser/​chatWindowContribution.test.ts Tests consistent layout-menu naming across modes and locations.
src/​vs/​sessions/​contrib/​chatWindow/​browser/​chatWindowActions.ts Registers one consistently named layout submenu per location.
src/​vs/​sessions/​browser/​parts/​media/​titlebarpart.css Adds right insets and spacing between action groups.

Review effort: Balanced

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]>
@sandy081
Sandeep Somavarapu (sandy081) merged commit 169a1c1 into main Nov 6, 2026
51 checks passed
@sandy081
Sandeep Somavarapu (sandy081) deleted the agents/fix-agents-window-title-bar-bugs branch November 6, 2026 17:46
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 6, 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