Skip to content

test(e2e): the arrival probe inserts its notice on the first moving frame of the scroll - #542

Merged
arrzdev merged 1 commit into
mainfrom
fix/avoid-keyboard-notice-race
Nov 1, 2026
Merged

arrzdev merged 1 commit into
mainfrom
fix/avoid-keyboard-notice-race

Conversation

@arrzdev

@arrzdev arrzdev commented Nov 1, 2026

Copy link
Copy Markdown
Owner

The arrival probe in /lab/avoid-keyboard inserted its 100px notice on the third rAF frame where the scroller had moved. The aim's smooth scroll runs on the clock and the frames do not. On WebKit the third moving frame landed anywhere from 194 to 448px into a 520px flight. On a slow first run it landed on 520 itself, so the premise check failed with Expected < 519, Received 520. That was the probe failing to set up its scenario, not a layout bug.

What changes:

  • The probe inserts the notice on the first moving frame. That is the earliest point where the aim has already committed its destination, and no later frames are left for a slow one to run the flight out. WebKit now inserts at 22–31px and chromium at 2px.
  • The clearance assertion now runs before the premise check. With the second look removed, WebKit stops the flight where the notice went in (landed 130). Before this change that showed up as a broken premise; now it shows up as the field left underneath (clearance −466).
  • The spec's header numbers are re-measured, and the test title says "first frame".

Reproduce (before): cd playground && pnpm exec playwright test e2e/avoid-keyboard.spec.ts -g "frame 3" --project=webkit --repeat-each=10. Warm runs pass; the failure came on the cold first repeat of a WebKit sweep.

Verify:

  • pnpm exec playwright test e2e/avoid-keyboard.spec.ts -g "first frame of the scroll" --project=webkit --repeat-each=10: 20 passed, run twice
  • same on --project=chromium --repeat-each=10: 20 passed
  • pnpm exec playwright test e2e/avoid-keyboard.spec.ts --project=webkit --project=chromium: 10 passed
  • Mutation check: with onSettle() disabled in onProgrammaticScrollSettled and dist/ rebuilt, all 4 cells fail on the clearance assertion (chromium −76, WebKit −466)
  • pnpm biome:check, pnpm biome:check:playground, pnpm typecheck: clean

Tested on: Linux, Playwright chromium and WebKit, 390×844 viewport.
Not tested: real iOS device, CI cell (E2E workflows are disabled).

…rame of the scroll

The probe counted rAF frames on which the scroller had moved and inserted the
notice on the third. The aim's smooth scroll runs on the clock and the frames
do not: on WebKit the third moving frame sat anywhere from 194 to 448px into a
520px flight, and on a slow first run it sat on 520 itself, so the premise
check (the notice went in before the scroll reached its destination) failed
at 520 < 519.

The first moving frame is the earliest point the aim has committed its
destination, and it leaves no frames for a slow one to run the flight out:
WebKit now inserts at 22-31px, chromium at 2px.

The clearance assertion moves ahead of the premise check, so a field left
underneath reports as that: with the second look removed, WebKit stops the
flight where the notice went in (landed 130, clearance -466), which would
otherwise surface as a broken premise.
@arrzdev
arrzdev marked this pull request as ready for review November 1, 2026 23:11
@arrzdev
arrzdev merged commit 3d932b9 into main Nov 1, 2026
4 checks passed
@arrzdev
arrzdev deleted the fix/avoid-keyboard-notice-race branch November 1, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant