Repository navigation
sessions: open chats in windows of their own (behind sessions.chatWindows.enabled) - #344666
Closed
Sandeep Somavarapu (sandy081) wants to merge 16 commits into
Closed
Sandeep Somavarapu (sandy081) wants to merge 16 commits into
Sandeep Somavarapu (sandy081) wants to merge 16 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Critical session and window identity bugs can close the wrong chat, display another chat’s changes, and bind embedded editors to the wrong window.
4 open issues
What changed in this PR
Adds opt-in per-chat windows to the Agents Window, supported by reusable embedded editor parts and session-scoped UI behavior.
Changes:
- Introduces embedded editor parts, window lifecycle bindings, and chat-window registration and editor persistence helpers.
- Scopes session actions, Changes data, and layout behavior to their owning window.
- Extends chat presentation, styling, accessibility help, tests, fixtures, and documentation.
| File | Description |
|---|---|
| src/vs/workbench/test/browser/workbenchTestServices.ts | Updated as part of this pull request. |
| src/vs/workbench/test/browser/parts/editor/multiEditorTabsControl.test.ts | Updated as part of this pull request. |
| src/vs/workbench/test/browser/componentFixtures/sessions/changesView.fixture.ts | Updated as part of this pull request. |
| src/vs/workbench/services/editor/test/browser/modalEditorGroup.test.ts | Updated as part of this pull request. |
| src/vs/workbench/services/editor/common/editorGroupsService.ts | Updated as part of this pull request. |
| src/vs/workbench/services/editor/browser/editorPartWindowBinding.ts | Updated as part of this pull request. |
| src/vs/workbench/contrib/webviewPanel/browser/webviewEditor.ts | Updated as part of this pull request. |
| src/vs/workbench/contrib/terminal/common/terminal.ts | Updated as part of this pull request. |
| src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts | Updated as part of this pull request. |
| src/vs/workbench/contrib/chat/test/browser/widget/input/chatInputPart.test.ts | Updated as part of this pull request. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts | Updated as part of this pull request. |
| src/vs/workbench/contrib/chat/browser/promptTimeline/media/promptTimeline.css | Updated as part of this pull request. |
| src/vs/workbench/browser/parts/editor/ownedEditorPart.ts | Updated as part of this pull request. |
| src/vs/workbench/browser/parts/editor/embeddedEditorPart.ts | Updated as part of this pull request. |
| src/vs/workbench/browser/parts/editor/editorTabsControl.ts | Updated as part of this pull request. |
| src/vs/workbench/browser/parts/editor/editorPart.ts | Updated as part of this pull request. |
| src/vs/workbench/browser/parts/editor/editorAddTabControl.ts | Updated as part of this pull request. |
| src/vs/sessions/test/browser/titlebarPart.test.ts | Updated as part of this pull request. |
| src/vs/sessions/test/browser/sessionViewTestUtils.ts | Updated as part of this pull request. |
| src/vs/sessions/test/browser/chatGroupsView.test.ts | Updated as part of this pull request. |
| src/vs/sessions/sessions.common.main.ts | Updated as part of this pull request. |
| src/vs/sessions/services/workspaceFolderLabel/test/browser/workspaceFolderLabelService.test.ts | Updated as part of this pull request. |
| src/vs/sessions/services/sessions/test/browser/sessionScope.test.ts | Updated as part of this pull request. |
| src/vs/sessions/services/sessions/test/browser/sessionActionTarget.test.ts | Updated as part of this pull request. |
| src/vs/sessions/services/sessions/browser/sessionsPartService.ts | Updated as part of this pull request. |
| src/vs/sessions/services/sessions/browser/sessionScopedContextKeys.ts | Updated as part of this pull request. |
| src/vs/sessions/services/sessions/browser/sessionScope.ts | Updated as part of this pull request. |
| src/vs/sessions/services/sessions/browser/sessionActionTarget.ts | Updated as part of this pull request. |
| src/vs/sessions/services/chatView/browser/chatViewFactory.ts | Updated as part of this pull request. |
| src/vs/sessions/services/agentHost/test/browser/agentHostCustomizationService.test.ts | Updated as part of this pull request. |
| src/vs/sessions/LAYOUT.md | Updated as part of this pull request. |
| src/vs/sessions/electron-browser/actions/vscodeActions.ts | Updated as part of this pull request. |
| src/vs/sessions/DESKTOP.md | Updated as part of this pull request. |
| src/vs/sessions/contrib/workspace/test/browser/workspaceFolderManagement.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/terminal/test/browser/sessionsTerminalContribution.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/terminal/test/browser/chatWindowTerminalHost.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsWindowNotifier.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsTelemetry.contribution.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsRename.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsListTestUtils.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsListFixtureUtils.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsListContextMenu.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessions/test/browser/customizationsToolbar.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessions/test/browser/automationsView.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessions/test/browser/automationsView.fixture.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessions/test/browser/aiCustomizationShortcutsWidget.fixture.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessions/browser/views/sessionsView.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessionInputBanners/test/browser/sessionInputBanners.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/sessionComparison/test/browser/sessionComparisonGridController.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remoteAgentHostSessionsProvider.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/copilotChatSessions/test/browser/copilotChatSessionsProvider.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/openAgentHostStateFile.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentMergeActions.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostSkillButtons.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostSessionChangesets.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostClaudePermissionModePicker.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentHost/agentHostPermissionPickerDelegate.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/browser/openAgentHostStateFileAction.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/browser/agentHostSkillButtons.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/onboardingTours/test/browser/newSessionViewV3Prompt.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/onboardingTours/test/browser/newSessionViewTourTrigger.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/layout/test/browser/layoutControllerTestUtils.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/layout/browser/desktopLayoutController.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/layout/browser/desktop/desktopExistingSessionStrategy.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/layout/browser/desktop/desktopDraftSessionStrategy.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/layout/browser/desktop/desktopDockedTabsCoordinator.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/layout/browser/desktop/desktopDetailPanelCoordinator.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/github/test/browser/pullRequestActions.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/github/test/browser/issueActions.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/github/test/browser/githubService.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/github/test/browser/githubContribution.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/github/browser/githubService.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/editor/test/browser/editor.contribution.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chatWindow/test/browser/chatWindowContribution.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chatWindow/browser/media/chatWindow.css | Updated as part of this pull request. |
| src/vs/sessions/contrib/chatWindow/browser/chatWindowEditors.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chatWindow/browser/chatWindow.contribution.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/test/browser/voiceBridge.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/test/browser/sessionTurnChanges.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/test/browser/sessionsGrid.fixture.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/test/browser/sessionsChatAccessibilityHelp.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/test/browser/sessionChatInputToolbar.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/test/browser/newChatWidget.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/test/browser/newChatWidget.fixture.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/test/browser/newChatVoiceTarget.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/test/browser/artifactIntegrationPresentation.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/test/browser/artifactIntegrationPresentation.fixture.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/browser/sessionChatInputToolbar.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/browser/newSessionAction.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/changes/test/browser/sessionSyncChanges.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/changes/test/browser/sessionChangesEditor.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/changes/test/browser/sessionActionsHost.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/changes/test/browser/changesActions.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/changes/common/changesViewService.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/changes/browser/sessionChangesService.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/changes/browser/sessionActionsHost.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/changes/browser/checksActions.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/changes/browser/changesViewRenderer.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/changes/browser/changesViewActions.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/changes/browser/changesSummaryWidget.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/changes/browser/changesMultiDiffSourceResolver.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/changes/browser/changesetReviewActions.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/changes/browser/changes.contribution.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/applyCommitsToParentRepo/browser/applyChangesToParentRepo.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/agentFeedback/test/browser/agentFeedbackPRReviewSeeder.test.ts | Updated as part of this pull request. |
| src/vs/sessions/browser/parts/sessionsParts.ts | Updated as part of this pull request. |
| src/vs/sessions/browser/parts/sessionsPart.ts | Updated as part of this pull request. |
| src/vs/sessions/browser/parts/sessionHeaderBar.ts | Updated as part of this pull request. |
| src/vs/sessions/browser/parts/sessionHeader.ts | Updated as part of this pull request. |
| src/vs/sessions/browser/parts/media/titlebarpart.css | Updated as part of this pull request. |
| src/vs/sessions/browser/parts/media/sessionView.css | Updated as part of this pull request. |
| src/vs/sessions/browser/parts/media/sessionsPart.css | Updated as part of this pull request. |
| src/vs/sessions/browser/parts/media/chatGroupsView.css | Updated as part of this pull request. |
| src/vs/sessions/browser/parts/media/chatCompositeBar.css | Updated as part of this pull request. |
| src/vs/sessions/browser/parts/emptyEditorGroupAddTab.ts | Updated as part of this pull request. |
| src/vs/sessions/browser/parts/chatView.ts | Updated as part of this pull request. |
| src/vs/sessions/browser/parts/chatGroupsView.ts | Updated as part of this pull request. |
| src/vs/sessions/browser/menus.ts | Updated as part of this pull request. |
| src/vs/sessions/browser/media/workbench.css | Updated as part of this pull request. |
| src/vs/sessions/browser/actions/vscodeActions.ts | Updated as part of this pull request. |
| build/lib/i18n.resources.json | Updated as part of this pull request. |
Review effort: Balanced
Sandeep Somavarapu (sandy081)
force-pushed
the
agents/chat-windows
branch
6 times, most recently
from
October 28, 2026 09:12
722a1bf to
46a49c4
Compare
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Oct 28, 2026
…6a49c4) Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
force-pushed
the
agents/chat-windows
branch
15 times, most recently
from
October 29, 2026 09:53
9c28eac to
f9d1ef8
Compare
Contributor
Screenshot ChangesBase: Errored (19)Fixtures that failed to render — no screenshot was produced.
|
Sandeep Somavarapu (sandy081)
force-pushed
the
agents/chat-windows
branch
2 times, most recently
from
October 29, 2026 10:41
a579229 to
04c0afe
Compare
The Agents window shows chats only in its main window. Add chat windows, behind the experimental setting sessions.chatWindows.enabled (off by default): "Open in New Window" on a session or a chat, and "Open Chat in New Window", open the chat in a window of its own, with an editor area beside it that takes the editors the main window showed for that chat, except those that cannot move there, such as a canvas, which shows only in the main window: they stay, without the error a vetoed move shows (moveEditorsToChatWindow). A chat window is an auxiliary window with a grid of its own, laid out by computeSessionGridLayout: the session view of the chat, the editor area (an embedded editor part, the primary part of its window, kept out of working sets), a cell for terminals, and a column for the Session Activity Bar, which moves into it while the chat is below the editor area or hidden. A new topology rebuilds the grid with the same views and the sizes they last showed with; showing or hiding a cell only toggles its visibility, and the grid is never read while it changes. Cells are cards that follow Layout Density. - One window per chat: opening a chat that has a window reveals it; a chat window closes when its chat is deleted or archived, and its window session is released when it closes. - Its title is the title of its chat, or of its session. - Its layout is remembered per chat and its defaults per kind, under the keys chat windows store in the profile; its editors are restored at startup after the main window restored its sessions. - The window's context keys are bound on its own context and on its editor parts; New Session is not offered in it. - The Session Activity Bar can move into a host outside its chat (registerSessionActivityBarExternalHost), and its entries carry the handle of their chat window, as do the items of its submenus (Layout, Canvas), whose flyout now runs them with the context of their entry. With the setting off nothing opens or restores a chat window, and the main window's Session Activity Bar has no host outside its chat, so it behaves as before; its strip has no context, so its submenu items run as before. The sashes in the gaps between the cards show the gripper of the main window's. In windows other than the main window, the Agents workbench reports its editor part as visible, as the base workbench layout does, rather than the visibility of the main window's editor area: with the main window's editor area hidden, the editors of a chat window, such as its terminals, no longer stay blank. This also applies to the editor windows of the Agents window. The menu for text selected in a chat's response follows the selection in the window its chat shows in: its chat view is created before it shows in its window, so the menu no longer listens to the main window only. Co-authored-by: Copilot <[email protected]>
Chat windows show their chat and their editor area side by side, but cannot change how. Add the layout modes of a chat window, behind the chat windows setting, in a Layout menu in its title bar that reads "Layout: <mode>": Show Chat and Show Editor (the last one shown cannot be hidden; showing the other returns to how both last showed) and Stacked (only how both show next while one shows). The four modes (Chat Only, Editor Only, Stacked and Side by Side) and Toggle Chat Conversation are commands of their own, in the Command Palette. Changing the layout is announced to screen readers. Every action acts on the chat window it is invoked from: the title bar's layout toolbar and the Session Activity Bar pass the window's handle. From a keybinding or the Command Palette they act on the chat window whose window is active. Stacked, the chat can show only its input: dragging the split across the snap point shows only the input or the conversation, with the main window's rules (decideStackedChatInputOnly), only a press on a sash decides, a window resize keeps what shows, and the session header stays the top row of the window while only the input shows. The cell sizes come back per chat after a mode change and a reload, and tall terminals give way first, so the editor area and the chat keep their heights. Nothing changes in the main window: the Layout menu and its actions only apply in chat windows. Co-authored-by: Copilot <[email protected]>
Chat windows have no terminal: the terminals of their session only show in the main window's panel. Show them in the chat window, behind the chat windows setting, in an embedded editor part of terminal editors in the terminals cell of its grid, filled by a terminal host (IChatWindowTerminalHost) that the sessions terminal contribution registers once a chat window is open. - The terminal of the window's session shows: one of its terminals that no other chat window shows, or a new one in its working directory. The panel leaves it to the chat window while it shows there. - Toggle Terminal (the panel and terminal keys, above the main window's rules and never sent to the shell), the Session Activity Bar's Terminal entry and the Terminal Add Tab entry act on the chat window they are invoked from; the side panel key toggles its editor area. - Terminal Position (Full Width, Under Editor, Under Chat) in the terminals' More Actions and in the context menu of their tabs, acting on the window of those terminals; unavailable while Stacked, which keeps them across the bottom. - The terminals keep their height as the window is resized: as in the main window, the chat takes what the window grows or shrinks by first, and the terminals last. - While the chat shows only its input (Stacked), it keeps that height as the window is resized by giving way last (ChatWindowCellView.setPriority), as the main window's does, and not by a fixed height: one left the sash above it nothing to drag when no terminals were below it, so that the conversation could not be dragged open. Its least height is still its input's. - What it shows follows the drag live, both ways, as the main window's does: the conversation shows, at the height it is dragged to, as soon as the chat is dragged up 12px past its input, and only the input shows as soon as it is dragged back to within 4px of it (decideStackedChatInputOnlyWhileDragging), rather than once the drag lets go, which still snaps it to one or the other as before. Its input measures taller in the conversation, so a drag decides against its height as it shows only the input, and nothing settles it while it is dragged. It follows the shared rules of a stacked chat (common/stackedChatInputOnly.ts). - The terminals hide when there is no terminal to show and when their last terminal closes; a terminal opened in the editor area moves to them; shown before the host registered, as on restore, they are filled once it does. - Closing the window, or hiding the terminals, keeps the terminals running, in the background of the panel. - A terminal handed to the window (IChatWindow.showTerminal), such as the terminal of a task, shows in its terminals beside those they show. - The context of a chat window is scoped to the body of its document, so that the keys of its terminals, such as Cmd+J, apply in it also while no element of the window has focus, and never the main window's rules for them. - A checked entry of a chat window's Session Activity Bar acts on that window: Changes, Files and Browser hide its editor area, and its Terminal entry toggles its terminals, never the side panel or the panel of the main window. The main window's strip has no context, so its entries hide the side panel and panel as before. In the main window, nothing changes: the chat window entries and keys apply in chat windows only, and the main window's panel entries do not show there. Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
force-pushed
the
agents/chat-windows
branch
2 times, most recently
from
November 2, 2026 19:25
d06e6c6 to
5c5ace2
Compare
A chat window's editor area cannot be filled from the window itself, and its
title bar offers none of the session's actions. Behind the chat windows
setting:
- The Session Activity Bar and the Add Tab menus of a chat window offer
Changes, Files and Browser, which open in its editor area and are checked
while it shows them; its empty editor area lists them, as the main window's
does.
- Run and Open in VS Code show in the title bar of a chat window whose session
has a workspace (SessionTitleBarActionsShownContext), as in the main window.
- Every one of these acts on the chat window it is invoked from: its title bar
toolbars and its empty editor area pass the window's handle, which session
actions resolve to the window's session.
- The terminals add only terminals, with their own New Terminal, in both tab
modes; only the editor area has an Add Tab button.
- The editor area opens every editor, the terminals only terminals: any other
editor that would get into the terminals, such as one a pill of the chat
opens while the focus is in a terminal, or one opened to their side, moved
or dropped there, opens in the editor area, which shows (the terminals'
part's redirectEditor).
- An empty editor area has one close button, Close Editor Area, which shows
only the chat of the window, in place of the group's Lock and Close Group.
- While the Session Activity Bar of a chat window shows the layout actions,
its Layout menu is at the top of it, before the entries of its editor area
and its terminals, each in a group of its own
(SessionActivityBarGroup.ChatWindowLayout); the main window's is unchanged.
- Each action of the Layout menu (Show Chat, Show Editor, Stacked) can be
promoted to a button of its own beside it, in the title bar or, while the
Session Activity Bar shows the layout actions, in the strip: a right click on
the Layout menu promotes or hides each, one on a promoted button hides it
("Hide"), and the Layout menu itself hides while all three are promoted. The
buttons show their state by their icon (layout-sidebar-left/right and their
-off variants side by side; when stacked, layout-statusbar for the chat
below, with its band ghosted while hidden, so that it is not the main
window's Toggle Panel icon, and an upside-down layout-panel for the editor
above), never by a toggled highlight. The arrangement button shows what it
does, the other arrangement: split-vertical and "Stacked" side by side,
split-horizontal and "Side by Side" stacked. Which are promoted is one
state for every window, the main window's included, kept in the profile
(ISessionLayoutButtonsService). Until one is promoted or hidden, Show Editor
is promoted, in place of the title bar's toggle of the side panel. They are
registered for chat windows with the shared registerLayoutButtons
(sessionLayoutButtons.ts), whose context menu the strip already has.
- The terminals cell shows only with a terminal in it, never empty; hiding the
terminals with the focus in them moves it to the window's chat, and a terminal
handed to the window that could not show leaves them hidden.
In the main window and in editor windows, the same actions show as before:
SessionTitleBarActionsShownContext holds wherever !isAuxiliaryWindow held, and
the chat window entries need a chat window.
The Changes editor shows its title actions in the editor area of a chat window
as in the main window's (they read the chat window's editor area in place of
the main window's), not in its terminals or in the Agents window's editor
windows. They act on the chat window's session:
- Its changeset operations, such as Commit, are those of the session the
window shows (registerChangesetOperations, per chat window); the main
window's, for its own session, no longer show in chat windows.
- Collapse and Expand All Diffs act on the Changes editor whose title they are
invoked from, not on the active editor, which may be in another window.
- The Create Pull Request bar shows in the title bar of a chat window, for its
session, as in the main window's, with Agent Merge; the actions of its
operations dropdown, such as Agent Merge's, act on the session of the bar
rather than on the active session.
- Every action that the changesets of its session contribute acts in a chat
window as in the main window, by construction, from one place per window
(ChatWindowChangesetActionsContribution): the menus of its editor area read
the context keys of its session (bindSessionScopeContextKeys, with the
changeset's keys, bindChangesetContextKeys), its Changes editor gets the
changeset operations (Commit) and the operations on a file (Keep, Undo,
Discard Changes) of its session, and the toolbar of each file of its Changes
editor runs its actions with its session and editor; the main window's
operations no longer show in chat windows. The title bar's Changes bar of a
chat window shows its session's operations (Merge Changes, Create Pull
Request, Agent Merge) without waiting for its folders to be the mounted
workspace, which only the main window's session is, and names its session
to the actions of its toolbar.
- Run Code Review shows in the title of its Changes editor too, and reviews
the session of the editor it is invoked from. The editor title actions of
the session share one gate for where they show,
SessionEditorTitleWindowContext: the main window and a chat window's editor
area, not its terminals or the Agents window's editor windows.
What the chat of a chat window opens goes to that window, by the window that
hosts the chat, never by the one with focus, which may be the main window:
- A link in a response opens in the active group of its editor area, which
shows if hidden, also when the file is open in the main window or already in
the hidden editor area: the chat's markdown renderer opens links with the
opener of its scope (ChatContentMarkdownRenderer), which a chat window sets
(ChatWindowOpenerService, setChatWindowOpenServices); web links and commands
open as anywhere. In the main window and elsewhere, that opener is the global
one, as before.
- Its Changes editor, such as from its changes pill, opens in the active group
of its editor area, which shows (ChatWindowSessionChangesService).
- Open File of a file of its Changes editor opens in that editor's group; in
the main window, as before.
The titles of the layout modes are in sessionLayoutButtons.ts
(sessionLayoutModeTitles), for the main window to share.
In a chat window, the Changes editor's own actions (Collapse or Expand All
Diffs, Word Wrap, Diff View) show at the right of its header row, the row of its
changeset picker, in the order of the main window and as an overflow
(Menus.SessionsEditorHeaderSecondary), rather than in the overflow of the tab
row of the editor area. They act on the editor of the header they are invoked
from. The main window keeps them in its tab row, as before.
Co-authored-by: Copilot <[email protected]>
- The accessibility help of the Agents window describes chat windows while sessions.chatWindows.enabled is on: how to open one, its editor area, its Layout menu and its terminals. - The changes pill of a chat shown in a window of its own opens Changes in that window's editor area, without revealing the main window's editor area. - The chat window contribution imports the modules that register its actions by name, so that losing one of the imports fails to compile; a test checks them, the setting's default and when opening a chat in a window is offered. - DESKTOP.md describes chat windows. Co-authored-by: Copilot <[email protected]>
A chat window showed its chat's title twice: as the title of its title bar, and in the session header above the chat, which also scrolled out of view with the chat in the layouts where the chat is below the editor area or hidden. The title bar of a chat window now shows the session header in place of its title, in every layout: it starts after the window controls, its empty space moves the window, and the title bar keeps its Run, Open in VS Code, session and Layout actions. It does so also while the window shows only the chat input; the title shows again only while the header does not. The main window is unchanged: its title bar never creates the element that hosts a header, and its session views keep their headers. Tests cover both. Ports, in the chat window's own title bar rather than by hiding it, the behavior of 4fe86f7, 4647d9c, 506669f, a7ebe6b and d618f42 of agents/implement-it. Beside the editor (Side by Side), the header is above the chat's column only, and the editor area runs to the top of the window, its titles at the top edge, their empty space moving the window. In the other layouts (Stacked, Editor Only, Chat Only) the header is across the window, above every cell and the Session Activity Bar's column. computeSessionGridLayout tells which (header); the grid takes the whole window and makes room for the header itself, so that each layout shows with the sizes it had. The same on every platform: where the window controls are at the top right (Windows, Linux), they stay at the top right of the window, and the top row of the editor area's group below them leaves them room, its toolbar left of them. That row is as tall as the header, and lines up with it. In the title bar, the header gives way to Run, Open in VS Code and the Layout actions, its title shortening, rather than pushing them out of a narrow chat column, and it is above the title bar's drag region, as its toolbars are: a click on its title starts renaming the chat, while its empty space still moves the window. The actions of the session are one group at the right of the title bar of a chat window, in every layout and whether or not the header shows: Run, Open in VS Code, the Create Pull Request bar (Agent Merge), the Layout actions, then the header's More Actions last. The title bar moves the actions it shows beside its title in other windows next to those at its right, and hosts the header's actions after all of them, before only the window controls (getSessionHeaderActionsHost), rather than spreading them over its left, center and right. Its groups are 4px apart, as those of the main window's title bar, a group whose actions all hide themselves, such as the Create Pull Request bar without changes, taking no room, and More Actions, last, is centered above the Session Activity Bar's column below, as its entries are (alignChatWindowHeaderActions). The title row of a chat window is as tall as the row of tabs of its editor area, as it shows (alignChatWindowTitleRow, TitlebarPart.setHeight), for every height of the tabs, density and whether tabs show, so that the two line up beside each other: its drag region and its window controls (the macOS traffic lights, the window controls overlay) follow it, it is measured again when the options of the editor area or the density change, and it keeps its height while the editor area is hidden. The row is measured from the top of the card the editor area is in, its border included, and the cells of the window lay their content out inside their cards' borders, which only default density draws, also once the density changes: the editor area was 2px larger than its card, its groups reaching past it, so that the row was not found at default density. The window lays out again once its styles have loaded (relayoutWhenStylesHaveLoaded): it first lays out before, when its cards have no border yet and the row of tabs no height, which left the title row taller than the row and the chat 2px larger than its card until the next layout. Right above the chat (Side by Side, Chat Only), the title row is the header of the chat's card, as the main window's session header is in its chat's card (isChatWindowTitleRowOverChat, headerInChatCard): the card runs from the top of the window, level with the editor area's card beside it, with its top edge, corners and sides past the header, and shows through the title row; the chat is below the header in it, with no edge between them. Above the editor area's card (Stacked, Editor Only), the title row stays the title bar. Compact density draws no cards, so it shows as before. Co-authored-by: Copilot <[email protected]>
Run in the title bar showed and ran the tasks of the active session, and the entries of the Add Tab button of a tabs bar ran without knowing their group, so in a chat window that was not the active one, or whose window had not taken focus yet, they acted on another session or window. - Run in the title bar of a chat window shows and runs the tasks of the session of that window, and passes that window to the primary task command. In the main window, and from keybindings and the Command Palette, Run acts on the active session as before. - A task that runs for the session a chat window shows, such as by its Run, shows its terminal in the terminals of that window rather than in the main window's panel. Without a chat window of the session, the task terminal shows in the panel as before. A chat window of the session never falls back to the main window's panel. - The Add Tab button of a tabs bar runs its entries with the group of that tabs bar, as the editor actions of the tabs bar do. The Agents window's own entries take no arguments and are unchanged; a chat window's entries find their window from it. - The Browser entry of a chat window's editor area no longer reads a service after opening the browser, when its accessor is no longer valid; the URL input of the new browser now takes focus instead of the entry failing. Co-authored-by: Copilot <[email protected]>
The pull request and agent comment banners above a chat's input read the globally active session, gated only by whether their view is active. Every chat window's view is active, so each chat window showed the pull requests of whichever session had focus, and the main window those of a focused chat window's session. They now read the session of their window (ISessionScope): a chat window's own session, and in the main window its session (mainWindowActiveSession), which is the active session whenever no chat window has focus, as before. Co-authored-by: Copilot <[email protected]>
… of its window
The navigation overlay of agent feedback ("1/15" with its arrows) in the editors
of a chat window resolved the session of the file from the globally active
session, such as the session of another chat window or of the main window, and
showed that session's feedback. A part that a window other than the main one
owns, such as a chat window's editor area or terminals, now gives the overlay the
session scope of its window (ISessionScope), and the file belongs to that
session there (getFeedbackSessionResource and getSessionForFile take the
window's session, hostSession), whichever session is active. The main window,
and floating editor windows, which have its scope, resolve as before.
Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
force-pushed
the
agents/chat-windows
branch
from
November 2, 2026 20:34
5c5ace2 to
90b27c8
Compare
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Nov 2, 2026
The Changes editor of a chat window, which shows in the window's main part, now offers what the main window's offers and acts on the session of its window:
- Its actions are in the "…" of its tab row in every window. Its title actions read MainEditorAreaVisibleContext as each part binds it (the main window for its editor area, a chat window for its main part) in place of excluding auxiliary windows; the Create Pull Request bar shows by the existing per-window keys (IsSessionsWindowContext, !CustomViewVisible, DesktopLayout, SessionIsCreated).
- Each changeset operation is registered once, with the command ids of the main window, while any scope shows it. Two generic per-scope keys, sessions.changesetOperations and sessions.changesetOperationsEnabled, bound through registerSessionActionContextKeyBinder for every scope that shows a session's Changes, decide where it shows and whether it is enabled. Its run resolves the session from the Changes editor it is invoked from: the file toolbar passes { session, editor }, the title passes its editor context. Open File, Expand/Collapse Unchanged Regions, Mark as Viewed and Collapse/Expand All Diffs act on that editor too.
- The chat window's provider binds the keys of the session it shows, and of its changes, on the window's context with bindSessionScopeContextKeys, as the main window binds those of its own session; no chat window contribution or key is involved.
- A Changes tab is closable while the part that shows it is visible: the main window's editor area for its part, MainEditorAreaVisibleContext of the part otherwise.
- Opening the Changes editor of a chat with a changeset selection finds the session of the window that shows that chat (findSessionByChatOrResource).
Carried from #344666 (CW2 version), without its ChatWindowChangesetActionsContribution and chat window keys.
Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Nov 3, 2026
The Changes editor of a chat window, which shows in the window's main part, now offers what the main window's offers and acts on the session of its window:
- Its actions are in the "…" of its tab row in every window. Its title actions read MainEditorAreaVisibleContext as each part binds it (the main window for its editor area, a chat window for its main part) in place of excluding auxiliary windows; the Create Pull Request bar shows by the existing per-window keys (IsSessionsWindowContext, !CustomViewVisible, DesktopLayout, SessionIsCreated).
- Each changeset operation is registered once, with the command ids of the main window, while any scope shows it. Two generic per-scope keys, sessions.changesetOperations and sessions.changesetOperationsEnabled, bound through registerSessionActionContextKeyBinder for every scope that shows a session's Changes, decide where it shows and whether it is enabled. Its run resolves the session from the Changes editor it is invoked from: the file toolbar passes { session, editor }, the title passes its editor context. Open File, Expand/Collapse Unchanged Regions, Mark as Viewed and Collapse/Expand All Diffs act on that editor too.
- The chat window's provider binds the keys of the session it shows, and of its changes, on the window's context with bindSessionScopeContextKeys, as the main window binds those of its own session; no chat window contribution or key is involved.
- A Changes tab is closable while the part that shows it is visible: the main window's editor area for its part, MainEditorAreaVisibleContext of the part otherwise.
- Opening the Changes editor of a chat with a changeset selection finds the session of the window that shows that chat (findSessionByChatOrResource).
Carried from #344666 (CW2 version), without its ChatWindowChangesetActionsContribution and chat window keys.
Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Nov 3, 2026
The Changes editor of a chat window, which shows in the window's main part, now offers what the main window's offers and acts on the session of its window:
- Its actions are in the "…" of its tab row in every window. Its title actions read MainEditorAreaVisibleContext as each part binds it (the main window for its editor area, a chat window for its main part) in place of excluding auxiliary windows; the Create Pull Request bar shows by the existing per-window keys (IsSessionsWindowContext, !CustomViewVisible, DesktopLayout, SessionIsCreated).
- Each changeset operation is registered once, with the command ids of the main window, while any scope shows it. Two generic per-scope keys, sessions.changesetOperations and sessions.changesetOperationsEnabled, bound through registerSessionActionContextKeyBinder for every scope that shows a session's Changes, decide where it shows and whether it is enabled. Its run resolves the session from the Changes editor it is invoked from: the file toolbar passes { session, editor }, the title passes its editor context. Open File, Expand/Collapse Unchanged Regions, Mark as Viewed and Collapse/Expand All Diffs act on that editor too.
- The chat window's provider binds the keys of the session it shows, and of its changes, on the window's context with bindSessionScopeContextKeys, as the main window binds those of its own session; no chat window contribution or key is involved.
- A Changes tab is closable while the part that shows it is visible: the main window's editor area for its part, MainEditorAreaVisibleContext of the part otherwise.
- Opening the Changes editor of a chat with a changeset selection finds the session of the window that shows that chat (findSessionByChatOrResource).
Carried from #344666 (CW2 version), without its ChatWindowChangesetActionsContribution and chat window keys.
Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Nov 3, 2026
The Changes editor of a chat window, which shows in the window's main part, now offers what the main window's offers and acts on the session of its window:
- Its actions are in the "…" of its tab row in every window. Its title actions read MainEditorAreaVisibleContext as each part binds it (the main window for its editor area, a chat window for its main part) in place of excluding auxiliary windows; the Create Pull Request bar shows by the existing per-window keys (IsSessionsWindowContext, !CustomViewVisible, DesktopLayout, SessionIsCreated).
- Each changeset operation is registered once, with the command ids of the main window, while any scope shows it. Two generic per-scope keys, sessions.changesetOperations and sessions.changesetOperationsEnabled, bound through registerSessionActionContextKeyBinder for every scope that shows a session's Changes, decide where it shows and whether it is enabled. Its run resolves the session from the Changes editor it is invoked from: the file toolbar passes { session, editor }, the title passes its editor context. Open File, Expand/Collapse Unchanged Regions, Mark as Viewed and Collapse/Expand All Diffs act on that editor too.
- The chat window's provider binds the keys of the session it shows, and of its changes, on the window's context with bindSessionScopeContextKeys, as the main window binds those of its own session; no chat window contribution or key is involved.
- A Changes tab is closable while the part that shows it is visible: the main window's editor area for its part, MainEditorAreaVisibleContext of the part otherwise.
- Opening the Changes editor of a chat with a changeset selection finds the session of the window that shows that chat (findSessionByChatOrResource).
Carried from #344666 (CW2 version), without its ChatWindowChangesetActionsContribution and chat window keys.
Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Nov 3, 2026
The Changes editor of a chat window, which shows in the window's main part, now offers what the main window's offers and acts on the session of its window:
- Its actions are in the "…" of its tab row in every window. Its title actions read MainEditorAreaVisibleContext as each part binds it (the main window for its editor area, a chat window for its main part) in place of excluding auxiliary windows; the Create Pull Request bar shows by the existing per-window keys (IsSessionsWindowContext, !CustomViewVisible, DesktopLayout, SessionIsCreated).
- Each changeset operation is registered once, with the command ids of the main window, while any scope shows it. Two generic per-scope keys, sessions.changesetOperations and sessions.changesetOperationsEnabled, bound through registerSessionActionContextKeyBinder for every scope that shows a session's Changes, decide where it shows and whether it is enabled. Its run resolves the session from the Changes editor it is invoked from: the file toolbar passes { session, editor }, the title passes its editor context. Open File, Expand/Collapse Unchanged Regions, Mark as Viewed and Collapse/Expand All Diffs act on that editor too.
- The chat window's provider binds the keys of the session it shows, and of its changes, on the window's context with bindSessionScopeContextKeys, as the main window binds those of its own session; no chat window contribution or key is involved.
- A Changes tab is closable while the part that shows it is visible: the main window's editor area for its part, MainEditorAreaVisibleContext of the part otherwise.
- Opening the Changes editor of a chat with a changeset selection finds the session of the window that shows that chat (findSessionByChatOrResource).
Carried from #344666 (CW2 version), without its ChatWindowChangesetActionsContribution and chat window keys.
Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Nov 3, 2026
The Changes editor of a chat window, which shows in the window's main part, now offers what the main window's offers and acts on the session of its window:
- Its actions are in the "…" of its tab row in every window. Its title actions read MainEditorAreaVisibleContext as each part binds it (the main window for its editor area, a chat window for its main part) in place of excluding auxiliary windows; the Create Pull Request bar shows by the existing per-window keys (IsSessionsWindowContext, !CustomViewVisible, DesktopLayout, SessionIsCreated).
- Each changeset operation is registered once, with the command ids of the main window, while any scope shows it. Two generic per-scope keys, sessions.changesetOperations and sessions.changesetOperationsEnabled, bound through registerSessionActionContextKeyBinder for every scope that shows a session's Changes, decide where it shows and whether it is enabled. Its run resolves the session from the Changes editor it is invoked from: the file toolbar passes { session, editor }, the title passes its editor context. Open File, Expand/Collapse Unchanged Regions, Mark as Viewed and Collapse/Expand All Diffs act on that editor too.
- The chat window's provider binds the keys of the session it shows, and of its changes, on the window's context with bindSessionScopeContextKeys, as the main window binds those of its own session; no chat window contribution or key is involved.
- A Changes tab is closable while the part that shows it is visible: the main window's editor area for its part, MainEditorAreaVisibleContext of the part otherwise.
- Opening the Changes editor of a chat with a changeset selection finds the session of the window that shows that chat (findSessionByChatOrResource).
Carried from #344666 (CW2 version), without its ChatWindowChangesetActionsContribution and chat window keys.
Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Nov 3, 2026
The Changes editor of a chat window, which shows in the window's main part, now offers what the main window's offers and acts on the session of its window:
- Its actions are in the "…" of its tab row in every window. Its title actions read MainEditorAreaVisibleContext as each part binds it (the main window for its editor area, a chat window for its main part) in place of excluding auxiliary windows; the Create Pull Request bar shows by the existing per-window keys (IsSessionsWindowContext, !CustomViewVisible, DesktopLayout, SessionIsCreated).
- Each changeset operation is registered once, with the command ids of the main window, while any scope shows it. Two generic per-scope keys, sessions.changesetOperations and sessions.changesetOperationsEnabled, bound through registerSessionActionContextKeyBinder for every scope that shows a session's Changes, decide where it shows and whether it is enabled. Its run resolves the session from the Changes editor it is invoked from: the file toolbar passes { session, editor }, the title passes its editor context. Open File, Expand/Collapse Unchanged Regions, Mark as Viewed and Collapse/Expand All Diffs act on that editor too.
- The chat window's provider binds the keys of the session it shows, and of its changes, on the window's context with bindSessionScopeContextKeys, as the main window binds those of its own session; no chat window contribution or key is involved.
- A Changes tab is closable while the part that shows it is visible: the main window's editor area for its part, MainEditorAreaVisibleContext of the part otherwise.
- Opening the Changes editor of a chat with a changeset selection finds the session of the window that shows that chat (findSessionByChatOrResource).
Carried from #344666 (CW2 version), without its ChatWindowChangesetActionsContribution and chat window keys.
Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Nov 3, 2026
The Changes editor of a chat window, which shows in the window's main part, now offers what the main window's offers and acts on the session of its window:
- Its actions are in the "…" of its tab row in every window. Its title actions read MainEditorAreaVisibleContext as each part binds it (the main window for its editor area, a chat window for its main part) in place of excluding auxiliary windows; the Create Pull Request bar shows by the existing per-window keys (IsSessionsWindowContext, !CustomViewVisible, DesktopLayout, SessionIsCreated).
- Each changeset operation is registered once, with the command ids of the main window, while any scope shows it. Two generic per-scope keys, sessions.changesetOperations and sessions.changesetOperationsEnabled, bound through registerSessionActionContextKeyBinder for every scope that shows a session's Changes, decide where it shows and whether it is enabled. Its run resolves the session from the Changes editor it is invoked from: the file toolbar passes { session, editor }, the title passes its editor context. Open File, Expand/Collapse Unchanged Regions, Mark as Viewed and Collapse/Expand All Diffs act on that editor too.
- The chat window's provider binds the keys of the session it shows, and of its changes, on the window's context with bindSessionScopeContextKeys, as the main window binds those of its own session; no chat window contribution or key is involved.
- A Changes tab is closable while the part that shows it is visible: the main window's editor area for its part, MainEditorAreaVisibleContext of the part otherwise.
- Opening the Changes editor of a chat with a changeset selection finds the session of the window that shows that chat (findSessionByChatOrResource).
Carried from #344666 (CW2 version), without its ChatWindowChangesetActionsContribution and chat window keys.
Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Nov 4, 2026
The Changes editor of a chat window, which shows in the window's main part, now offers what the main window's offers and acts on the session of its window:
- Its actions are in the "…" of its tab row in every window. Its title actions read MainEditorAreaVisibleContext as each part binds it (the main window for its editor area, a chat window for its main part) in place of excluding auxiliary windows; the Create Pull Request bar shows by the existing per-window keys (IsSessionsWindowContext, !CustomViewVisible, DesktopLayout, SessionIsCreated).
- Each changeset operation is registered once, with the command ids of the main window, while any scope shows it. Two generic per-scope keys, sessions.changesetOperations and sessions.changesetOperationsEnabled, bound through registerSessionActionContextKeyBinder for every scope that shows a session's Changes, decide where it shows and whether it is enabled. Its run resolves the session from the Changes editor it is invoked from: the file toolbar passes { session, editor }, the title passes its editor context. Open File, Expand/Collapse Unchanged Regions, Mark as Viewed and Collapse/Expand All Diffs act on that editor too.
- The chat window's provider binds the keys of the session it shows, and of its changes, on the window's context with bindSessionScopeContextKeys, as the main window binds those of its own session; no chat window contribution or key is involved.
- A Changes tab is closable while the part that shows it is visible: the main window's editor area for its part, MainEditorAreaVisibleContext of the part otherwise.
- Opening the Changes editor of a chat with a changeset selection finds the session of the window that shows that chat (findSessionByChatOrResource).
Carried from #344666 (CW2 version), without its ChatWindowChangesetActionsContribution and chat window keys.
Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Nov 4, 2026
The Changes editor of a chat window, which shows in the window's main part, now offers what the main window's offers and acts on the session of its window:
- Its actions are in the "…" of its tab row in every window. Its title actions read MainEditorAreaVisibleContext as each part binds it (the main window for its editor area, a chat window for its main part) in place of excluding auxiliary windows; the Create Pull Request bar shows by the existing per-window keys (IsSessionsWindowContext, !CustomViewVisible, DesktopLayout, SessionIsCreated).
- Each changeset operation is registered once, with the command ids of the main window, while any scope shows it. Two generic per-scope keys, sessions.changesetOperations and sessions.changesetOperationsEnabled, bound through registerSessionActionContextKeyBinder for every scope that shows a session's Changes, decide where it shows and whether it is enabled. Its run resolves the session from the Changes editor it is invoked from: the file toolbar passes { session, editor }, the title passes its editor context. Open File, Expand/Collapse Unchanged Regions, Mark as Viewed and Collapse/Expand All Diffs act on that editor too.
- The chat window's provider binds the keys of the session it shows, and of its changes, on the window's context with bindSessionScopeContextKeys, as the main window binds those of its own session; no chat window contribution or key is involved.
- A Changes tab is closable while the part that shows it is visible: the main window's editor area for its part, MainEditorAreaVisibleContext of the part otherwise.
- Opening the Changes editor of a chat with a changeset selection finds the session of the window that shows that chat (findSessionByChatOrResource).
Carried from #344666 (CW2 version), without its ChatWindowChangesetActionsContribution and chat window keys.
Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Nov 4, 2026
The Changes editor of a chat window, which shows in the window's main part, now offers what the main window's offers and acts on the session of its window:
- Its actions are in the "…" of its tab row in every window. Its title actions read MainEditorAreaVisibleContext as each part binds it (the main window for its editor area, a chat window for its main part) in place of excluding auxiliary windows; the Create Pull Request bar shows by the existing per-window keys (IsSessionsWindowContext, !CustomViewVisible, DesktopLayout, SessionIsCreated).
- Each changeset operation is registered once, with the command ids of the main window, while any scope shows it. Two generic per-scope keys, sessions.changesetOperations and sessions.changesetOperationsEnabled, bound through registerSessionActionContextKeyBinder for every scope that shows a session's Changes, decide where it shows and whether it is enabled. Its run resolves the session from the Changes editor it is invoked from: the file toolbar passes { session, editor }, the title passes its editor context. Open File, Expand/Collapse Unchanged Regions, Mark as Viewed and Collapse/Expand All Diffs act on that editor too.
- The chat window's provider binds the keys of the session it shows, and of its changes, on the window's context with bindSessionScopeContextKeys, as the main window binds those of its own session; no chat window contribution or key is involved.
- A Changes tab is closable while the part that shows it is visible: the main window's editor area for its part, MainEditorAreaVisibleContext of the part otherwise.
- Opening the Changes editor of a chat with a changeset selection finds the session of the window that shows that chat (findSessionByChatOrResource).
Carried from #344666 (CW2 version), without its ChatWindowChangesetActionsContribution and chat window keys.
Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Nov 4, 2026
The Changes editor of a chat window, which shows in the window's main part, now offers what the main window's offers and acts on the session of its window:
- Its actions are in the "…" of its tab row in every window. Its title actions read MainEditorAreaVisibleContext as each part binds it (the main window for its editor area, a chat window for its main part) in place of excluding auxiliary windows; the Create Pull Request bar shows by the existing per-window keys (IsSessionsWindowContext, !CustomViewVisible, DesktopLayout, SessionIsCreated).
- Each changeset operation is registered once, with the command ids of the main window, while any scope shows it. Two generic per-scope keys, sessions.changesetOperations and sessions.changesetOperationsEnabled, bound through registerSessionActionContextKeyBinder for every scope that shows a session's Changes, decide where it shows and whether it is enabled. Its run resolves the session from the Changes editor it is invoked from: the file toolbar passes { session, editor }, the title passes its editor context. Open File, Expand/Collapse Unchanged Regions, Mark as Viewed and Collapse/Expand All Diffs act on that editor too.
- The chat window's provider binds the keys of the session it shows, and of its changes, on the window's context with bindSessionScopeContextKeys, as the main window binds those of its own session; no chat window contribution or key is involved.
- A Changes tab is closable while the part that shows it is visible: the main window's editor area for its part, MainEditorAreaVisibleContext of the part otherwise.
- Opening the Changes editor of a chat with a changeset selection finds the session of the window that shows that chat (findSessionByChatOrResource).
Carried from #344666 (CW2 version), without its ChatWindowChangesetActionsContribution and chat window keys.
Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Nov 4, 2026
…nd drop between parts (#345683) * Chat window: layout model and stacked input-only rules in the workbench Move two pure models of a chat window to src/vs/workbench/contrib/chatWindow/common, with their tests, renamed to chat window names: - chatWindowLayout.ts, from the session grid layout model of I2 (#345075): the layout modes (Chat only, Editor only, Stacked, Side by Side), the grid topology per mode and terminal position, the activity bar column, the tab order, and when a layout change needs a rebuild. - chatWindowInputOnly.ts, from the stacked input-only rules of I4 (#345077): when the chat in Stacked collapses to its input, while dragging, on resize and when the window forces it. Behaviour and test assertions are unchanged. Nothing uses them yet. Co-authored-by: Copilot <[email protected]> * chat: a chat input can lay its editor out one line tall ChatInputPart.setSingleLine lays the input editor out exactly one line tall, whatever its content or minimum lines, for the input-only chat of a chat window. Moved here from #345663, whose only consumer this is. Co-authored-by: Copilot <[email protected]> * editor: the Add Tab entries act on the group of their tabs bar The Add Tab control runs its entries with the group of the tabs bar, so that they act on that group rather than on the active one, such as in a chat window whose window does not have focus yet. Moved here from #345663, whose only consumer this is. Co-authored-by: Copilot <[email protected]> * chat: links in chat markdown open with the opener of the renderer's scope The chat markdown renderer opens links with the opener service of its scope, such as of the window that shows the chat, rather than the global one. Moved here from #345663, whose only consumer this is. Co-authored-by: Copilot <[email protected]> * sessions: the chat composite bar and the card frames follow a chat surface outside the Sessions part The header's background and the frame ownership of a card apply to a chat surface as to the Sessions part, and the tests of the Sessions part mark it as a chat surface, as the part's chat background now does. Moved here from #345663, whose only consumer this is. Co-authored-by: Copilot <[email protected]> * sessions: show sessions outside the Sessions part grid The Agents window can only show a session in the Sessions part grid of its main window. Add window sessions: ISessionsService.showSessionInWindow shows one chat of a session outside the grid, in a session view registered with ISessionsPartService.registerWindowSessionView. A chat shown that way leaves the tabs of its session in the grid, and the session leaves the grid when that chat was its only one; closeSession stops showing it. Active session rule: a session shown in another window becomes active while that window has focus, unless it is shown passively; the main window's layout follows its own session. The sessions list, layout controllers, Changes, the terminal and the agent host provider follow mainWindowActiveSession, which is the active session while no other window shows a session. The agent host provider treats sessions shown in other windows as shown, for chat config and loading. Nothing shows a session in another window yet, so behavior does not change. A test covers that the main window follows the active session without other windows. Ported from agents/sessions-window-sessions 94f6c110d69, 5ec09ac3f48, 664d4e717db and 4a10fdb1bb8, e08ab865cad. Co-authored-by: Copilot <[email protected]> * sessions: let session actions act on a given session The title bar's Changes, pull request and review actions, the Changes view and editor, and the Agent Merge context keys always act on the active session, so they cannot serve a session that is shown but not active. Make them take a session: - Actions resolve their session from an explicit argument (by resource, against the sessions shown in the grid and in other windows), else from the main window's active session. - ISessionScope gives a view or editor its session; the Changes view, summary, picker, changeset selection, editor, resolver and review actions read their changes through IChangesViewService.getSessionChanges(session). - Session action context keys are bound per context key service, so a title bar hosted for a non-active session gets its own scoped keys; their observables only react to the keys they read. Without an argument and without other windows every action still targets the active session, so behavior does not change. Squashed from agents/session-scoped-titlebar-actions (94b140fb23d, 4000cd23529, 46bf53f9e44, 376161c28b5, 170261683c6, 49ae8b2654e, 0be0e134bef, 258419ba130, 6b76d9d947c, 15b99a7f6e4, 42e61c7cd4d, 9e5e58f7a75, a26d679dd55, 0515ba584b9, 31e44e57cca, f575613f549), with 993cf42ec96, 2f339933667 and 65c2e7c69c1 for the main window's session. A Changes editor shows the changes of the chat its source names, from that chat only: whichever chat or session is active and whichever window has focus, so that two editors of two chats of a session, in one window or not, each show their own (ISessionChangesEditorOptions.chatResource, getChangesEditorChanges). The main window's editor, which names no chat, shows the chat the main window shows for its session, as its active session or a session of its grid, never the session another window shows or has focus, as on main; once the main window does not show its session, such as when the editor moves into the window a chat of its session opens in, the chat that window shows. Fix Checks sends its prompt to the widget of the chat its session shows. Co-authored-by: Copilot <[email protected]> * sessions: let session views be hosted outside the Sessions part, with an input-only chat view A session view only works inside the Sessions part: it always shows the session header and the Session Activity Bar, and its chat input always takes the main window's options. Session views, chat groups and chat views now take ISessionViewHostOptions, so a host outside the Sessions part can hide the session header and the Session Activity Bar and configure the chat input (placeholder, minimum lines, status pills). SessionView exposes its primary chat view, and Sessions part styles also apply under .sessions-window-host. The chat view gains an input-only mode: it shows only the input, with the latest message and the progress or outcome of its response above it, and switches back to the conversation when the chat waits for input that only the conversation can show. Waiting for input, failing and cancelation are announced once to screen readers, and nothing is read from the chat until input-only is enabled. While input-only, the input editor is laid out exactly one line tall (ChatInputPart.setSingleLine, from the workbench parts foundation). The Sessions part passes no host options and nothing enables input-only mode, so behavior does not change. Ported from agents/sessions-window-sessions c0685f56d02, 10fb2354aa6, 5de12de1983, adapted to the Session Activity Bar taking its own column. Carried for the chat windows on parts without the two input-only context keys (sessions.chatViewInputOnlyEnabled, sessions.chatViewInputOnly), which nothing read, and without ChatInputPart.setSingleLine, which the workbench parts foundation carries. Co-authored-by: Copilot <[email protected]> * sessions: share the chat background surface beyond the Sessions part The Sessions part painted the chat background itself, so nothing else could show a chat with the Agents wallpaper behind it. - SessionsChatSurface paints the chat background behind an element and follows the background service; the codicon confetti, its announcement and its telemetry move with it. The Sessions part uses it. - The rules that let the background show through chat surfaces, lift a surface's `.content` above the background, give its editors the panel background and place the confetti target match `:is(.part.sessionspart, .sessions-chat-surface)`, keeping the weight of the `.part.sessionspart` rules they override. The sticky scroll replica finds the background through the surface. No visual change. The wallpaper half of 3825a51e90b (#345561). Its card surface half (`.agents-card-surface`, `--agents-card-frame-owner`) belongs to the part-grid look of the workbench parts foundation. Co-authored-by: Copilot <[email protected]> * chat windows: generic window layout keys, the chat window service seam and window state The first piece of chat windows in the workbench (P9): - `layoutMode` and `splitLayout`: generic per-window context keys, next to the panel keys, for how a window shows its chat and its editor parts. They are bound in a window's own context and unset elsewhere, so that the Layout menu's entries stay extensible and keybindings can test the mode. `bindWindowLayoutContext` binds them to a window's state. - `IChatWindowService` and `IChatWindowProvider`: a chat window shows a chat in its chat part beside its main part. The provider supplies the content (the chat's editor, title and scoped services), the chrome (title row and strip), the look (gap, cards, chat background) and where a chat goes back to. There are no chat window kinds. - `ChatWindowState`: the layout rules of chat windows (Stacked / Side by Side / Editor Only / Chat Only, the next split arrangement, input-only, terminal position), what chat windows were last left as, and what is remembered per chat. It reads the keys chat windows of the Agents window stored them under. - the opening helpers (one opening per chat at a time, clean up on failure) and the serialization of a main part's editors for restore. The layout model (`chatWindowLayout.ts`) gains the split layout type and guards for stored values. Nothing registers a provider or the service yet, so nothing changes. Co-authored-by: Copilot <[email protected]> * chat windows: layout commands on the generic window layout keys The layout commands of chat windows (P9), in the workbench: Show Chat Only, Show Editor Only, Show Chat and Editor Stacked / Side by Side, Show Chat, Show Editor, Stacked and Toggle Chat Conversation, with the rules chat windows of the Agents window have (the last part shown cannot be hidden; Stacked changes the arrangement while both show, else only how both show next). Changing the layout is announced to screen readers. - Their checked state reads the generic `layoutMode` and `splitLayout` keys. - They apply where a window has layout modes (`layoutMode` is set), in the Agents window (`IsSessionsWindowContext`) while AI features are enabled. - They act on the chat window that has focus (`IChatWindowService.activeWindow`) instead of on a window handle passed by the toolbar that runs them. The Agents window loads the contribution; regular VS Code does not. The menus and buttons that show these commands come with the Agents provider. Co-authored-by: Copilot <[email protected]> * chat windows: restore the chat windows open when the window last closed The restore rules of chat windows of the Agents window (P9), driven by the chat window provider: - the chat windows open when the window last closed open again, without focus, with the editors of their main part and their terminals, once the provider registers and while it restores (`restoreEnabled`), such as while chat windows are enabled and AI features are not hidden; - until then, and while restoring is pending, the stored ones are kept; - a chat that is gone is not restored (`canRestore`), and a removed chat is forgotten at once, before the next save (`onDidRemoveChats`). The storage key and format are those chat windows of the Agents window always used. Their entries named the session, and its chat only when it was not the main one; the provider resolves a session to its main chat, so the windows open before chat windows were built on parts open again. Co-authored-by: Copilot <[email protected]> * chat windows: the chat window service and its window, on content parts `ChatWindowService` opens a chat window for a chat through the registered provider (P9): - one window per chat: opening a chat that shows, also as the chat the provider resolves it to, reveals its window; one opening per chat at a time; a failed opening takes down what it set up; - the window is an auxiliary window with its own context, scoped to its document body, where the generic `layoutMode`/`splitLayout` keys and `mainEditorAreaVisible` are bound; - two content parts: the main part, created first so it is the window's main part, starting with the editors moved from the main window or restored, and the chat part, showing the chat's editor from the provider. Both take the window's context and the provider's services; - Move to Main Window closes the window and hands the chat and the editors of its main part to the provider; - the stored chat windows are restored once the provider registers. `ChatWindow` follows today's rules: its main part shows when an editor opens in it and the window shows only its chat once its last editor closes (not for a move, nor while it closes or unloads); closing the chat's editor, the end of its chat, or closing it closes the window, the chat part first so the chat's editor does not move to the main window; a main part editor that cannot move keeps the window open; focus goes to the chat while it shows, else the main part. `ChatWindowPartsLayout` places the two parts per layout mode from the chat window layout model until the window part grid of the workbench takes over. The service registers in the Agents window only; without a provider nothing opens. Co-authored-by: Copilot <[email protected]> * sessions: chrome hosts for windows of their own The sessions chrome that a chat window shows outside its chat, carried from the chat windows work without its chat-window keys and handles: - the session header can show in a host outside its session view, such as the title bar of its window (SessionView.setHeaderHost, headerShown), as the window's top row; the title bar hosts it in place of its title, with the header's actions last at its right (getSessionHeaderHost, getSessionHeaderActionsHost, setHostsSessionHeader), and can show a fixed title or height; - the Session Activity Bar can show in a host outside its chat, such as a column of its own (registerSessionActivityBarExternalHost), also while its chat is hidden (partVisible on the chat groups); - the items of a submenu flyout run with the context of their entry; - the title bars of other windows show the Layout menu of their window (Menus.TitleBarWindowLayout), whose buttons the user shows and hides with the toolbar's own hide/show state, in place of the promoted-button keys; it is empty in windows without layout modes; - in a window with layout modes (the generic `layoutMode` key is set), a checked entry of the strip's side panel group hides the window's editor parts, in place of the main window's side panel; - the title bar of an editor window reads no session's keys. Co-authored-by: Copilot <[email protected]> * chat windows: the provider's title row and strip, and the chat's size, in the window The chrome facet now reaches the window: a provider renders its title row and its strip into elements of the window that the window places, with an instantiation service that has the window's services (its content's, and the window's context), and tells the room they take (`size`). The interim placement of the parts lays them out with the chat window layout model: - the title row is above the chat while the main part is beside it (Side by Side), else across the window; - the strip is a column of its own at the right while the chat is below the main part or hidden (Stacked, Editor Only), as the layout model's column placement says; - the chat part's maximum height bounds it, such as a chat that shows only its input, and the main part takes the rest; parts share the room as the chat windows did, the main part wider and taller than the chat, in whole pixels. Interim: the window part grid replaces this placement. Co-authored-by: Copilot <[email protected]> * sessions: the chat of a session as a view editor Registers the view editor `sessions.chat`, which the chat part of a chat window shows: a session view of the window's session, configured as the chat windows showed their chat (its session header, its Session Activity Bar and its pills, the default input placeholder). It brings its own title, so its group shows no tabs. Whoever opens its editor gives it what it shows (registerSessionChatViewHost): the window session, the chat window, and where the session header shows (the window's title row). - the view's size constraints are the chat's: 280 by 120 at least, and, while the window stacks the chat below its main part and the chat shows only its input, at most its input's height, which its part and the window respect (input only, carried from the chat window's input-only controller onto the view's constraints); - the chat follows the window's input-only state, and what the user chooses in the chat is kept for the window, but not the conversation the chat shows while its input cannot show what it needs; - its view is hidden while the window shows only its main part; - the active editor its menus read is the one of the window's main part, as the main window's chat reads the one of its editor area, so that the Session Activity Bar's entries show checked. Co-authored-by: Copilot <[email protected]> * chat windows: bind the window's content, and the look of its main part What the Agents provider needs of the window, kept generic: - `IChatWindowContent.bind(window, instantiationService)`: called once the window's services exist, before its parts show anything, such as to show the session of the window and bind its keys on the window's context; - the look facet's options of the main part: part options that override the user's settings there (`mainPartOptions`, enforced live) and the options of its groups (`mainPartGroupViewOptions`), such as the menus and modern tabs of the main window's editor area; - a content part takes the options of its groups at creation (`groupViewOptions`, an ordinary option any part can use); - a chat window is an auxiliary window: its context sets `isAuxiliaryWindow`, so that what applies to the main window only, such as its panel and side panel toggles, does not apply there. Carries the chat window's test for moving the main window's editors into a chat window. Co-authored-by: Copilot <[email protected]> * sessions: the Agents provider of chat windows Registers the provider of chat windows for the Agents window (SessionsChatWindowProvider), on the chat window seam of the workbench: - content: a session or a chat resolves to the chat the window shows (the one asked for, else the one the session shows in the grid, else its main chat), shown as the `sessions.chat` view editor; once the window exists the session shows in it as a window session (showSessionInWindow), with its loaded chat model held across the move (ChatModelHold); the window acts on that session (ISessionScope) and binds its keys on the window's context (session keys, including sessionHasWorkspace and isQuickChatSession, hasWorktreeAndRepository, isAgentHostSession); the session view registers as the window's session view, which focuses its window and its chat; a focused window activates its session; the title is the chat's, or the session's; the window ends when its chat is deleted or archived, follows a replaced session, and stops showing its session as it closes; - chrome: the title bar as the window's title row, which shows the session header in place of the chat's title, with its actions centered above the Session Activity Bar's column (only with a custom title bar); and the column the Session Activity Bar shows in while the chat is below the main part or hidden; - look: the gap between cards per density (none in compact), cards, the chat background behind the chat (SessionsChatSurface), and the main part as the main window's editor area: its menus and modern tabs, `showTabs: none` as one tab, no group sizing on a double click; - move to the main window: the chat or session opens there again with the window's editors once the main window is laid out for it; - restore: after the main window restored, a chat restores while its session loads within 30s and the chat is not gone; only while `sessions.chatWindows.enabled` is on and AI features show; the chats of removed sessions are forgotten. The editor parts of other windows show whether the main window's editor part shows or not. Co-authored-by: Copilot <[email protected]> * sessions: entry points of chat windows, behind sessions.chatWindows.enabled Registers `sessions.chatWindows.enabled` (experimental, off by default), which gates the entry points only: - Open in New Window on a session (sessions list, session header) and on a chat of the sessions list, and Open Chat in New Window (Command Palette); the chat takes the main window's editors along only while the main window shows that chat; - Move to Main Window in the session header of a chat window and the Command Palette; - the accessibility help of the Agents chat describes chat windows while the setting is on. In windows with layout modes (the generic `layoutMode` key is set), without chat-window keys: - the Layout menu (Show Chat, Show Editor, Stacked, checked on the generic keys) and the buttons of its actions, in the title bar, or in the Session Activity Bar while the strip shows the layout actions; the user shows and hides the buttons with the toolbar's own hide/show state, Show Editor showing by default, in place of the promoted-button keys; - the Changes, Files and Browser entries of the Session Activity Bar and of Add Tab open in the main part of the window that has focus, checked while it shows them; Changes and Files need a session with a workspace; - an empty main part has one close button, which shows only the chat; the main window's Close Editor Area stays out of these windows; - Run and Open in VS Code show in the title bar of a window that shows a session with a workspace, as in the main window. Co-authored-by: Copilot <[email protected]> * sessions: banners and agent feedback show the session of their window Carried from the chat windows work, on the session scope a chat window gives its parts: - the pull request and agent comment banners above a chat's input read the session of their window (ISessionScope): a chat window's own session, and in the main window its session (mainWindowActiveSession), which is the active session whenever no chat window has focus; - agent feedback in the editors of a part other than the main one, such as a chat window's main part, belongs to the session of that part's window whichever session is active; not for floating editor windows, which have the main window's session scope. Co-authored-by: Copilot <[email protected]> * chat windows: on the part grid A chat window lays out its cells on the workbench's part grid instead of the interim placement: - `ChatWindowGrid` arranges the title row, the chat part, the main part and the strip for the layout mode, as chat windows always did: side by side and chat only with the title row above the chat's column and the main part running to the top of the window; stacked and editor only with the title row across the window and the strip in a column of its own at the right. The part a mode hides stays in the grid; the grid hides a part with no editors. - The parts open with the shares they always had (the main part wider and taller than the chat); the title row and the strip are as large as their chrome says. Sashes let the user size the parts, and the sizes are kept per arrangement, so that a mode shows with the sizes it had, and per chat across reloads (the chat sizes storage chat windows always used). - The look facet's `className` replaces `cards`: the Agents provider styles the cards of the grid (`--part-grid-card-*`) as the main window's, with the main part's card on the editor background and none in compact density; the gap is the floating-panel gap, 0 in compact density. Co-authored-by: Copilot <[email protected]> * chat windows: the part that holds a window's terminals A chat window gets a part that holds its terminals, in its part grid, and the generic per-window keys that describe it: - `terminalsVisible` and `terminalsPosition` (workbench/common/contextkeys.ts, next to `layoutMode` and `splitLayout`): whether the window shows the part that holds its terminals, and where that part sits ('underChat', 'underEditor', 'fullWidth'). They are bound on the window's own context by the window shell, and unset in windows without such a part. - `IChatWindow.getOrCreateTerminalsPart()` creates the part the first time, as a cell of the window's part grid at the terminal position: below the chat, below the main part, or across the bottom of the window; across the bottom of the chat and the main part while stacked (the strip runs past it), and below the strip in editor only. Like every part, it hides while it has no editors; `terminalsVisible` follows the cell. What it shows is what the feature that shows terminals opens in it. - `IChatWindow.setTerminalPosition()` moves the part's cell in the grid (`PartGrid.moveCell`), keeping its height; changing the layout mode rebuilds the grid with the part where the topology puts it. - The terminals keep their height as the window is resized: the other parts take what it grows or shrinks by. Tall terminals give way first in an arrangement they did not show in yet, so that the chat and the main part keep their heights. The terminals' sizes are remembered per arrangement and across them, with the window's other sizes. - `IChatWindow.onWillClose` fires as the window closes (once its chat and main parts closed) or as its window unloads, before the part that holds its terminals closes, so that terminals can leave the window still running. - The part takes the look's main part options (tabs as in the main part). - Restoring: a window stores whether it showed its terminals, and opening it with `showTerminals` creates the part for the terminals feature to fill. Co-authored-by: Copilot <[email protected]> * sessions: terminals in chat windows, in the part that holds them The sessions terminals open the terminal of a chat window's session into the part of the window that holds its terminals (ChatWindowTerminals, created by ChatWindowTerminalsContribution), rather than through a terminal host that the window calls: - Shown, a window shows the terminals it showed, else a terminal of its session that no other chat window shows, else a new one in the session's working directory. The terminal is created at the view column of the window's part, directly in the window, so that nothing flashes in the main window, and is not moved again. - The panel leaves a terminal to the chat window while it shows there (SessionsTerminalContribution.setShownInChatWindow): it is neither made visible nor the panel's active terminal for the session. - Hidden, the window's terminals go back to the background of the panel, still running, so that the part that holds them is empty and hides; focus in them stays in the window. Closing their last terminal hides the part too, and a move does not: both are the part grid's rule for a part without editors. As the window closes (`IChatWindow.onWillClose`) its terminals are released the same way, back to their session. - New Terminal or Split in the part makes the new terminal the window's; a terminal opened in the window's main part moves to the part that holds the terminals; a terminal handed to a window, such as the terminal of a task, shows beside the others. - A window restored with its terminals shows them again: the window creates the part that holds them as it opens, and the terminals fill it. - A file opened from a terminal opens in the main part of the window it is opened from (TerminalLocalFileLinkOpener): when the active group is in another part of its window than the window's main part, such as the part that holds a chat window's terminals, the file goes to the window's main part. Elsewhere, including the modal editor part, nothing changes. - `IChatWindow.terminalsPart` is an `IContentPart`, which has its element. Co-authored-by: Copilot <[email protected]> * sessions: the terminal commands of chat windows The commands of a chat window's terminals, in the Agents window, while AI features are enabled and in a window with layout modes, on generic keys only (`IsSessionsWindowContext`, `chat.enabled`, `layoutMode`, `terminalsVisible`, `terminalsPosition`, `activeEditor`): - Toggle Terminal in Chat Window (workbench.action.chatWindow.toggleTerminal) with the panel and terminal keys (Cmd+J, Ctrl+`), above the main window's rules for them wherever the focus is in the chat window, and never sent to the shell (terminal skip-list). Checked by `terminalsVisible`. It is the Terminal entry of the Session Activity Bar of a chat window. - The Terminal entry of Add Tab (workbench.action.chatWindow.addTerminal): adds a terminal to the terminals that show one, else shows them. - Terminal Position (Full Width, Under Editor, Under Chat) in the More Actions of the terminals and in the context menu of their tabs, recognized by the active editor of the group, a terminal; checked by `terminalsPosition`; unavailable while Stacked. - Toggle Editor in Chat Window (workbench.action.chatWindow.toggleEditorByKey) with the side panel key (Cmd+Alt+B): hides the main part, leaving the chat, and shows it again as it showed with the chat; also skipped by the shell. The commands act on the window of the editor group they are invoked from, such as the terminals' title, else on the chat window that has focus (`resolveChatWindow`). The terminals of chat windows are a service of the Agents window (IChatWindowTerminalsService), which the commands use and a contribution creates at startup, so that restored windows show their terminals again. Co-authored-by: Copilot <[email protected]> * sessions: the Changes editor is the same in every window The Changes editor of a chat window, which shows in the window's main part, now offers what the main window's offers and acts on the session of its window: - Its actions are in the "…" of its tab row in every window. Its title actions read MainEditorAreaVisibleContext as each part binds it (the main window for its editor area, a chat window for its main part) in place of excluding auxiliary windows; the Create Pull Request bar shows by the existing per-window keys (IsSessionsWindowContext, !CustomViewVisible, DesktopLayout, SessionIsCreated). - Each changeset operation is registered once, with the command ids of the main window, while any scope shows it. Two generic per-scope keys, sessions.changesetOperations and sessions.changesetOperationsEnabled, bound through registerSessionActionContextKeyBinder for every scope that shows a session's Changes, decide where it shows and whether it is enabled. Its run resolves the session from the Changes editor it is invoked from: the file toolbar passes { session, editor }, the title passes its editor context. Open File, Expand/Collapse Unchanged Regions, Mark as Viewed and Collapse/Expand All Diffs act on that editor too. - The chat window's provider binds the keys of the session it shows, and of its changes, on the window's context with bindSessionScopeContextKeys, as the main window binds those of its own session; no chat window contribution or key is involved. - A Changes tab is closable while the part that shows it is visible: the main window's editor area for its part, MainEditorAreaVisibleContext of the part otherwise. - Opening the Changes editor of a chat with a changeset selection finds the session of the window that shows that chat (findSessionByChatOrResource). Carried from #344666 (CW2 version), without its ChatWindowChangesetActionsContribution and chat window keys. Co-authored-by: Copilot <[email protected]> * chat windows: type fixes in tests of terminals and Changes The tests of chat window terminals, of the Changes editor input and of the Agent Merge actions typecheck: an explicit type for a self-referencing parts list, the changeset operations the session observables now carry, and a generic invokeFunction in a test stub. Co-authored-by: Copilot <[email protected]> * chat windows: the part fakes of grid tests can be shown and hidden The part grid now tells a content part whether it shows (IContentPart.setVisible); the fake parts of the chat window grid tests take it. Co-authored-by: Copilot <[email protected]> * chat windows: keep the main window's outer insets to the window edges The cards of a chat window ran to the edges of its window (feedback on 491817); the main Agents window keeps a gap between its cards and the window edges. The look facet gains `outerInsets`, which the window's grid keeps to the edges of the window, also as it changes its arrangement; its cells share what is inside them. The Agents provider keeps the floating-panel gap to the right, bottom and left edges, none in compact density, and none at the top, where the title row is, as the main window's title bar is. Co-authored-by: Copilot <[email protected]> * chat windows: the main window's editors move in before the chat leaves the main window Open in New Window did not bring the editors the main window showed for the chat: binding the window's content shows the chat's session in the chat window, which takes it out of the main window together with the editors the main window showed for it, before they moved. They now move into the window's main part first, as chat windows always did. Co-authored-by: Copilot <[email protected]> * sessions: the session header leaves its window's title row with its chat view A chat moved between groups showed the session header twice in the title row of its window: the view editor creates a new view for the chat where it moves to, and the old view's header stayed in the title row after the view went away. A session chat view now takes its header out of the host it shows in when it is disposed. Co-authored-by: Copilot <[email protected]> * sessions: Run and Open in Editor follow the main window's rule in every Agents window The title bar's Run and Open in Editor showed in a chat window only while its session had a workspace and was not a quick chat (SessionTitleBarActionsShownContext). They now follow the main window's rule everywhere (user decision): no workspace check. Their expressions keep the main window's `!isAuxiliaryWindow` and add the generic `layoutMode` window key, set in windows with layout modes, so that they show in the main window and in chat windows, and not in editor windows, which have no session. No key exists that is true exactly in windows with a session, and none is added. SessionTitleBarActionsShownContext is removed. Intended difference from 491817: Run and Open in Editor show in a chat window also for a session without a workspace or a quick chat, as in the main window. Co-authored-by: Copilot <[email protected]> * sessions: a chat keeps where it is scrolled to when its editor moves When the chat editor of a chat window moves, such as to another group, the view editor creates a view for it where it moves to, which shows the chat as it was last saved; the old view saved it only when disposed, after the new one loaded. The session chat view now saves what its chat shows when its pane asks, before the editor leaves it (IViewEditorView.saveViewState): chat views can save their view state (AbstractChatView.saveViewState), which the sessions chat view does as it does when disposed. The input's draft lives on the chat's model, which both views share. Co-authored-by: Copilot <[email protected]> * chat windows: a chat editor moved out of its window takes the chat out of it A chat's editor moved into another window, such as dragged into the main window's editor area or moved into a new window, stayed there as a plain view editor, and its chat window only followed the groups its chat part had when it opened. The chat window now follows the chat's editor in every group of its chat part, also those added later, such as when the part splits, and closes when it closes there. When the editor moves out of the window, the editor closes where it moved to and the chat follows the user decision: into the main window, it moves to the main window as Move to Main Window does; into another window, it shows in a chat window of its own again. Co-authored-by: Copilot <[email protected]> * chat windows: close the window once the chat's editor closed Cmd+W in the chat of a chat window closes the chat's editor, which closes the window. The window closed its parts while the chat part's group was still closing the editor, so the editor close continued on a closed part: an error notification showed in the main window and the extension host received editor tabs without an active group. The window now closes once the editor closed. Co-authored-by: Copilot <[email protected]> * sessions: chat window tests follow the Run rule and the strip's Terminal entry The editor area test expected Run and Open in VS Code in chat windows only for sessions with a workspace; they follow the main window's rule in every chat window now. The contribution test picked the strip's layout entries by a prefix that the Terminal entry of the strip also has. Co-authored-by: Copilot <[email protected]> * chatWindow: title row and chat are one card side by side and in chat only Side by side and in chat only, the title row is the header of the chat's card, in the chat's cell of the grid, as in today's chat window: no card edge between the title and the chat. Stacked and in editor only, it stays a row of its own across the window. Co-authored-by: Copilot <[email protected]> * sessions: chat window title row as tall as the main part's row of tabs The title row takes the height of the row of tabs of the window's main part, its card's frame included, in every layout: while the main part does not show, the height it last showed. Co-authored-by: Copilot <[email protected]> * sessions: chat window title row across the window with the chats as tabs With the chats of the session as tabs, which replace the session header, the title row of a chat window is a row across the window, as the main window's title bar is, side by side and in chat only too; with a single chat it is the header of the chat's card again. The title row says so with the generic headsChat of a chrome element. Co-authored-by: Copilot <[email protected]> * chat windows: one title row at a time, the window's across the top or the chat view's own, as tall as the row of tabs A chat window has two places for its title, and shows one at a time. The title bar part is a row across the top of the window, which shows and hides as a cell of its grid: stacked, in editor only, and with the chats of the session as tabs. With a single chat, side by side and in chat only, the chat view shows its own title row at the top of the chat's card instead, one surface with the chat. Both are as tall as the row of tabs of an editor part, from the first frame and in every layout, rather than measured from the main part. The classes of the window go on its own element, as those of the container of an auxiliary window follow the main window's, and the window lays out again once its styles have loaded. This replaces the title row in the chat's cell and the measured height of the previous commits. Co-authored-by: Copilot <[email protected]> * sessions: chat windows look as they did The chat view is styled as the session views of the Agents window are (sessions-window-host). The cards draw the frames of the parts in them, the chat's card is the chat's surface, and the group of the part that holds the chat draws no frame of its own. The cards keep no gap to the edges of the window. The native title bar of a chat window shows its layout actions, and windows with layout modes show no Always on Top. Co-authored-by: Copilot <[email protected]> * chat windows: frames, gaps, strip and title rows as before The main part shows without editors, as it did. The title row of the window keeps no gap to the cards below it. The chat view's own title reaches over the gap beside the chat's card, so that its actions are where they were. The groups of the main part draw their frames, and the session view the chat's, but while the chat shows its own title row, which the chat's card frames with it. The strip's column holds the gap beside it. Co-authored-by: Copilot <[email protected]> * editor: no Lock Group or Close Group in the empty groups of windows with layout modes An empty group of an auxiliary window offers to lock or close it, which closes an editor window: a window with layout modes, such as a chat window, shows more than its editors, and its empty groups offer neither, as before. Co-authored-by: Copilot <[email protected]> * chat windows: close with the workbench, such as as it reloads A chat window closes as the workbench shuts down, after the windows to restore were saved, as editor windows do: reloading left the window open beside the one that restored. Co-authored-by: Copilot <[email protected]> * chat windows: the main window's padding, the window controls in the title row The cards keep the gaps of the main window's to the edges of the window, but at its top, where the title row is, as the user asked, rather than none as before: the chat leaves its frame to the session view in its card, or, while it shows its own title row, frames both, so that the frames are where the main window's are. The chat's own title row reaches to the edges of the window, under its window controls, and only the title row that shows places them: one laid out without height while it is hidden moved them to the top edge of the window. Its negative top margin no longer moves the chat with it. Co-authored-by: Copilot <[email protected]> * sessions: Terminal Position in the menus of the terminals of a chat window The menus of an editor group read the id of its active editor pane, which for a terminal is the terminal editor's, not the id of its input: Terminal Position never showed. Co-authored-by: Copilot <[email protected]> * sessions: the terminals of a chat window line up with its other cards The groups of the terminals draw their frames with connected tabs, as the main part's do: their card leaves its frame to them, so that it is as wide as the cards beside it. Co-authored-by: Copilot <[email protected]> * terminal: recreate the WebGL renderer once a terminal shows in another window The canvas of the WebGL renderer loses its context in another window than the one it was created in, without the renderer falling back: a terminal that moved to an auxiliary window, such as one restored into a chat window, showed a lost canvas. Attaching the terminal to a container in another window recreates the renderer there. Co-authored-by: Copilot <[email protected]> * sessions: the terminals of a chat window framed as the main window's panel The terminals' card draws its frame at its edges, as the main window's panel does, rather than the groups of the terminals inside it: their frame was missing at the edges of the window and doubled at its sides. Co-authored-by: Copilot <[email protected]> * sessions: disable hiding the part that shows alone in the chat window Layout menu The Layout menu entries are menu items of their own, which don't carry the preconditions of the actions: Show Chat stayed enabled in Chat Only and Show Editor in Editor Only. Give them the same preconditions, as 491817 does. Co-authored-by: Copilot <[email protected]> * sessions: window-scoped actions act on the chat window's session A chat window's session became the active session only once focus moved into its session view, so its title row actions (Open in VS Code, the Run dropdown) and its tab entries acted on the main window's session. Its session now becomes the active session as its window gains focus, without moving focus, and those actions take the session from the window's own session scope. Co-authored-by: Copilot <[email protected]> * sessions: no New Session title bar button in chat windows The button stands in for the main window's sessions list while it is hidden, and a chat window inherited the main window's sideBarVisible key, so it showed in a chat window's title too. It now shows in the main window only. Co-authored-by: Copilot <[email protected]> * chat windows: no lock action in the title of the part that holds the terminals Terminal groups lock as terminals open in them, which keeps other editors out of the part that holds a chat window's terminals, but its title then offered Unlock Group, which the main window's panel does not. A generic editor group view option, hideLockActions, hides the lock and unlock actions of the groups of a part; the terminals part uses it. Co-authored-by: Copilot <[email protected]> * chat windows: keep the editors and terminals of a chat window whose chat moved to another window As the chat's editor moved out of a chat window into another window than the main window, the window closed and the chat opened in a new chat window without the editors of its main part and its terminals. They now show there again. Co-authored-by: Copilot <[email protected]> * sessions: no second Changes tab in a chat window A Changes editor that moved into a chat window with its chat, or that a restart restored, is the Changes editor of the session rather than of the chat, so the Changes entry did not find it and opened another. It now activates any Changes tab of the window's session. Co-authored-by: Copilot <[email protected]> * sessions: a chat window no longer sets the title of the main window The title bar of a chat window set the document title of the window it was in, and the title row of the chat view is created before it is in its window, so it set the main window's title to the chat's, where it stayed. The title of a window is now its owner's: the chat window service sets it for its window. Co-authored-by: Copilot <[email protected]> * sessions: a title bar looks active while the window it is in is active A title bar took the window to follow for its active look as it was created, so the title row of a chat view, created before it is in its chat window, followed the main window: it looked inactive in a focused chat window. It now follows the window it is in as the active window changes. Co-authored-by: Copilot <[email protected]> * chat windows: pin closing the editor area with the terminals under the editor Close Editor Area shows only the chat. With the terminals under the editor they stay, across the window and as tall, rather than going away with the main part, and go back under the editor as it shows again. Co-authored-by: Copilot <[email protected]> * chat windows: the first open of a chat with no editor to bring along shows only the chat As 491817 does: a chat that shows in a chat window for the first time, with no editor in its main part, opens in Chat Only rather than with an empty main part, without changing what is remembered, so that a mode the user chooses for the chat shows again. Also pins that an editor dropped beside the chat, which splits the chat part and empties the main part, changes no mode. Co-authored-by: Copilot <[email protected]> * chat windows: keep the sizes of the parts across mode round trips and part moves - The terminals moved between arrangements take their height once the cells beside them show: resized while the main part was still hidden, it took a share of their height as it showed (200 -> 270 after Chat Only and back). - Sizes are remembered for an arrangement only while the part grid still shows it as the window arranged it: after a part moved, such as with Move Part, the chat across the window was remembered as its width side by side, and the main part came back at its minimum. Co-authored-by: Copilot <[email protected]> * chat windows: pin the widths of the chat and the main part over QA's second split sequence Terminal position walk, terminals hidden and shown, Chat Only and back, a resize and a change of density keep the chat at the width the user gave it. Co-authored-by: Copilot <[email protected]> * chat windows: Side by Side never comes back with the side part at its minimum Chat Only and Side by Side share an arrangement, but in Chat Only the chat takes the room of the hidden side part: its full width, saved as the window saved its state, was remembered for Side by Side, and the side part came back at its minimum. - Sizes are remembered per arrangement and per part it hides, and before every change of mode, so that the split the user had is saved before a part move. - A remembered size that leaves the other parts less than their minimum, such as one stored by earlier builds, gives way to the default share. Co-authored-by: Copilot <[email protected]> * chat windows: the terminals keep the height the user gave them in every mode The terminals drifted taller across mode round trips (199 -> 286 -> 232 -> 265): - the title row took no room as soon as it hid, before the grid arranged the mode, and its room went to the terminals, which was then remembered; - the height remembered per arrangement won over the one the user last gave; - a rebuilt grid gave the room of a hidden title row to the terminals. The title row now shows and hides only with the grid, the user's last height applies in every mode, and the terminals take it once the cells show or hide. Co-authored-by: Copilot <[email protected]> * sessions: a chat view that disposes creates no title row Closing a chat window logged 'InstantiationService has been disposed': as the view disposed, its window changed, and the derived of its own title row ran again, creating a title bar part with the services the view had disposed. Co-authored-by: Copilot <[email protected]> * chat windows: the split and the terminals come back as they were after a restart A restored chat window shows without its terminals until they are restored: the arrangement without them had no sizes remembered, so the chat and the main part took their default shares, and the terminals, which join empty, showed at a size of their own. The sizes of the chat and the main part are also remembered for the arrangement without the terminals, and the terminals take their height when their first terminal shows. Pins QA's second INFO-2 walk through every mode. Co-authored-by: Copilot <[email protected]> * chat windows: a change of density restores the exact gaps and insets of the cards - The gap was not followed: read behind the grid, which did not exist yet as it was first read, so a change of density changed it only once the grid rebuilt. - The cards read the frames their insets leave room for as the gap changes, maybe before the styles of the new density apply: the grid lays out again on the next frame, so that a density round trip gives the cards their exact size back (QA: 476/714 -> 475/713 after compact and back). Co-authored-by: Copilot <[email protected]> * chat windows: the terminals keep the user's height when the chat changes size with the mode QA (Beta): terminals sized 199, then Stacked 286, Side by Side 286, Editor Only 72. While stacked the chat shows only its input, as tall as it exactly, and its size changes before the grid arranges the new mode: the row of the old mode was squeezed, the terminals took the room, and that was remembered as the height the user gave them; then, taller than their share, they gave way in Editor Only. - What shows is remembered as soon as what arranges it changes, before anything reacts to the change. - The main part takes the rest of a column or a row, not the chat, which may be only as tall as its input. Co-authored-by: Copilot <[email protected]> * sessions: read the app region of the title bar only where the browser computes it The browser runner of the Insider build failed the test of a click on a hosted session header: a headless browser may not compute -webkit-app-region, as Electron does. What a click reaches is still checked everywhere. Co-authored-by: Copilot <[email protected]> * chat windows: remember only the sizes the user gives the parts The window remembered the sizes its cells showed with as the mode changed, as it saved its state, or as it went: sizes the grid had forced, such as the least width of a chat part that holds an editor, or the terminals as a mode showed, came back as the user's (QA: terminals dragged to 199 came back 286, then 72; a forced 502/688 split stayed after the editor left the chat part). - Sizes are remembered only when the user drags or resets a sash: of the cells it changed, the terminals' height for every mode, the chat's and the main part's for the arrangement. - The terminals take the height the user last gave them, else their share of the window, in every mode. Co-authored-by: Copilot <[email protected]> * chat windows: the strip's entries act on the window they are in, at the first click The Session Activity Bar ran its entries without naming its window, so the chat window commands they run, such as Terminal, the tabs and the layout, acted on the window that has focus. A click in a chat window that does not have focus yet runs before it does: the first click acted on no window, or another, and only the second one on the window. In a window with layout modes the strip now runs its entries with the window it is in, and those commands act on the window named. Co-authored-by: Copilot <[email protected]> * sessions: a canvas opened from a chat window opens in that window While the active group was outside the main window, a canvas opened in the main part of the main window, as for a canvas opened from an auxiliary window. Opened from a chat window, which shows its own editors, it now opens in the main part of that chat window: in the group that has it already, else in the active group. Co-authored-by: Copilot <[email protected]> * chat pills: the dropdown of a pill shows in the window of the pill The dropdown of a pill, such as the References or Pull Requests pill of a chat, showed in the window that had focus. For a pill of a chat window that is not focused yet, that was another window: an entry picked there acted from that window, so a pull request opened in the main window. It now shows in the window of the pill. Co-authored-by: Copilot <[email protected]> * chat windows: sizes stored by earlier builds are not read Earlier builds stored the sizes the parts showed with, including those the window forced them to, such as terminals squeezed to 123: they came back as the user's. The sizes the user gives the parts are now stored under a key of their own, and those of the old key are removed, so that the parts take their defaults once. Co-authored-by: Copilot <[email protected]> * sessions: no agent feedback overlay on the chat of a chat window The navigation of the session's feedback (1/4) showed over the chat input of a chat window: in a window that shows a session of its own, every resource maps to that session, also that of the chat, a view shown as an editor. An editor that shows no file, such as a view, has no feedback overlay, as the chat of the main window has none. Co-authored-by: Copilot <[email protected]> * sessions: opening a chat in a window keeps the main window's side pane The editors of the main window moving to the chat window emptied its editor part, which the Agents layout took for the user closing them, and closed the side pane: it stayed closed for every session the main window showed next, until the chat window closed. While they move, the editor part's automatic visibility is suppressed, as it is when the main window switches sessions. Co-authored-by: Copilot <[email protected]> * sessions: type the editor part of the side pane test of chat windows Co-authored-by: Copilot <[email protected]> * sessions: a title row of a chat window gives up the traffic-light inset in full screen A title bar followed the full screen state of the window it was created in: the title rows of a chat window, created before they are in it, followed the main window, and kept the room of the traffic lights while the chat window was in full screen. It now follows the window it is in, as it moves there and as it is laid out. Co-authored-by: Copilot <[email protected]> * canvases: a chat window shows the canvases of its own chat Opening a canvas in a chat window failed: a canvas editor, and moving a canvas, accepted only groups of the main window. A canvas context service may now present canvases of an owner in groups outside the main window, and keep them presented outside the main window's working sets; the Agents one does so for a chat window and the chat it shows. Other windows keep the main-window-only rule. Co-authored-by: Copilot <[email protected]> * sessions: the Changes editor of a chat window shows the changed files list The changed files list of the Changes editor shows where its host enables it: a chat window enables it on its context, which all its parts inherit, so its Changes editor shows the list wherever it shows; the main window does not. Co-authored-by: Copilot <[email protected]> * chat windows: the tab rows at the top of a chat window move the window In a chat window, the empty space of the tab row of a part at the top of the window moves the window, as the window's title row does: its tabs, actions and other controls keep their clicks and drags, and while something is dragged the row takes the drop. The part grid marks the cells at its top edge, and the groups at the top of their parts there, as the parts move, split, show and hide. Co-authored-by: Copilot <[email protected]> * chat windows: Developer: Reset Chat Window Layout Lays out the chat window it runs in as it first opens: it forgets the layout and sizes remembered for its chat, the sizes the user gave its parts and the parts moved in it, and shows only the chat while its main part has no editors, else the chat and the editor side by side at their default shares. Other chat windows and the main window keep theirs. Co-authored-by: Copilot <[email protected]> * chat windows: Reset Chat Window Layout also puts the terminals across the window Where the terminals of a chat window show is part of its layout: the reset shows them across the window, as chat windows do until the user chooses, without changing where those of other chat windows show. Co-authored-by: Copilot <[email protected]> * chat windows: a layout command moves the chat back into the chat part first A chat dropped onto the middle of another part of its window shows as a tab of that part, and its chat part hides as empty. A layout command shows the parts of the window as the chat part showing the chat: it moves the chat's editor back into the chat part first, so that the chat never hides with the part it is in. The main part showing as an editor opens in it moves nothing. Co-authored-by: Copilot <[email protected]> * sessions: the Changes editor of a chat window shows its actions in the header row too The main part of a chat window takes the header row's secondary menu of the main window's editor area, where the Changes editor shows Run Code Review, its More Actions and Toggle Files, as the main window does. Co-authored-by: Copilot <[email protected]> * chat windows: the chat's editor merged into another part still closes or moves the window out Co-authored-by: Copilot <[email protected]> * fixup! chat windows: the tab rows at the top of a chat window move the window A double-click on the empty space of a tab row at the top edge of a chat window does what one on the title bar does (restores INativeHostService.handleTitleDoubleClick) instead of opening an untitled editor. Co-authored-by: Copilot <[email protected]> * fixup! canvases: a chat window shows the canvases of its own chat The owner of a canvas a chat window shows is visible and has a context whichever window has focus; the main window's canvases follow the main window's session rather than the focused window's. Co-authored-by: Copilot <[email protected]> * integration: stub the session scope, chat resource and layout service in main's newer tests Co-authored-by: Copilot <[email protected]> * fixup! sessions: a title row of a chat window gives up the traffic-light inset in full screen An auxiliary window in full screen below the camera notch of its display is less tall than its screen: it counts as full screen while it spans the width of its screen. Co-authored-by: Copilot <[email protected]> * fixup! chat windows: the main window's padding, the window controls in the title row The tab row at the top right of a chat window keeps the room of the window controls that float above it beside the chat's own title (Windows, Linux), by new generic part grid markers for the right edge. Co-authored-by: Copilot <[email protected]> * fixup! sessions: the terminal commands of chat windows The side panel's command toggles the editor of the chat window it runs in, whatever key the user binds to it, instead of a separate command with a copy of its default key. Co-authored-by: Copilot <[email protected]> * fixup! sessions: the chat of a session as a view editor The suggest widget of a chat input shows in the window of the chat. A chat can render before it is attached, such as the chat of a chat window, whose view editor creates its view before attaching it. Its input's overflow widgets element then went into the main window's container, so the completions of /, @ and # showed in the main window instead of the chat window. The element now moves into the container of the window that the chat lays out in. Co-authored-by: Copilot <[email protected]> * fixup! sessions: the terminal commands of chat windows Type the context of the side panel's keybinding test. Co-authored-by: Copilot <[email protected]> * fixup! sessions: the chat of a session as a view editor The session state indicator of a chat updates as the window that the chat shows in loses focus, rather than the window it rendered in, which for the chat of a chat window is the main window. Co-authored-by: Copilot <[email protected]> * fixup! sessions: the terminal commands of chat windows A terminal in a window with layout modes, such as a chat window, does not offer to move into the panel, which is the main window's: the window keeps its terminals in a part of its own. Co-authored-by: Copilot…
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.


Adds chat windows to the Agents window, behind the
sessions.chatWindows.enabledsetting (off by default).A chat window is an auxiliary window that shows one chat of a session beside an editor area of its own. Its own grid lays out the chat, the editor area, the session's terminals and the Session Activity Bar column, in four modes: Chat Only, Editor Only, Stacked and Side by Side. Open a chat in a window from the sessions list, the session header's More Actions, or the Open Chat in New Window command. Each chat has at most one window, and a chat window can't start new chats.
The session header is the window's top row, in its title bar. The title bar keeps Run, Open in Editor, the session actions and the Layout menu. Every action in a chat window acts on that window and its session, not on whichever session is active. Windows, their layout, cell sizes and editor-area editors are restored after a restart. A window restored in Editor Only whose editors can't be restored, such as a canvas, shows its chat instead, as when its last editor closes, and keeps Editor Only as its remembered mode.
Setting gating
sessions.chatWindows.enabledoff, the main window is unchanged: no chat-window commands, menus, Add Tab entries, Session Activity Bar entries, title bar elements or keybindings, and the active session, layout, title bar and Changes view behave as before. Tests cover the main window's title bar DOM, its session header, and its active session and layout with no other window.Depends on
This PR is stacked on infrastructure that ships on its own, with no user-visible change. Merge those first:
createEditorPart).computeSessionGridLayout).sessionLayoutButtons.ts) and stacked input-only rules (common/stackedChatInputOnly.ts). It's stacked on sessions: a pure session grid layout model #345075.SessionsChatSurface) and the card surface (.agents-card-surface) shared beyond the Sessions part, so chat windows render the main window's wallpaper, cards and frames.The base is #345077's branch. Until #345074, #345076 and #345561 merge, this branch also carries their commits unchanged (the first seven commits); they drop out on rebase. The diff of this PR's own commits is the 9 commits below.
Commits
ISessionScope) instead of the globally active session: each chat window shows its own session's, and the main window keeps its session's while a chat window has focus.Validation
On main ae15303, head babd382, stacked on #345074–#345077 and #345561 rebased onto the same main. Every commit was type-checked; the sessions, chat and workbench rows below are from the head, and the other rows are from earlier heads on 8078df0:
npm run typecheck-clientnpm run valid-layers-checkeslint --max-warnings 0on the changed.tsfiles./scripts/test.sh --runGlob 'vs/sessions/**/*.test.js'./scripts/test.sh --runGlob 'vs/workbench/services/**/*.test.js'and'vs/workbench/test/**/*.test.js'node test/unit/browser/index.js --browser chromium --runGlob 'vs/sessions/**/*.test.js'./scripts/test.sh --runGlob 'vs/workbench/test/browser/parts/editor/**/*.test.js'and'vs/workbench/services/editor/test/browser/**/*.test.js'node test/unit/browser/index.js --browser chromium --runGlobwith the same two globs./scripts/test.sh --runGlob 'vs/workbench/contrib/chat/**/*.test.js'./scripts/test.sh --runGlob 'vs/workbench/contrib/chat/test/browser/**/*.test.js'node test/unit/browser/index.js --browser chromium --runGlob 'vs/workbench/contrib/chat/test/browser/**/*.test.js'./scripts/test.sh --runGlob 'vs/workbench/contrib/terminal/**/*.test.js'node test/unit/browser/index.js --browser chromium --runGlob 'vs/workbench/contrib/terminal/**/*.test.js'Every commit was also type-checked on its own, and earlier built and run against the sessions and editor suites; the tests added since run at the commit they belong to. Each fixed defect has a test that fails without its fix.
Live checks ran on Code - OSS in the background, with an isolated profile and agent home:
…last, expanded and while the chat shows only its input;…is centered above the Session Activity Bar's column;Known gaps