Skip to content

Give both hint maps one answer for what the reader can see, and one for a page in motion - #805

Merged
max-sixty merged 3 commits into
mainfrom
hint-visibility-one-rule
Sep 18, 2026
Merged

max-sixty merged 3 commits into
mainfrom
hint-visibility-one-rule

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

g's map of visible page targets and s's map of addressable elements run over one session since #794, but each still answered two questions for itself, and on both the two disagreed. This gives each question one answer. The Stage note that landed on main today — that the suite is overfit and a test is part of a code change — is what this is: three tests moved, and the behaviour each was holding is named below.

What the reader can see

The chooser reserved each piece of bottom chrome's whole lane, from the blocker's top down to the window's foot, before admitting a member. That took the letter off anything standing in the strip of page below the shortcut bar. A blocker is its own rectangle now, so the strip is page again.

Read the other way, the chooser asked only whether chrome stood at a member's corner, so an ordinary page box covering a member whole still left it holding a letter. Measured on a paragraph behind an opaque sheet: the chooser offered a route to a block the reader could not see, and taking it would have opened a comment on it. Go-to has always required the member itself to answer. That hit test has one owner now, exposes, and both maps ask it.

What the two readings are for is the difference that remains, and it is about what the measured thing can do when chrome lands on it rather than about which map asks. A member's box keeps the chrome at the foot in it, deliberately: that chrome is raised by the very interaction whose membership it would be deciding — the bar states the armed map's own keys and changes width as the reader filters them — so a map that read it would lose members as it armed and swap codes under the reader as its own legend grew. test_a_transient_notice_does_not_move_generated_address_hints is where that lands, and it caught the first attempt at this. A chip that would land on the bar is moved clear instead, which keeps the route where dropping the member loses it. A search mark is drawn where it stands and cannot be moved somewhere legible, so clearPart alone subtracts that chrome and hands back the largest part left.

exposes asks in the middle of a box the member actually paints rather than the middle of its bounds, because those are not the same box for a display: contents member: its bounds are the union of its children's, and the space between two of them belongs to whatever stands behind.

A page in motion

The two maps also behaved differently while the page moved, under a flag whose stated reason — that the Go-to map is too big to lay out per frame — was never measured and is not true. The map is bounded by one viewport: 18 members on a page of 120 links, and following costs some three hundred hit tests across a whole smooth scroll.

Both maps now paint through a scroll once they have stood still long enough to be read, so the codes the reader is reading stay on the things they name — to the pixel, every frame of the way — and stay pressable. Membership still waits for the scene to settle, so withholding bought nothing — the codes are just as frozen either way, and blanking them only takes them off the screen they are being read from. Measured per frame: withholding blanks every chip after two frames and leaves them gone for ninety; following keeps them riding, draining one by one as their members leave the screen.

A map armed into a page already in flight keeps its own answer: it has stood still for nobody, so it shows nothing until the scene settles rather than putting codes on a scene that is leaving (test_inflight_native_paging_hides_hints_until_the_scene_settles). Arming cannot see that the page is moving, a scroll being heard only while armed, so the map waits out one settle before it counts as stood. Both behaviours now fall out of that one piece of state.

Evidence

Three new tests, each verified to go red when its own fix is reverted. Two of them fail on fb5d9ee0; the third — a display: contents member read where it paints — passes there and guards the extraction instead, main getting that case right by probing the corner where a unified centre probe would not, so it was verified against the intermediate that broke it.

Complete suite green at 2726 before integrating main, and both hint files green at 176 after. Note that the test check does not cover any of the three: all live in pytest.mark.nightly modules, which ci.yaml skips on pull requests, so main's push run is the first CI to reach them.

Two review passes each caught a comment stating something the code does not do. The first claimed the hit test catches the shortcut bar; the bar is pointer-events: none and can never answer one, which is what moved the design from deleting the chrome subtraction to correcting the lane. The second claimed a chip only roughly tracks its target through a scroll, on the strength of a probe that read inside a requestAnimationFrame callback registered a frame earlier and so ran ahead of the runtime's repaint, comparing the last frame's chip against this frame's target. The deviation was one frame's travel of measurement, and the tolerance built to absorb it made the test red on CI's headless shell, where a smooth scroll peaks at 62px per frame. Read after the frame's own callbacks, the chip holds its resting offset exactly.

Matched previews of examples/ship-review.html at 1280×900 with g and s armed: same members, same codes, no chip fouling the bar, none piled, none off screen, no console errors either side. The s chips move, because a parent whose box the lane used to cut short now measures whole and so genuinely encloses its children. That exposed a weakness this does not fix: the indent step is half a chip wide, so one level of nesting does not clear the parent's chip and the placement pass then drops it onto the member's own first line. Widening the step only trades the row's state icon for its first word — measured, not assumed. There is a TODO at enclosedBy proposing the left margin, where a top-level member's chip already sits.

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

