You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Closing a secondary-panel tab jumps to the left neighbor instead of the source tab #3014
When a secondary-panel tab is closed, focus jumps to the left positional neighbor of the closed tab rather than returning to the tab that was active before the closed tab was opened.
This is most visible with the side-chat plugin: opening a side chat from a "source" tab, then closing the side-chat tab, lands you on whatever tab sits to the left in the strip instead of the source tab you came from.
Steps to reproduce
Open a thread with the secondary panel showing several tabs (e.g. tab A, tab B where B is active).
From B, open a side chat (or any new content tab C). C becomes active.
Close C.
Expected
Focus returns to B (the tab active before C was opened), since B still exists.
Actual
Focus goes to the left positional neighbor (e.g. A), not B.
Root cause
getActiveTabIdAfterClose in packages/client-core/src/panel/secondaryPanelTabState.ts selects the next active tab purely by position:
There is no record of the previously-active tab, so closing the active tab always falls to a positional neighbor.
Proposed fix
Track the most-recently-active prior tab as a transient previousActiveTabId on the secondary panel state, and on close prefer it when it still exists (fall back to the positional neighbor otherwise).
Activity
bb-slop-cop commentedon Sep 3, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotui,confirmed-reproconfirmed-repro; the focused test failed in two clean trusted checkouts.Fix panel close navigation and stale tab synchronization (#3015)