Skip to content

test: expect whole-pixel glide goals in the reading-keys walk - #6385

Merged
max-sixty merged 1 commit into
mainfrom
fix/reading-keys-whole-pixel
Nov 18, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/reading-keys-whole-pixel

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

#6364 rounds every scroll glide's goal to a whole pixel, and a press made during a glide adds its step to that rounded goal. test_the_reading_keys_accumulate_and_reverse still expected unrounded multiples of the step. With d's step of 482.4 px, three presses rest at 482 → 964 → 1446, and the test wanted 1447.2 ± 1. It failed on main in push run 44269587200 with assert 1446 == 1447.1999999999998 ± 1.

Only the test changes. Each expected resting place now comes from the rule glideTo states: round the previous goal plus the step. The ±1 bound stays. What the test guards is unchanged. A second press that measured from a glide still in flight would rest hundreds of pixels short, and one that ignored the user's mid-glide scroll would miss 400 by a whole step. Rounding at each press drifts at most half a pixel per press, which no reader sees, so I kept #6364's rule rather than adding a separate unrounded aim to the glide.

Verification: the test fails on main locally with the CI message and passes on this branch, together with test_the_reading_page_step_never_paints_behind_where_it_started.

Refs #3985 — automated triage

#6364 rounds each glide's goal to a whole pixel and presses add their
step to that goal, so three d presses of 482.4 px rest at 1446, not
1447.2. The test now derives each expected position from that rule;
the behavior it guards (presses add from the goal, a taken box resets
the goal, the foot banks nothing) is unchanged.

Refs #3985
@max-sixty
max-sixty merged commit 90ec765 into main Nov 18, 2026
6 checks passed
@max-sixty
max-sixty deleted the fix/reading-keys-whole-pixel branch November 18, 2026 12:28
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.

2 participants