Repository navigation
sessions: focus by number, reveal clipped sessions, close all - #319335
Merged
Sandeep Somavarapu (sandy081) merged 1 commit intoJun 1, 2026
Merged
Conversation
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Ladislau Szomoru (@lszomoru)Matched files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds editor-like keyboard ergonomics to the Agents/sessions grid (focus-by-number, close-all) and improves usability by ensuring newly focused sessions are scrolled into view. It also introduces a management-layer background send option to keep the UI on the new-session view while starting a session.
Changes:
- Adds
Cmd/Ctrl+1..9actions to focus sessions by position in the sessions grid. - Reveals partially clipped session views when focusing (via
scrollIntoView) and wiressessionsFocusto actual focus state. - Introduces
sessions.closeAllSessions(withCmd/Ctrl+K Cmd/Ctrl+Wwhen a session has focus) and addscloseAllSessions()to the sessions management service API.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/services/sessions/test/browser/sessionNavigation.test.ts | Updates mock service surface to include closeAllSessions(). |
| src/vs/sessions/services/sessions/common/sessionsManagement.ts | Introduces management-layer ISendRequestOptions (incl. background) and adds closeAllSessions() to the service interface. |
| src/vs/sessions/services/sessions/browser/sessionsManagementService.ts | Implements background send flow and closeAllSessions() in the concrete management service. |
| src/vs/sessions/contrib/sessions/browser/sessionsActions.ts | Registers focus-by-number actions and the new “Close All Sessions” command + keybinding. |
| src/vs/sessions/browser/parts/sessionsPartService.ts | Routes focus requests through SessionsPart.focusSession(...) (now reveals before focusing). |
| src/vs/sessions/browser/parts/sessionsPart.ts | Tracks focus to drive sessionsFocus and reveals clipped session views before focusing. |
Copilot's findings
Comments suppressed due to low confidence (4)
src/vs/sessions/services/sessions/browser/sessionsManagementService.ts:533
ISendRequestOptionsextends provider options with management-only fields (background). Even in the non-background path, forwarding the full object means management-only fields (e.g.background: false) can leak to providers. Strip management-only fields before calling the provider APIs here as well.
// Ask the provider to create the new chat; open its widget before sending
const chat = await provider.createNewChat(session.sessionId, options.query);
// Swap in a transient session whose resource is the new chat
// resource, so the grid slot reflects the chat that is about to
// be sent before the provider hands us the final session.
src/vs/sessions/services/sessions/browser/sessionsManagementService.ts:566
ISendRequestOptionsnow includes management-only fields likebackground, butsendRequestforwards the full object to the provider. Strip management-only fields before passing options through toprovider.sendRequest(...).
// Keep the sent chat as the active chat.
this._visibility.setActiveChat(session, chat);
const provider = this._getProvider(session);
if (!provider) {
throw new Error(`Sessions provider '${session.providerId}' not found`);
}
const updatedSession = await provider.sendRequest(session.sessionId, chat.resource, options);
src/vs/sessions/services/sessions/browser/sessionsManagementService.ts:533
ISendRequestOptionsextends provider options with management-only fields (background). Even in the non-background path, forwarding the full object means management-only fields (e.g.background: false) can leak to providers. Strip management-only fields before calling the provider APIs here as well.
// Ask the provider to create the new chat; open its widget before sending
const chat = await provider.createNewChat(session.sessionId, options.query);
// Swap in a transient session whose resource is the new chat
// resource, so the grid slot reflects the chat that is about to
// be sent before the provider hands us the final session.
src/vs/sessions/services/sessions/browser/sessionsManagementService.ts:566
ISendRequestOptionsnow includes management-only fields likebackground, butsendRequestforwards the full object to the provider. Strip management-only fields before passing options through toprovider.sendRequest(...).
// Keep the sent chat as the active chat.
this._visibility.setActiveChat(session, chat);
const provider = this._getProvider(session);
if (!provider) {
throw new Error(`Sessions provider '${session.providerId}' not found`);
}
const updatedSession = await provider.sendRequest(session.sessionId, chat.resource, options);
- Files reviewed: 6/6 changed files
- Comments generated: 5
Add keyboard navigation and bulk-close actions to the sessions grid: - Cmd/Ctrl+1..9 focus the Nth visible session in the grid, scrolling it fully into view when it is clipped by the grid's horizontal overflow. - Route focusSession through the part so revealing happens for all focus flows (focus active session, close session, etc.). - Add a "Close All Sessions" command (Cmd/Ctrl+K Cmd/Ctrl+W, matching "Close All Editors"), keyboard-gated on session focus via a now-functional sessionsFocus context key. Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
force-pushed
the
sessions/focus-reveal-close-all
branch
from
June 1, 2026 14:16
91d47ab to
3b3e246
Compare
Benjamin Christopher Simmonds (benibenj)
approved these changes
Jun 1, 2026
This was referenced Jun 2, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What
Adds keyboard navigation and bulk close support to the Agents/sessions grid:
Cmd/Ctrl+1..Cmd/Ctrl+9focus the Nth session in the grid (left-to-right order). Each is also available in the Command Palette.scrollIntoView.sessions.closeAllSessionscommand bound toCmd/Ctrl+K Cmd/Ctrl+W(same chord as Close All Editors). The keybinding only fires while a session is focused; the command remains visible in the Command Palette.Why
These bring familiar editor-style keyboard ergonomics (focus-by-number, close-all) to the sessions window and fix a usability issue where focusing an off-screen session left it clipped.
Notes for reviewers
SessionsFocusContext(sessionsFocus) was previously bound but never updated. It is now driven by atrackFocuson the content area.precondition/action.enabled. Opening the palette moves focus out of the sessions window, flippingsessionsFocusto false. So the focus requirement is on the keybindingwhenclause (evaluated at keypress, while focus is still in the session), not theprecondition. The precondition isIsSessionsWindowContextonly, keeping the command visible in the palette.Co-authored-by: Copilot [email protected]