Repository navigation
sessions: close side pane on last tab close when multiple chats are shown - #342117
Merged
Sandeep Somavarapu (sandy081) merged 5 commits intoOct 16, 2026
Merged
Sandeep Somavarapu (sandy081) merged 5 commits into
Sandeep Somavarapu (sandy081) merged 5 commits into
Conversation
…hown Closing the last editor tab while several chats of the same session are shown in the per-chat layout left an empty side pane open. The last-editor-close guards only need to defer to another visible session, since chats of the same session share its main editor part. Co-authored-by: Copilot <[email protected]>
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Benjamin Christopher Simmonds (@benibenj)Matched files:
|
Federico Brancasi (federicobrancasi)
previously approved these changes
Oct 16, 2026
Contributor
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Both guards regress last-editor closure when another session remains mounted but hidden by maximization.
1 open finding
What changed in this PR
Fixes empty side panes remaining open after the last editor closes when multiple chats share a session in the Agents window.
Changes:
- Switches both last-editor-close guards to session counts.
- Adds Existing Session and Quick Chat regression tests.
| File | Description |
|---|---|
src/vs/sessions/contrib/layout/test/browser/desktopStrategies.test.ts |
Tests pane closure with multiple chats shown. |
src/vs/sessions/contrib/layout/browser/desktop/desktopExistingSessionStrategy.ts |
Updates the Existing Session close guard. |
src/vs/sessions/contrib/layout/browser/desktop/desktopDraftSessionStrategy.ts |
Updates the draft and Quick Chat close guard. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
In the per-chat layout a maximized chat can leave other sessions mounted but not shown; only block the last-editor close when another session's chat is actually shown. Co-authored-by: Copilot <[email protected]>
Federico Brancasi (federicobrancasi)
previously approved these changes
Oct 16, 2026
Justin Chen (justschen)
previously approved these changes
Oct 16, 2026
Justin Chen (justschen)
left a comment
Collaborator
There was a problem hiding this comment.
thanks!
…t-investigation-chat-mode-issue
Fixes TS1117 after #341455 and #342128 both added the same shorthand property to the test fixture. Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
dismissed stale reviews from Federico Brancasi (federicobrancasi) and Justin Chen (justschen)
via
October 16, 2026 22:04
b66d530
Fixes the duplicate-import lint error after #341455 and #342128 both imported from the same module. Co-authored-by: Copilot <[email protected]>
Aaron Munger (amunger)
approved these changes
Oct 16, 2026
Sandeep Somavarapu (sandy081)
deleted the
sandy081/agents/report-investigation-chat-mode-issue
branch
October 16, 2026 22:48
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.

In the Agents window with the per-chat layout (
sessions.experimental.layoutScope: "chat"), closing the last editor tab while more than one chat of the same session is shown (for example a split chat group, or a subagent chat next to the main chat) left the side pane open with only the empty group's Add Tab actions. You then had to press Close Editor Area separately.This regressed in #341141. That PR switched the last-editor-close guards from "multiple sessions visible" to
_multipleLayoutOwnersVisible(), which in thechatscope means "multiple chats shown". Chats of the same session share that session's main editor part, so a second chat of the same session has no reason to keep an empty side pane open.Change: both last-editor-close guards (
DesktopExistingSessionStrategy._registerEmptyGroupCloseandDesktopDraftSessionStrategy._registerLastEditorClose) checkmultipleSessionsVisibleObsagain. The per-chat ownership introduced in #341141 is unchanged everywhere else (restore, capture, detail sync). Keeping the side pane open when several sessions are visible stays intentional and is still covered by the existing test.How to test
"sessions.experimental.layoutScope": "chat"and reload the Agents window.Ctrl+Shift+G) and close the Changes tab.Validation
./scripts/test.sh --run src/vs/sessions/contrib/layout/test/browser/desktopStrategies.test.ts --run src/vs/sessions/contrib/layout/test/browser/desktopLayoutController.test.ts --run src/vs/sessions/contrib/layout/test/browser/chatLayoutOwnership.test.ts: 235 passing. The new Existing Session multi-chat test failed before the fix and passes after it.npm run typecheck-client: passed.npm run eslintand hygiene on the changed files: passed.