fix(app): seed changes tab in explorer pane even when setup tab occupies it

The explorer companion pane retention commit (de9e85862) auto-opens the
setup progress tab into the hidden explorer pane. toggleWorkspaceExplorerPane
only seeded the working_diff (Changes) tab when the pane was completely
empty, so once the setup tab landed there, clicking the explorer toggle
could never surface Changes/Files again via that pane's default tab.

Also fixes two e2e testid locators (workspace-new-tab-menu-trigger) and
one unit test assertion (browser automation handler) that assumed a bare
pane root, which predates that same explorer-pane-retention change: the
workspace root is now always a group with a hidden companion pane, so
unscoped locators/assertions must target the visible/named pane.
This commit is contained in:
Mohamed Boudra
2026-08-18 15:20:06 +02:00
parent c09be7efa2
commit bd3f3c7714
3 changed files with 26 additions and 8 deletions
@@ -1404,7 +1404,15 @@ function toggleWorkspaceExplorerPane(input: ToggleWorkspaceExplorerPaneInput): v
store.hidePane(input.persistenceKey, explorerPane.id);
return;
}
if (explorerPane.tabIds.length === 0) {
// The companion pane can already hold an unrelated tab (the setup
// progress tab auto-opens here) before the user ever toggles it, so
// "empty" is the wrong signal for "needs a Changes tab seeded". Check
// for the working_diff tab specifically.
const layoutTabs = collectAllTabs(layout.root);
const hasWorkingDiffTab = explorerPane.tabIds.some(
(tabId) => layoutTabs.find((tab) => tab.tabId === tabId)?.target.kind === "working_diff",
);
if (!hasWorkingDiffTab) {
const tabId = parentTabId
? store.openChildTabFocused(input.persistenceKey, { kind: "working_diff" }, parentTabId)
: store.openTabFocused(input.persistenceKey, { kind: "working_diff" });