Skip to content

sessions: make session navigation work when editor part is open but unfocused#320005

Merged
sandy081 merged 1 commit into
mainfrom
sandy081/sessions-nav-editor-area-focus
Jun 4, 2026
Merged

sessions: make session navigation work when editor part is open but unfocused#320005
sandy081 merged 1 commit into
mainfrom
sandy081/sessions-nav-editor-area-focus

Conversation

@sandy081
Copy link
Copy Markdown
Member

@sandy081 sandy081 commented Jun 4, 2026

What

The session navigation keybindings — Go Back (Ctrl+Shift+Tab) and Go Forward (Ctrl+Tab) — in the Agents window were gated on EditorContextKeys.editorTextFocus.toNegated(). This switches the gate to EditorAreaFocusContext.toNegated().

Why

editorTextFocus evaluates such that the navigation chords were suppressed even when the editor part is open but does not have keyboard focus. As a result, Ctrl+Shift+Tab / Ctrl+Tab did not navigate between sessions whenever an editor was open.

EditorAreaFocusContext is true only when keyboard focus is genuinely within the editor area (any editor part). Negating it means session navigation works whenever focus is outside the editor area — including when an editor is open but unfocused — while still deferring to the editor's own Ctrl+Tab quick-open when the editor area is actually focused.

Notes for reviewers

  • Only the when clauses of the two navigation actions change; weights and key chords are untouched.
  • EditorAreaFocusContext is bound in editorPart.ts for all editor parts (main, modal, auxiliary).

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

The Go Back (Ctrl+Shift+Tab) and Go Forward (Ctrl+Tab) session navigation
keybindings were gated on EditorContextKeys.editorTextFocus.toNegated(),
which also suppressed them in cases where the editor part is open but not
focused. Switch to EditorAreaFocusContext.toNegated() so the chords work
whenever keyboard focus is outside the editor area, and only defer to the
editor's Ctrl+Tab quick-open when the editor area actually has focus.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes session navigation keybindings in the Agents window so Go Back (Ctrl+Shift+Tab) and Go Forward (Ctrl+Tab) continue to work when an editor is open but does not have focus, while still deferring to the editor’s own Ctrl+Tab behavior when the editor area is actually focused.

Changes:

  • Switches the keybinding when gate from EditorContextKeys.editorTextFocus to EditorAreaFocusContext.
  • Keeps existing keybinding weights and chords unchanged to preserve precedence behavior.
Show a summary per file
File Description
src/vs/sessions/contrib/sessions/browser/sessionsActions.ts Updates Go Back / Go Forward keybinding when clauses to use EditorAreaFocusContext negation so session navigation works when focus is outside the editor area (even if an editor is open).

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@sandy081 sandy081 enabled auto-merge (squash) June 4, 2026 21:10
@sandy081 sandy081 merged commit 78414eb into main Jun 4, 2026
62 of 64 checks passed
@sandy081 sandy081 deleted the sandy081/sessions-nav-editor-area-focus branch June 4, 2026 21:36
@vs-code-engineering vs-code-engineering Bot added this to the 1.124.0 milestone Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants