fix(app): stop PR detection from stealing explorer pane focus

observePullRequest used to reveal and focus the explorer pane, and the persisted focus leak then made ambient tab opens (sidebar agent clicks, reconcile auto-open) insert agent tabs into the explorer pane while the main pane sat empty.

PR detection now only background-adds the PR tab to the explorer pane, with no reveal and no focus change, so a tab the user already opened elsewhere stays where it is.

Placement policy is centralized in workspace-layout-actions.ts (resolvePlacementPane / insertNewTabIntoPane): explicit paneId wins, and ambient entity opens (agent, provider_subagent, terminal, draft, browser) reroute from the explorer pane to the primary pane. explorerPaneId is a required input so callers cannot silently fail open.

Pane-rail + affordances thread explicit paneId instead of focus-then-open.
This commit is contained in:
Mohamed Boudra
2026-08-19 08:50:31 +02:00
parent e9373c026b
commit b638f7d3ee
7 changed files with 588 additions and 157 deletions
@@ -9,6 +9,7 @@ function createLayoutWithBrowser(browserId: string): WorkspaceLayout {
layout: createDefaultLayout(),
target: { kind: "browser", browserId },
now: 1,
explorerPaneId: null,
}).layout;
}