fix(app): show Setup tabs only for failures (#3634)

* fix(app): only surface failed workspace setup

Running and successful setup snapshots were treated as reasons to seed a background Setup tab, adding noise to every workspace with setup commands. Seed only failed setup and classify that tab as main-workspace content so the failure stays visible without stealing focus.

* fix(app): surface failed setup once

Keep the failed-setup surfacing claim with the setup snapshot so closing its background tab remains respected after the workspace remounts. Explicitly prefer the main pane for a new failure tab without moving a user-placed existing tab.

* fix(app): keep setup tabs out of side panel

A preferred main-pane placement can fall back when users remove that pane. Keep that implicit fallback out of the focused Side panel when another workspace pane is available.
This commit is contained in:
Mohamed Boudra
2026-08-21 11:17:04 +02:00
committed by GitHub
parent bc02cfd8cd
commit 04624cb419
10 changed files with 271 additions and 61 deletions
@@ -276,6 +276,11 @@ export async function navigateToWorkspaceViaSidebar(
});
}
export async function returnHomeFromWorkspace(page: Page): Promise<void> {
await page.getByRole("button", { name: "Home" }).click();
await expect(page).not.toHaveURL(/\/workspace\//, { timeout: 30_000 });
}
export async function openWorkspaceScriptsMenu(page: Page): Promise<void> {
await page.getByTestId("workspace-scripts-button").click();
await expect(page.getByTestId("workspace-scripts-menu")).toBeVisible({ timeout: 10_000 });
@@ -13,6 +13,46 @@ export async function getWorkspaceTabTestIds(page: Page): Promise<string[]> {
return ids;
}
function setupTabTestId(workspaceId: string): string {
return `workspace-tab-setup_${workspaceId}`;
}
async function waitForSetupToReachWorkspace(page: Page): Promise<void> {
const actionsButton = page.getByTestId("workspace-header-menu-trigger");
await expect(actionsButton).toBeVisible({ timeout: 30_000 });
await actionsButton.click();
await expect(page.getByTestId("workspace-header-show-setup")).toBeVisible({ timeout: 30_000 });
await page.keyboard.press("Escape");
}
export async function expectSetupTabNotSeeded(page: Page, workspaceId: string): Promise<void> {
await waitForSetupToReachWorkspace(page);
const tab = page.getByTestId(setupTabTestId(workspaceId));
for (let attempt = 0; attempt < 5; attempt += 1) {
await expect(tab).toHaveCount(0);
await page.waitForTimeout(100);
}
}
export async function expectFailedSetupTabSeededInMainPane(
page: Page,
workspaceId: string,
): Promise<void> {
const tabId = setupTabTestId(workspaceId);
await expect(page.getByTestId(tabId).filter({ visible: true }).first()).toBeVisible({
timeout: 30_000,
});
const panel = await ensureSidePanel(page);
await expect(panel.getByTestId(tabId)).toHaveCount(0);
}
export async function closeSetupTab(page: Page, workspaceId: string): Promise<void> {
const tabId = setupTabTestId(workspaceId);
await page.getByTestId(tabId).filter({ visible: true }).first().click({ button: "right" });
await page.getByTestId(`workspace-tab-context-setup_${workspaceId}-close`).click();
await expect(page.getByTestId(tabId)).toHaveCount(0);
}
function visibleTestId(page: Page, testId: string) {
return page.getByTestId(testId).filter({ visible: true });
}