Repository navigation
feat(app): cycle side-panel tabs when side panel is focused - #54899
Conversation
There was a problem hiding this comment.
Looks good. I ran the new e2e test on the base branch, where it fails as described: with focus in the side panel, Control+Tab switches to the other session. With this PR it passes, along with the rest of tabs.spec.ts and side-panels.spec.ts (19 tests). command.test.ts and the packages/app type check also pass.
The new commands follow the existing file.close pattern. They're registered only when the panel is open with more than one tab, and they only fire while focus is in #review-panel outside extension-scoped subtrees. Everywhere else, the session-level tab.prev/tab.next commands still handle these shortcuts.
Public API is unchanged (app-internal commands only; they reuse the existing tab.prev/tab.next keybind settings).
Why
Pressing the tab-cycling shortcuts (
⌃Tab/⌃⇧Tab,⌘⌥←/⌘⌥→) while keyboard focus is inside the right side panel (#review-panel) always switches the top-level session tab instead of cycling the open side-panel tabs. When reviewing diffs alongside open files, users expect tab-switching shortcuts inside a focused side panel with multiple tabs to cycle those side-panel tabs, matching desktop apps like ChatGPT/Codex.What Changes
tab.prev/tab.next(⌘⌥←/⌘⌥→,⌃⇧Tab/⌃Tab)> 1drawn tab#review-panel(outside extension-scoped subtrees)actions.region.keys(), wrapping around) and preserves focus inside#review-panel> 1drawn tab#review-panel(e.g. prompt composer or session timeline)<= 1drawn tabDemo
side-panel-tabs-demo.mp4
Left (Before): pressing
⌃Tab/⌃⇧Tabwith focus inside the side panel switches the active session tab toBeta session. Right (After): pressing⌃Tab/⌃⇧Tabwith focus inside the side panel cycles betweengreet.tsandFiles Changed 2while keepingAlpha sessionactive; moving focus back to the prompt composer and pressing⌃Tabswitches toBeta session.Scope
Owns focus-scoped side-panel tab cycling (
file.tab.prev/file.tab.next) inuseSessionCommandsand focus containment on#review-panelinSideRegion.Verification
lint:changed: 0 problems in 3 changed files.e2e/regression/tabs.spec.tsande2e/regression/side-panels.spec.ts: 19 passed (including new regression test covering composer focus vs side-panel focus and falling back to session tabs once only one side-panel tab remains).bun run check: 34/34 packages passed typecheck and lint.