test(desktop): start the mid-page coverage burst with a gesture

"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>
This commit is contained in:
Meli
2026-08-22 22:44:21 -04:00
parent 7442713de2
commit d73ba9c196

View File

@@ -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;