Repository navigation
Chat windows follow-ups: proportional resize, keyboard shortcuts, and drag-out/close fixes - #346039
Merged
Sandeep Somavarapu (sandy081) merged 14 commits intoNov 4, 2026
Merged
Conversation
Resizing a chat window, such as to full screen, gave all the change to the last part of each row and column: PartGrid laid its grid out without proportional layout. Now parts keep their shares of the grid; views that are not parts, such as the title row and the strip, keep their sizes. - PartGrid lays its grid out proportionally; a cell is proportional only while it holds a part. - A part can keep its size (IPartGridPartOptions.keepsSize), as the terminals of a chat window do. PartGrid gives it its size back after each layout, and the parts beside it make room in proportion to their sizes. Opting it out of proportional layout would also keep the size of the row or column around it. - SplitView keeps a view that keeps its size within its bounds in proportional layout, such as a title row restored at a third of the grid. - Grid.resizeView and PartGrid.resizeCell resize one dimension when given only that, so that keeping the terminals' height does not save the shares of the parts beside them again, rounded. Co-authored-by: Copilot <[email protected]>
…expected in chat windows The Changes, Files, Browser and Search Add Tab commands now also apply in a chat window. There they open their tab in the window's main part, for the window's session, through the window's own commands, so default and user keybindings to them work in chat windows. Their menu entries stay in the main window. F5 Run now applies in chat windows, where the Run button shows. Cmd+B no longer toggles the main window's side bar from a chat window. Co-authored-by: Copilot <[email protected]>
Each layout of a grid with a part that keeps its size, such as a chat window's terminals, ended by resizing the parts beside it from their rounded sizes, which the split view then saved as their proportions again. While a window was dragged, the main part and the chat drifted a pixel here and there. Now they take the unrounded shares they had, remembered as long as nothing else resized them, such as a sash or the grid arranged again, rounded by where they end. Each resize reads the line again, as the ones before it change it. The preview of where a part goes lays its grid out proportionally too, as the grid does. Co-authored-by: Copilot <[email protected]>
…indow Address review: an Add Tab command delegates to a chat window only when it runs there. Its menu entries name where they run: by their editor group (now also for empty groups) or by their window (the Session Activity Bar now names its window in the main window too). Without arguments, as from a keybinding or the Command Palette, it acts on the chat window that has focus. A click in the main window while a chat window still has focus therefore stays in the main window. Toggle Side Bar now also has a precondition, so the Command Palette cannot toggle the main window's side bar from a chat window. Co-authored-by: Copilot <[email protected]>
…t has focus Arguments that name neither an editor group nor a window, such as those of a keybinding in keybindings.json, no longer prevent an Add Tab command from acting on the chat window that has focus. Co-authored-by: Copilot <[email protected]>
…window everywhere The empty-group Add Tab fixtures pass the group id the Add Tab entries now run with. The Session Activity Bar test expects the main window's entries to run with their window too, as they now do, so that they never act on a chat window that has focus. Co-authored-by: Copilot <[email protected]>
…rt, no duplicate dirty editors F1: the chat moving into another window opened it again without the tabs beside it: the chat part was captured after the chat left its group. The window remembers the group the chat left and captures the part with the chat back in that group. F2: closing checked only the main part and the chat part for editors that cannot move; those of parts the window created for drops could veto after the rest had closed. It checks every group of the window, but the terminals'. F3: editors that ask before they close, such as dirty ones, were both serialized and merged into the main window by the close: they are left to the close. Co-authored-by: Copilot <[email protected]>
- G1: capture the chat part as the chat is about to leave its group, so the groups split beside it survive when its group goes away on drag-out. - G2: a non-terminal editor in the Terminals part that cannot move to the main window keeps the window open; only terminals are skipped. - G3: when the window cannot close, the chat that moved out goes back into its group instead of leaving a window without a chat. - Residual: with a dirty editor beside the chat, the captured chat part is not reopened (it would show that editor twice); its other editors open in the main part. Co-authored-by: Copilot <[email protected]>
- H1: when the chat's group moves to another window, the group closes the chat instead of moving it. If the chat is still open in another window, treat it as a move-out (or bounce it back on a veto) instead of closing the window. - H2: the chat part captured as the chat left is used only while the chat is out of the window, not after it moved into another part of it. - H3: a vetoed move-out shows why, as a vetoed editor move does. Co-authored-by: Copilot <[email protected]>
…close says why - Whether the chat is still open in a group of another window counts only its own editor, not one that merely matches it. - Closing a chat window that cannot close, such as for an editor that cannot move to the main window, says why, as the chat moving out of the window does. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved regressions lose tabs and splits when moving chats, open Search in the wrong part, reuse browser tabs instead of creating new ones, and break proportional layout resizing.
5 open issues
What changed in this PR
This PR follows up on the Agents window’s chat-window implementation, improving resize behavior, command routing, and moving or closing chats across windows.
Changes:
- Adds proportional part resizing while preserving chrome and terminal sizes.
- Enables chat-window keyboard shortcuts and routes menu actions using their originating group or window.
- Updates chat-part restoration, close-veto handling, and dirty-editor preservation, with regression tests.
| File | Description |
|---|---|
src/vs/workbench/test/browser/parts/partGrid/partGrid.test.ts |
Tests proportional resizing and updates drag-preview expectations. |
src/vs/workbench/contrib/chatWindow/test/browser/chatWindowMoveEditors.test.ts |
Tests avoiding duplicate dirty editors during reopening. |
src/vs/workbench/contrib/chatWindow/test/browser/chatWindowGrid.test.ts |
Tests resize round trips and fixed terminal height. |
src/vs/workbench/contrib/chatWindow/test/browser/chatWindow.test.ts |
Tests chat moves, state capture, close vetoes, and editor identity. |
src/vs/workbench/contrib/chatWindow/browser/chatWindowService.ts |
Adds move-state capture, window-wide veto checks, and veto messages. |
src/vs/workbench/contrib/chatWindow/browser/chatWindowLayoutActions.ts |
Separates explicit command-context resolution from focus fallback. |
src/vs/workbench/contrib/chatWindow/browser/chatWindowGrid.ts |
Uses fixed-size terminal options and height-only resizing. |
src/vs/workbench/contrib/chatWindow/browser/chatWindowEditors.ts |
Excludes confirmation-requiring editors from serialized transfers. |
src/vs/workbench/browser/parts/partGrid/partGrid.ts |
Adds proportional layout and fixed-size part restoration. |
src/vs/sessions/test/browser/sessionActivityBar.test.ts |
Verifies activity-bar actions receive window context. |
src/vs/sessions/test/browser/emptyEditorGroupAddTab.test.ts |
Supplies group identity to the Add Tab test. |
src/vs/sessions/test/browser/emptyEditorGroupAddTab.fixture.ts |
Supplies group identity to the Add Tab fixture. |
src/vs/sessions/test/browser/desktopEditorPart.test.ts |
Updates the empty-group stub with an identifier. |
src/vs/sessions/contrib/layout/test/browser/layoutControllerTestUtils.ts |
Stubs chat-window focus for main-window tests. |
src/vs/sessions/contrib/editor/test/browser/editor.contribution.test.ts |
Updates action tests for chat-window service dependencies. |
src/vs/sessions/contrib/editor/browser/addTabActions.ts |
Enables and routes Add Tab commands in chat windows. |
src/vs/sessions/contrib/chatWindow/test/browser/chatWindowContribution.test.ts |
Tests shortcut availability and context-based command routing. |
src/vs/sessions/contrib/chatWindow/browser/chatWindowActions.ts |
Reuses shared command identifiers and workspace conditions. |
src/vs/sessions/contrib/chat/browser/runScriptAction.ts |
Enables F5 in chat windows. |
src/vs/sessions/common/sessionCommands.ts |
Defines shared chat-window tab command identifiers. |
src/vs/sessions/common/contextkeys.ts |
Shares the session-with-workspace condition. |
src/vs/sessions/browser/parts/sessionActivityBar.ts |
Passes the originating window to activity-bar actions. |
src/vs/sessions/browser/parts/emptyEditorGroupAddTab.ts |
Passes group context through Add Tab controls and submenus. |
src/vs/sessions/browser/layoutActions.ts |
Disables Toggle Side Bar in chat windows. |
src/vs/base/test/browser/ui/splitview/splitview.test.ts |
Tests bounds clamping for fixed-size views. |
src/vs/base/browser/ui/splitview/splitview.ts |
Clamps non-proportional views to their size bounds. |
src/vs/base/browser/ui/grid/grid.ts |
Allows resizing a single dimension. |
Review effort: Balanced
Alex Ross (alexr00)
previously approved these changes
Nov 4, 2026
A group fires onWillCloseEditor once the editor already left its model, so the chat part captured then had no chat and the tabs and splits beside it were lost as the chat moved to another window. Capture on the first onWillMoveEditor of a move out of the chat's group, also as its group merges into another one editor at a time, and on a new IContentPart.onWillMoveGroupOut as the group moves to another part, which copies it there and force closes its editors here. The test group follows the real order of close events. Co-authored-by: Copilot <[email protected]>
…t as in the main window Add Browser Tab always opens a new pinned browser tab, rather than the activity bar entry's reuse of an existing one as a preview. Search opens by the scoped services of the main part, as activating its group does not make it the active part while another part has focus. Co-authored-by: Copilot <[email protected]>
…eps its share keepSizes resized the others in a line by an immediate view of each, which a row or column of rows or columns only does not have, so its resize was skipped. Resize the nodes by their location in the grid instead. Co-authored-by: Copilot <[email protected]>
Dirk Bäumer (dbaeumer)
previously approved these changes
Nov 4, 2026
…rtional sizing of its row Co-authored-by: Copilot <[email protected]>
Ross Wollman (rwoll)
approved these changes
Nov 4, 2026
Sandeep Somavarapu (sandy081)
deleted the
agents/chat-windows-followups
branch
November 4, 2026 18:50
This was referenced Nov 4, 2026
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Nov 11, 2026
…+Shift+G in the chat window that has focus (#347613) * Agents window: keep Cmd/Ctrl+B and Cmd/Ctrl+O in the chat window that has focus In a chat window, Cmd/Ctrl+B toggled the main window's side bar and Cmd/Ctrl+O (New Session in Folder...) started the new session in the main window. - Cmd/Ctrl+B: #346039 made the Agents window's Toggle Side Bar not apply in chat windows, but VS Code's generic Toggle Primary Side Bar Visibility, also loaded in the Agents window, still claimed the key there and toggled the main layout. It no longer applies in windows with layout modes either, so the key does nothing in a chat window, which has no side bar of its own. - Cmd/Ctrl+O: the command now resolves the chat window it runs in and opens the new session there as Cmd/Ctrl+N does, aimed at the picked folder, through a new provider-neutral `folder` option of IChatWindowService.openNewChat. An unsent new session that is active there is aimed at the folder instead. The main window is unchanged. Fixes #347106 Co-authored-by: Copilot <[email protected]> * Agents window: open a new composer for a folder picked in a chat window New Session in Folder in a chat window re-aimed an unsent active composer by changing only what it requested, which its mounted composer does not follow: it kept its draft in the previous folder. A picked folder now always opens a new composer, which creates its draft through the composer's own path, including its trust gate. It replaces the active composer when closing it loses nothing (no input and no request under way); otherwise it opens as a tab of it. The composer also starts with the session type of the provider that resolved the folder, so that this provider creates its draft, as a new session in a folder of a provider starts in the main window. Co-authored-by: Copilot <[email protected]> * Agents window: keep a composer that changed while a folder's composer opened A composer that New Session in Folder replaces in a chat window was checked for losing nothing only before the new composer opened, which is awaited: input typed into it, or a request it sent, meanwhile was lost as it closed. It is now checked again before it closes. A composer opened for a folder from a composer that has not sent its session also joins the custom group of the sessions list that composer's sessions join; its draft is not in a group yet. Co-authored-by: Copilot <[email protected]> * Agents window: keep Cmd/Ctrl+Shift+E and Ctrl+Shift+G in a chat window with a new session In a chat window whose active chat is a new-session composer, Cmd/Ctrl+Shift+E opened the Files view in the main window's auxiliary bar rather than a Files tab in the chat window; Changes did the same. - The keys of a host's session took the workspace of the chat it shows only, so while a composer shows no chat yet, its session counted as one without a workspace, although its draft has a folder, and the chat window's Files and Changes keys did not apply. The workspace is now the session's while the host shows no chat of it. - Where those keys did not apply, the open commands of the Files and Changes view containers claimed them and opened the main window's auxiliary bar. The keys of a view container's open command no longer apply in a window with layout modes, whose parts are not the main window's. Their commands, as in the Command Palette, are unchanged. Fixes #347106 Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
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.

Follow-ups to #345683 for the chat windows of the Agents window (
sessions.chatWindows.enabled). Regular VS Code layouts are unchanged; the only shared changes are a clamp inSplitView's proportional layout andGrid.resizeViewaccepting a single dimension, whichGridView.resizeViewalready did.Proportional resize
Resizing a chat window, for example to full screen, used to give all of the change to the last part of each row and column, because
PartGridlaid out its grid without proportional layout.IPartGridPartOptions.keepsSize.PartGridgives it its size back after each layout, and the parts beside it make room in proportion, from unrounded shares, so dragging a window out and back returns the exact sizes.SplitViewclamps a view that keeps its size to its bounds in proportional layout, for example a title row restored at a larger size.Keyboard shortcuts in chat windows
Drag-out and close fixes
Validation
On the final commit (8d42d30): typecheck, the chat window, chatWindowMoveEditors and sessions terminal suites, and ESLint on the changed files. The last two commits change only
chatWindowService.tsand its tests; the other suites below ran on the commit before them (52bbaa6), with the same base.corepack pnpm run build-fast --client-only: passedcorepack pnpm run typecheck-client: passed./scripts/test.sh --runGlob <suite>:**/parts/partGrid/*.test.js: 62 passing**/chatWindow/**/*.test.js(workbench and sessions): 197 passing**/chatWindow/test/browser/chatWindowMoveEditors.test.js: 6 passing**/browser/parts/editor/*.test.js: 375 passing**/services/editor/test/browser/*.test.js: 286 passing**/ui/splitview/*.test.js: 29 passing**/ui/grid/*.test.js: 73 passing**/sessions/contrib/terminal/**/*.test.js: 151 passing**/sessions/contrib/editor/test/browser/editor.contribution.test.js: 45 passing**/sessions/contrib/layout/test/browser/desktopLayoutController.test.js: 138 passing**/sessions/test/browser/sessionActivityBar.test.js: 21 passing**/sessions/test/browser/desktopEditorPart.test.js: 8 passing**/sessions/test/browser/emptyEditorGroupAddTab.test.js: 2 passingnode test/unit/browser/index.js --browser chromium --run <file>:src/vs/workbench/test/browser/parts/partGrid/partGrid.test.ts: 61 passingsrc/vs/workbench/services/editor/test/browser/viewEditor.test.ts: 16 passingsrc/vs/sessions/contrib/chatWindow/test/browser/sessionChatViewEditor.test.ts: 11 passingcorepack pnpm run eslint <changed files>: cleanNew tests cover resizing a chat window out and back in uneven steps in Stacked, so the parts return to their exact sizes. They also cover the Add Tab delegation from keys and menu entries, and the drag-out and close cases above.