Skip to content

Press a trace scale choice after its menu has followed the scroll that shows it - #6063

Merged
max-sixty merged 1 commit into
mainfrom
trace-scale-press
Nov 15, 2026
Merged

max-sixty merged 1 commit into
mainfrom
trace-scale-press

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Three trace tests press "Actual size" in the Image scale menu, and two of them timed out on CI with <body> intercepting the press (#5780 on macOS nightlies, and on Linux too). The menu hangs from its trigger by CSS anchor positioning, and near the window's foot its lower choices reach into the band the page keeps clear for the floating panel (scroll-padding-bottom), so Playwright's click first scrolls the choice into view (407 px on this page). Chromium moves an anchor-positioned box only at the next rendering update after a scroll, so the click can read the menu's old box and press the page there, which closes the menu.

The tests now scroll the choice into view and wait for rendered before pressing it (press_scale), and tests/AGENTS.md ("Driving the browser") states the rule for any anchor-positioned target. A user's own click never scrolls first, so the product is unchanged.

Under --cpu-throttle 20, 3 of 8 presses missed before and 0 of 8 after; the three tests pass on this Mac.

max-sixty asked for fixes to the macOS-only test failures; they haven't read this yet.

Refs #5780

This was written by Claude Code on behalf of max-sixty

…t shows it

Two trace comparison tests timed out on CI pressing "Actual size" (#5780,
macOS nightly and Linux push runs). Playwright's call log showed the choice
visible, enabled and stable, then `<body>` intercepting the press, then the
choice not visible for 120 s: the press closed the Image scale menu.

The menu hangs from its trigger by CSS anchor positioning. Below image tools
near the window's foot it reaches into the root's foot padding (the floating
panel's band, `followBox`), so Playwright's click scrolls the choice into view
first, 407 px on this page. After a scroll, Chromium moves an anchor-positioned
box only at the next rendering update (measured: the menu's box and hit test
read the old place synchronously and in the next rAF callback, the new place
one update later; the margin card does the same). The click reads the choice's
old box and presses there. On a fast machine the press arrives before the
update and hits the choice. On a slower one the update comes first, the press
lands below the trace on the page, and the menu closes, as any press outside
it does.

Reproduced with the second test's steps under `--cpu-throttle 20`: 3 of 8
presses missed with CI's exact call log. With the choice scrolled into view
and `rendered` before the press, 0 of 8 missed, and the three tests that press
a scale choice pass under the same throttle. Pressing at the box read right
after the scroll, one rendering update later, lands on `<body>` every time.

`press_scale` does that for each pointer press of a scale choice in the
module, and tests/AGENTS.md says when a click needs it. Behavior is
unchanged: a reader's own press doesn't scroll first, so it lands where the
menu is drawn.
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