max-sixty and others added 2 commits September 18, 2026 13:13
…or a page in motion

Go-to and the target chooser each decided for themselves what the reader can see
of a target, and the two disagreed in both directions.

The chooser reserved each piece of bottom chrome's whole lane — from the blocker's
top down to the window's foot — before admitting a member, which took the letter
off anything standing in the strip of page below the shortcut bar. A blocker is
its own rectangle now, so the strip is page again.

Read the other way, the chooser asked only whether chrome stood at a member's
corner, so an ordinary page box covering a member whole still left it holding a
letter: measured on a paragraph behind an opaque sheet, the chooser offered a
route to a block the reader could not see, and taking it would have opened a
comment on it. Go-to has always required the member itself to answer. That hit
test has one owner now, `exposes`, and both maps ask it.

What the two readings are for is the difference that remains, and it is about what
the measured thing can do when chrome lands on it, not about which map asks. A
member's box keeps the chrome at the foot in it, because that chrome is raised by
the very interaction whose membership it would be deciding — the bar states the
armed map's own keys and changes width as the reader filters them, so a map that
read it would lose members as it armed and swap codes under the reader as its own
legend grew. A chip that would land there is moved clear instead, which keeps the
route where dropping the member loses it. A search mark is drawn where it stands
and cannot be moved somewhere legible, so `clearPart` alone subtracts that chrome
and hands back the largest part left.

`exposes` asks in the middle of a box the member actually paints rather than the
middle of its bounds, because those are not the same box for a `display: contents`
member: its bounds are the union of its children's, and the space between two of
them belongs to whatever stands behind.

The two maps also behaved differently while the page moved, under a flag whose
reason — that the Go-to map is too big to lay out per frame — was never measured
and is not true: the map is bounded by one viewport, 18 members on a page of 120
links, and following costs some three hundred hit tests across a whole smooth
scroll. Both maps now paint through a scroll once they have stood still long
enough to be read, so the codes the reader is reading stay on the things they name
and stay pressable; membership still waits for the scene to settle. Withholding
blanked every chip for the length of the scroll and bought nothing, the codes
being just as frozen either way.

A map armed into a page already in flight is the other case, and it keeps its own
answer: it has stood still for nobody, so it shows nothing until the scene settles
rather than putting codes on a scene that is leaving. Arming cannot see that the
page is moving, a scroll being heard only while armed, so the map waits out one
settle before it counts as stood.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_generated_hints_follow_the_page_while_it_moves is red on Linux, deterministically: identical readings on three consecutive -n0 runs, and the only failure when the whole file runs under the default parallelism (139 passed, 1 failed). Its 40px tolerance is really a bound on how far this smooth scroll travels in one frame, which the test does not control — with the locked Chromium headless shell the animation peaks at 62px per frame, so gap - resting reaches 62 and the assertion fails. All three new tests live in pytestmark = pytest.mark.nightly modules and ci.yaml's nightly job is skipped on pull requests, so the green test check on this head never ran any of them; main's push run is where this would land.

The cause is the measurement, not the behaviour. The loop reads inside its own requestAnimationFrame callback, registered a frame earlier and therefore queued ahead of the runtime's repaint callback for the same frame, so it reads the chip where the previous frame painted it against a target already at this frame's offset — which is exactly why the deviation equals one frame's travel. Take the reading after the frame's own callbacks instead and the chip holds station to the pixel: on the same page gap is 9.5px on every frame from scrollTop 0 to 256, against a resting 9.5px.

So the comment's "it does not keep station on it to the pixel" is the artifact talking, and what this PR ships is the stronger claim. The two suggestions below take the reading after the paint and pin the equality; with them the test passes three times running, and ruff format --check and ruff check are clean. Say the word if you'd like me to push it rather than apply it by hand.

Comment thread tests/test_render_navigation.py Resolved
Comment thread tests/test_render_navigation.py Resolved
Review found the test red on Linux, and the artifact behind it: the reading was
taken inside a `requestAnimationFrame` callback registered a frame earlier, so it
ran ahead of the runtime's repaint and read the chip where the last frame put it
against a target already at this frame's offset. The deviation it reported was
one frame's travel of pure measurement, which is why a tolerance had to be wide
enough to cover however far a smooth scroll happens to move in a frame — 40px
here, 62px under CI's headless shell.

Read after the frame's own callbacks and the chip holds the offset it had at
rest, to the pixel, so the test says that instead. The comment claiming it does
not keep station was the probe talking.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit e5d7eb7 into main Sep 18, 2026
7 checks passed
@max-sixty
max-sixty deleted the hint-visibility-one-rule branch September 18, 2026 21:01
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