From 58f8737a01de824b07345e92897fd050b086651d Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Wed, 29 Jul 2026 12:41:12 +0200 Subject: [PATCH] Measure the turn footer blink from when the footer appears Bounding the window at the prompt row conflated two things: the footer arriving a frame after the row, and the footer leaving the layout and coming back. Bounded from the footer's first frame, the blink still reproduces, so the footer-ownership race is real rather than a sampling artifact. --- packages/app/e2e/agent-consecutive-turns.spec.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/app/e2e/agent-consecutive-turns.spec.ts b/packages/app/e2e/agent-consecutive-turns.spec.ts index 4b33241f9..615064020 100644 --- a/packages/app/e2e/agent-consecutive-turns.spec.ts +++ b/packages/app/e2e/agent-consecutive-turns.spec.ts @@ -89,13 +89,16 @@ async function expectUninterruptedTurn(page: Page): Promise { if (!state) throw new Error("Turn frames were never recorded"); state.active = false; const start = state.frames.findIndex((frame) => frame.promptVisible); - // The turn ends when the working indicator goes away for good. Anything before - // that is a blink: the footer left the layout and came back. + // The turn runs from the footer first appearing to it going away for good. Bounding + // it that way keeps this measuring one thing: the footer leaving the layout and + // coming back. How long the footer takes to appear after the row is a separate + // question and does not belong in this assertion. + const firstWorking = state.frames.findIndex((frame) => frame.workingVisible); const lastWorking = state.frames.reduce( (latest, frame, index) => (frame.workingVisible ? index : latest), -1, ); - const turn = state.frames.slice(start, lastWorking + 1); + const turn = state.frames.slice(Math.max(start, firstWorking), lastWorking + 1); const blinkAt = turn.findIndex((frame) => !frame.workingVisible); let largestHeightDrop = 0; let largestHeightDropAt = -1;