From 05978bc5d00790a68587dc3b2416f23adcbd87b5 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Mon, 19 Oct 2026 18:11:21 +0200 Subject: [PATCH] fix(test): await retained shell layout after composer resize The gesture host now stays mounted across breakpoints, so its presence no longer identifies compact layout. Report the current layout on the retained host and synchronize composer journeys with that state. --- .../e2e/browser/new-workspace-launch-terminal.spec.ts | 4 +--- packages/app/e2e/support/helpers/composer.ts | 9 +++++---- packages/app/src/app/_layout.tsx | 7 ++++++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/app/e2e/browser/new-workspace-launch-terminal.spec.ts b/packages/app/e2e/browser/new-workspace-launch-terminal.spec.ts index d393966ee8..7268f7146b 100644 --- a/packages/app/e2e/browser/new-workspace-launch-terminal.spec.ts +++ b/packages/app/e2e/browser/new-workspace-launch-terminal.spec.ts @@ -247,9 +247,7 @@ test.describe("New workspace: fullscreen composer across the compact breakpoint" await expectNewWorkspaceDraft(page, `${draft} wide`); }); - // Terminal mode and its prompt are screen state, and the shell remounts the screen - // at the breakpoint, so the terminal prompt's fullscreen is exercised on the phone - // layout only. + // Exercise the terminal prompt's fullscreen and compact launch sheet on the phone. await test.step("terminal: the prompt's fullscreen shows only exit and Launch", async () => { await resizeComposerViewport(page, "portrait"); // The compact launch control opens a sheet, not the desktop menu. diff --git a/packages/app/e2e/support/helpers/composer.ts b/packages/app/e2e/support/helpers/composer.ts index 971b1ad1b9..19183fee4b 100644 --- a/packages/app/e2e/support/helpers/composer.ts +++ b/packages/app/e2e/support/helpers/composer.ts @@ -363,10 +363,11 @@ export async function resizeComposerViewport( await page.setViewportSize(sizes[orientation]); // Before the app has loaded there is no layout to wait for. if (page.url() === "about:blank") return; - // Crossing the compact breakpoint remounts the shell and the editor. Anything that - // follows (a shortcut, a locator) belongs to the layout the new size implies, so - // wait for that layout before returning. - await expect(page.getByTestId("compact-shell")).toHaveCount(orientation === "landscape" ? 0 : 1); + // The shell and editor survive the breakpoint. Wait for the shell's layout + // marker to update before interacting with the resized composer. + await expect( + page.getByTestId(orientation === "landscape" ? "wide-shell" : "compact-shell"), + ).toBeVisible(); } export async function selectComposerDraftRange( page: Page, diff --git a/packages/app/src/app/_layout.tsx b/packages/app/src/app/_layout.tsx index 4f2c54f233..559726d7c8 100644 --- a/packages/app/src/app/_layout.tsx +++ b/packages/app/src/app/_layout.tsx @@ -679,10 +679,15 @@ function MobileGestureWrapper({ chromeEnabled: boolean; }) { const openGesture = useOpenAgentListGesture(chromeEnabled); + const isCompactLayout = useIsCompactFormFactor(); return ( - + {children}