Skip to content

Chat windows: show the Session Activity Bar as a separate strip, like the main window - #346528

Merged
Sandeep Somavarapu (sandy081) merged 7 commits into
mainfrom
agents/chat-window-activity-bar-strip
Nov 6, 2026
Merged

Sandeep Somavarapu (sandy081) merged 7 commits into
mainfrom
agents/chat-window-activity-bar-strip

Conversation

@sandy081

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

Copy link
Copy Markdown
Member

Follow-up to #346492. In the main window of the Agents window, the Session Activity Bar is a separate strip beside the cards, in a column of its own. In chat windows it floated inside the chat's card, at its top right, over the chat, in Side by Side and Chat Only. Chat windows now show it like the main window: in a column of its own at the right of the window, in every layout mode, never inside a card.

What changed

  • A column of its own in every layout mode. The strip is the last column of the chat window's grid in Side by Side, Chat Only, Stacked and Editor Only, with terminals in any position and with only the input showing. It runs past full-width terminals, as the main window's column runs past its panel. Terminals joining or leaving keep the strip spanning without rebuilding the grid, and the widths of the chat and the main part stay as they were. Parts dropped or created at the edges of the grid go before the strip, and a part dropped at the top edge goes below the title row, with the strip still running past it.
  • The main window's look and spacing. The strip fills its column, at the size chosen for the Session Activity Bar from its context menu (Size: Compact by default, or Normal, as introduced in sessions: make the Session Activity Bar fill its column beside the side pane #346492). The choice applies to the main window and to chat windows at once. The column is as wide as the main window's: the gap between cards, which it keeps to the cards to its left, and the bar. The gaps to the cards and to the window's edge are the main window's, at the default and the compact layout density. With Session Activity Bar turned off, the column hides and the window keeps the same gap at its right as at its left, as before.
  • Below the window controls. On Windows and Linux, while the window controls float at the top right of the window above the strip's column, such as in Side by Side, the strip starts below them. The controls stay at the right end of the chat's own title row, and the tab row beside them keeps their room, as before.
  • Rules of its own. A chat window's workbench element mirrors the main window's classes, so the main window's column rules, which depend on the main window's state (such as whether its side pane is open), would move a chat window's strip. The chat window's strip has its own rules and does not depend on the main window's state.
  • Header actions. The session header's actions, at the right of a chat window's title, are centered above the bar at either size. This also fixes a pre-existing staleness: the actions were aligned only when the title was laid out, so they stayed unaligned when the session header moved into the window's title row, such as when switching to Stacked, and when the bar's size changed. They now follow their own width and the bar's size.
  • Part grid. IPartGridViewOptions.edgeChrome lets a view, such as the strip, span along one edge of the grid as chrome: the grid's edge classes skip it, and parts added or moved to that edge go beside it. A grid restored from saved sizes is first laid out at the size it was saved at, so that the sizes of nested rows and columns are read correctly. Sizes saved before the strip had a column in every mode are still read.

How to test

  1. Set sessions.chatWindows.enabled to true, open a session in a chat window and open a file beside it.
  2. Switch between the layout modes from the window's title (Side by Side, Chat Only, Stacked, Editor Only), and open and close terminals in each terminal position. The Session Activity Bar stays in a column of its own at the right of the window, never inside the chat, and running past full-width terminals.
  3. Compare its gaps with the main window's at the default and the compact layout density (window.density.layout).
  4. Right-click the bar and choose Size > Normal, then Size > Compact, in a chat window and in the main window: both windows follow. In Stacked, the header's actions stay centered above the bar.
  5. Turn off View > Appearance > Session Activity Bar: the column hides and the window keeps an equal gap at its right.

