From 1aba2a5f23672f0e2b0a605d35d2201bbd0be2c1 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 03:42:48 +0000 Subject: [PATCH] Measure composer pills after the compact layout replaces them (#9546) Resizing to a compact width mounts a new composer, so boundingBox() on a pill could resolve the wide layout's element and return null once it unmounted. Wait for the compact header, then poll each pill's width. Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> --- packages/app/e2e/browser/composer-diff-stat.spec.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/app/e2e/browser/composer-diff-stat.spec.ts b/packages/app/e2e/browser/composer-diff-stat.spec.ts index 5dd2b8ae1..d197dfa44 100644 --- a/packages/app/e2e/browser/composer-diff-stat.spec.ts +++ b/packages/app/e2e/browser/composer-diff-stat.spec.ts @@ -3,7 +3,7 @@ import { writeFile } from "node:fs/promises"; import path from "node:path"; import { expect, test, type Page } from "../support/fixtures"; import { seedSubagent } from "../support/helpers/subagents"; -import { submitMessage } from "../support/helpers/composer"; +import { expectWorkspaceHeaderVisible, submitMessage } from "../support/helpers/composer"; import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent"; import { gateNextAgentMessage } from "../support/helpers/agent-message-gate"; import { @@ -918,11 +918,12 @@ test.describe("touch composer tracks", () => { [tasks, subagents, changes].map(async (pill) => (await pill.boundingBox())!.width), ); await page.setViewportSize({ width: 200, height: 844 }); - const narrowWidths = await Promise.all( - [tasks, subagents, changes].map(async (pill) => (await pill.boundingBox())!.width), - ); - for (const [index, width] of wideWidths.entries()) - expect(narrowWidths[index]).toBeGreaterThanOrEqual(width - 1); + // The compact layout mounts a new composer, so measure only after it replaces the wide one. + await expectWorkspaceHeaderVisible(page); + for (const [index, pill] of [tasks, subagents, changes].entries()) + await expect + .poll(async () => (await pill.boundingBox())?.width ?? 0) + .toBeGreaterThanOrEqual(wideWidths[index] - 1); const track = page.getByTestId("composer-track-scroll"); expect(await track.evaluate((node) => node.scrollWidth)).toBeGreaterThan( await track.evaluate((node) => node.clientWidth),