From d73ba9c1962500eb81d53153ddb334e4c94a2a8b Mon Sep 17 00:00:00 2001 From: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Date: Sat, 22 Aug 2026 22:44:21 -0400 Subject: [PATCH] test(desktop): start the mid-page coverage burst with a gesture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "fast middle-page scroll settles with continuous mounted coverage" drove the scroller with bare scrollTop writes right after a prepend. Those are not reader input, so the virtualizer's bottom intent stayed armed, and when the prepend's extent resize fired inside the burst window the settle hook legitimately re-pinned the floor — the coverage read then measured the wrong viewport (197px hole). The test used to win that race only because the at-rest settle hold took ~100ms longer to admit the page; bounding the hold made the race visible (4/10 on WebKit, 5/12 on Chromium; 0 on the previous commit). Dispatch one wheel event before the burst, as a real trackpad pass does. Proven fail-first: with cancel() no longer clearing bottom intent the test is red 4/4 at 198px; clean product 16/16 Chromium, 12/12 isolated. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Signed-off-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> --- desktop/tests/e2e/scroll-history.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/desktop/tests/e2e/scroll-history.spec.ts b/desktop/tests/e2e/scroll-history.spec.ts index ad460c3fff..45e704308a 100644 --- a/desktop/tests/e2e/scroll-history.spec.ts +++ b/desktop/tests/e2e/scroll-history.spec.ts @@ -1338,7 +1338,15 @@ test("fast middle-page scroll settles with continuous mounted coverage", async ( // Simulate a fast trackpad pass through several middle-page ranges, then // stop. The final evaluate emits the last scroll event; all coverage samples // after it are passive observations. + // + // A real trackpad pass starts with a wheel event, and that is what retires + // the virtualizer's bottom intent. Programmatic `scrollTop` writes are not + // reader input, so without it the prepend's extent resize can legitimately + // re-pin the floor mid-burst and the coverage read measures the wrong place. await timeline.evaluate((element) => { + element.dispatchEvent( + new WheelEvent("wheel", { deltaY: -1, bubbles: true }), + ); const maxOffset = element.scrollHeight - element.clientHeight; for (const fraction of [0.72, 0.28, 0.64, 0.36, 0.58, 0.44, 0.52]) { element.scrollTop = maxOffset * fraction;