Validation

  • ./scripts/test.sh --runGlob 'vs/{workbench/contrib/chatWindow/test,sessions,workbench/test/browser/parts/partGrid,workbench/test/browser/parts/activitybar,workbench/contrib/sessions/test}/**/*.test.js': passed (9938 passing). New and updated tests cover:
    • the grid's arrangement in every layout mode and terminal position, terminals joining and leaving in place, the strip hidden, sizes saved by earlier versions, and drops and moves at the top edge with the title row shown or merged;
    • the strip's geometry against the main window's real column and styles, at both densities and both bar sizes, beside the chat and beside the main part, whatever the main window's state, with the bar's width pinned;
    • the header's actions following the bar's size and their own arrival after layout;
    • the window controls' room, measured before any style is written and written only when it changes.
  • pnpm run typecheck-client: passed.
  • pnpm run eslint and node build/stylelint.ts on the changed files: passed.
  • pnpm run valid-layers-check: passed.
  • Component fixtures (sessionActivityBar, including chat-window variants at both densities and both sizes, rendered on the real part grid that clips its cards): rendered.
  • Live check in Code OSS from this branch, signed in, with an isolated profile:
    • every layout mode with terminals closed and open in each position, and with only the input showing: the strip is always in its own column, full height, never inside a card;
    • opening and closing terminals in Side by Side and Chat Only keeps the widths of the chat and the main part;
    • with the setting off, the column hides and the right gap equals the left one;
    • the gaps match the main window's beside its chat at both densities and both bar sizes;
    • choosing the size from either window's bar applies live to both;
    • in Stacked, the header's actions stay centered above the bar (no offset) as the size is changed from either window's bar, where they were previously left unaligned.
  • Performance, measured locally against main (Code OSS, the Agents window with chat windows), no regression:
    • Restoring the main window with 2 chat windows, 3 interleaved runs: median 7478 ms on main, 7391 ms with this change, with the same number of layouts.
    • Switching layout modes (10 times through 4 modes): fewer grid rebuilds and layouts (grid rebuilds 30 → 20, grid layouts 90 → 60), and fewer long tasks (12 → 10).
    • Toggling terminals: the first time terminals join, 1 grid rebuild on both; later toggles cause no rebuilds or layouts.
    • Dragging to resize: the same number of grid layouts, and no long tasks.
    • Changing the bar's size updates chat windows live with no grid layouts; changing the layout density costs the same as on main.
    • Idle for 60 s: no layouts and no long tasks. The header actions' resize observer stays quiet: no callbacks on window resizes or size changes, and 2 on a density change.

…e the cards

A chat window now shows its Session Activity Bar in a column of its own at the
right of the window in every layout mode, framed like the main window's, instead
of floating inside the chat card while the chat is beside the editor or alone.

- Side by Side and Chat Only arrange the strip as the last column of the row.
  It runs past the terminals wherever they are, as in Stacked and as the main
  window's column runs past the panel. Editor Only keeps its terminals below it.
- The strip's host is active in every mode and takes the main window's column
  classes, so it gets the same frame, gap and density behavior. It reaches into
  the window's outer inset to keep the main window's distances to the card and
  the window edge.
- While the window controls float at the top right of the window (Windows,
  Linux), the strip starts below them, and the part beside it keeps the right
  edge class, so its tab row still makes room for them.
- The part grid keeps chrome along an edge spanning the window when cells go to
  the edges beside it: terminals, parts moved by the user and dropped editors
  go beside the parts, not under the strip.
- Fixes found along the way: a restored part grid read a nested row's or
  column's size before its first layout, so Side by Side with terminals under
  the chat or the editor opened at the wrong split; the strip's cell is
  arranged with its gap inset, so a mode walk no longer drifts the split; parts
  created for dropped editors go before the strip.
- Sizes the user gave the chat side by side before this change still apply,
  and stay stored for an older version to read.

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

Review fixes for the chat window's Session Activity Bar strip:

- The strip was offset into the window's outer inset to keep the main
  window's distances, which put it past its card, whose overflow is hidden,
  and past the grid, which clips too: its right border and corners were cut
  off. As in the main window, the strip's column now takes the right edge of
  the window: while the strip shows, the chat window keeps no outer inset at
  its right, and the column is the main window's, so the strip keeps 6px to
  the card beside it and 2px to the edge (2px and 2px in Compact) inside its
  own card. With the column at the edge, the terminals of Editor Only also
  go beside it, as in every other mode.
