From 7286d3ef81077654e30fe50393dc449b52c84c72 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Sun, 15 Nov 2026 00:01:22 +0000 Subject: [PATCH] Wait for Command Center rows to settle before counting renders (#9714) The live-search test reset the row render counter after a fixed 600ms. On a loaded runner FlatList was still mounting overscan rows after that, and each late mount counted as a render of an unchanged row. Reset the counter only after a quiet period with no row render. Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 --- .../helpers/command-center-performance.ts | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/packages/app/e2e/support/helpers/command-center-performance.ts b/packages/app/e2e/support/helpers/command-center-performance.ts index b61771c05..4b9fddbf5 100644 --- a/packages/app/e2e/support/helpers/command-center-performance.ts +++ b/packages/app/e2e/support/helpers/command-center-performance.ts @@ -49,11 +49,27 @@ export async function searchCommandCenter(panel: Locator, query: string) { } export async function warmCommandCenterRows(page: Page) { - // FlatList fills its overscan window in timed batches after the first visible frame. - await page.waitForTimeout(600); - await page.evaluate(() => { - globalThis.__PASEO_RENDER_PROFILE_REASONS__ = {}; - }); + // FlatList fills its overscan window in timed batches after the first visible frame, + // and a slow runner can still be mounting rows long after it. Start counting only + // once a quiet period passes with no row render. + await expect + .poll(() => page.evaluate(countRowRendersOverQuietPeriod), { + intervals: [0], + timeout: 15_000, + }) + .toBe(0); +} + +// Runs in the page: resets the render profile and counts row renders over two frames and 300ms. +async function countRowRendersOverQuietPeriod() { + globalThis.__PASEO_RENDER_PROFILE_REASONS__ = {}; + await new Promise((resolve) => + requestAnimationFrame(() => requestAnimationFrame(() => resolve())), + ); + await new Promise((resolve) => setTimeout(resolve, 300)); + return Object.keys(globalThis.__PASEO_RENDER_PROFILE_REASONS__ ?? {}).filter((id) => + id.startsWith("CommandCenterResultRow:"), + ).length; } export async function expectOnlyCommandCenterRowRendered(page: Page, resultId: string) {