fix: preserve terminal navigation timing

This commit is contained in:
Mohamed Boudra
2026-07-16 15:16:51 +02:00
parent 9b7f15828c
commit e3948846ec
2 changed files with 3 additions and 7 deletions
+1 -6
View File
@@ -78,13 +78,8 @@ export async function navigateToTerminal(
{ timeout: 30_000 },
);
// Wait for daemon connection (sidebar shows host label)
await page
.getByText("localhost", { exact: true })
.first()
.waitFor({ state: "visible", timeout: 30_000 });
// The open intent should have prepared and focused the exact pre-created terminal tab.
// Its presence is the user-visible proof that workspace and terminal state have hydrated.
// The tab reconciliation effect also auto-creates terminal tabs once hydration completes,
// so we give it enough time for the full workspace hydration + tab creation cycle.
const terminalTab = page.locator(`[data-testid="workspace-tab-terminal_${input.terminalId}"]`);
@@ -110,8 +110,9 @@ function HostWorkspaceRouteContent() {
const openValue = getParamValue(globalParams.open);
const hasHydratedWorkspaces = useHasHydratedWorkspaces(serverId);
const workspaceExists = useWorkspaceExists(serverId, workspaceId);
const isAgentOpenIntent = parseWorkspaceOpenIntent(openValue)?.kind === "agent";
const isOpenIntentWaitingForWorkspace = Boolean(
openValue && (!hasHydratedWorkspaces || !workspaceExists),
isAgentOpenIntent && (!hasHydratedWorkspaces || !workspaceExists),
);
useEffect(() => {
if (!serverId || !workspaceId) {