- A part moved or dropped at the top edge of the window went above the
  strip: the part grid reached the title row, pinned at the top even while it
  hides, instead of the row of the parts and the strip. It now passes over
  the views at that edge, so the part goes above the parts, the strip keeps
  spanning, and the title row stays first.
- The fixture of the chat window's strip uses the real part grid, whose cards
  clip, instead of a flex layout that did not.

Co-authored-by: Copilot <[email protected]>
Measured live, the main window's strip is 6px from the right edge of the
window and 2px from the box of the card beside it (3px between the visible
frames, as a card in Default density draws its frame 1px inside its box);
2px and 2px in Compact. That comes from how it is built: its grid ends the gap
before the right edge, its column is right beside the card, with no gap, and
the strip is docked 2px inside the right of its column.

The chat window now builds its column the same way, instead of taking the
right edge, which put the strip 2px from the edge and 6px from the card:

- The window keeps its outer inset at the right again, whether the strip shows
  or not, as before.
- The strip's cell keeps no gap to the cards beside it and is the main
  window's 34px column, so the strip is 2px from the card's box and 6px from
  the edge (2px and 2px in Compact), inside its own card, which clips it.
- The column shows the window behind the strip, as the main window's does,
  rather than the background of the cards.

The geometry test derives these distances from the main window's construction
and runs on the real part grid with the production styles; the fixture uses
the same column.

Co-authored-by: Copilot <[email protected]>
reserveChatWindowControls runs on every layout of a chat window's title
(per resize frame, per chat window). It read the controls' width, wrote
the width property, then read their height: a style write between two
layout reads forces a second layout. It also rewrote both properties on
every call.

Read both sizes first, then write, and skip each property write when the
inline value is already the same. A test traces the reads and writes:
reads before writes, no writes on an unchanged call, and only the
changed property otherwise.

Co-authored-by: Copilot <[email protected]>
…e main window does

Adopts the main window's column from the Session Activity Bar's full
column change: the strip of a chat window is a MenuActivityBar that
fills its column, at the size chosen for the Session Activity Bar
(compact unless Normal is chosen from its context menu, which applies
to both windows), and the column is as wide as the main window's, the
gap between cards included (gap + MenuActivityBar.getWidth(compact
density, size)), following the layout density and the chosen size.

The chat window's workbench element mirrors the main window's classes
(the auxiliary window service tracks its class attribute). The rules of
the main window's column, keyed by `noeditorpane` and
`session-activity-bar-column-visible`, would therefore move a chat
window's strip and round its corner by the main window's state. So the
strip does not take the main column's class and has rules of its own:
it fills its column at its right and, at the default density, moves
toward the cards by the inset of their frames, as the main window's
does beside its chat. The visible gap to the cards is therefore the gap
between cards, and the distance to the edge is the main window's.
Chat windows do not follow the window's rounded corner, as their other
cards do not either.

The header's actions are centered above the bar, at either size. The
geometry test builds the main window's real column and styles and
expects the chat window's strip to match it, at both densities and both
sizes, beside the chat and beside the main part, whatever the main
window's state, and pins the bar's width to MenuActivityBar's.

Co-authored-by: Copilot <[email protected]>
…hey and its size change

The session header's actions in a chat window's title are centered above
the strip below. They were aligned only as the title was laid out. The
grid does not lay a title out again while its own box is unchanged, so
the alignment went stale in two cases:
- the size chosen for the Session Activity Bar changed (a profile
  storage event), which resizes the strip but not the title row;
- the session header moved into a title after it was laid out, such as
  into the window's title row when switching to Stacked, which left that
  title without any alignment.

Each title now tracks its header's actions in its own store: it aligns
them as it is laid out, as their width changes (a resize observer on
the actions' host), and as the layout density or the chosen size
changes. The grid's identical-layout caching is unchanged.

A test lays a title out while its actions are elsewhere, then lets them
arrive and changes the chosen size through the profile's storage
(Compact, Normal, Compact), with no further layout: the inset follows,
6/13/6px at the default density and 5/10/5px at the compact one, for a
20px action. Without the fix it stays unset.

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

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

Opening terminals in Editor Only incorrectly reduces the hidden chat’s cached height, causing it to shrink progressively after repeated cycles back to Stacked.

1 open issue
What changed in this PR

This follow-up to #346492 moves chat windows’ Session Activity Bar into a separate right-hand column, matching the main Agents window across all layout modes.

Changes:

  • Keeps the strip beside chat, editor, and terminal content, including during grid rearrangements.
  • Matches the main window’s bar size and spacing, reserves room for window controls, and updates header-action alignment.
  • Adds layout and geometry coverage, component fixtures, and documentation.
File Description
src/​vs/​workbench/​contrib/​chatWindow/​test/​common/​chatWindowLayout.test.ts Updates expected strip placement in every layout mode.
src/​vs/​workbench/​contrib/​chatWindow/​test/​browser/​chatWindowGrid.test.ts Covers strip sizing, terminal transitions, edge drops, and saved layouts.
src/​vs/​workbench/​contrib/​chatWindow/​common/​chatWindowLayout.ts Places the strip beside all content in every mode.
src/​vs/​workbench/​contrib/​chatWindow/​browser/​chatWindowGrid.ts Integrates the strip column and preserves focus and legacy sizes.
src/​vs/​workbench/​contrib/​chatWindow/​browser/​chatWindow.ts Updates the strip API documentation.
src/​vs/​workbench/​browser/​parts/​partGrid/​partGrid.ts Adds edge-chrome handling and initializes restored grid dimensions.
src/​vs/​sessions/​DESKTOP.md Documents chat-window strip behavior.
src/​vs/​sessions/​contrib/​chatWindow/​test/​browser/​sessionsChatWindowProvider.test.ts Tests geometry, size synchronization, header alignment, and control spacing.
src/​vs/​sessions/​contrib/​chatWindow/​browser/​sessionsChatWindowProvider.ts Hosts the full-size strip and tracks header and window-control spacing.
src/​vs/​sessions/​contrib/​chatWindow/​browser/​media/​chatWindow.css Styles the independent strip column and window-control clearance.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​sessionActivityBar.fixture.ts Adds chat-window fixtures across bar sizes and layout densities.
build/​lib/​stylelint/​vscode-known-variables.json Registers the window-controls height CSS variable.

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 3c9f9614 Current: fc45eb45

Changed (1)

chat/aiCustomizations/customizationMigrationDashboard/MigrationsTooltip/Light
Before After
before after

Added (6)

sessions/sessionActivityBar/sessionActivityBar/ChatWindowColumn/Light

current

sessions/sessionActivityBar/sessionActivityBar/ChatWindowColumnCompact/Light

current

sessions/sessionActivityBar/sessionActivityBar/ChatWindowColumnNormalSize/Light

current

sessions/sessionActivityBar/sessionActivityBar/ChatWindowColumnNormalSizeCompact/Light

current

sessions/sessionActivityBar/sessionActivityBar/ChatWindowColumnNewChanges/Light

current

sessions/sessionActivityBar/sessionActivityBar/ChatWindowColumnWithoutLayoutActions/Light

current

…ning chrome

When a cell is added at an edge beside chrome that spans along it, such as
terminals joining below the parts with the strip running past them, the
column (or row) at that edge makes room for it in proportion. Its hidden
children were scaled too, although they take no room: their sizes are
the ones they show at again. In Editor Only, where the chat is hidden in
the column with the main part, terminals joining shrank the chat's
cached height, so returning to Stacked showed a smaller chat each time.

Only the children that show make room now; hidden ones keep their sizes.

Co-authored-by: Copilot <[email protected]>
@sandy081
Sandeep Somavarapu (sandy081) merged commit ad69b94 into main Nov 6, 2026
51 checks passed
@sandy081
Sandeep Somavarapu (sandy081) deleted the agents/chat-window-activity-bar-strip branch November 6, 2026 13:20
@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