Skip to content

Wait out scrolls in flight before calling a page settled - #4575

Merged
max-sixty merged 8 commits into
mainfrom
anchored-thread-box
Oct 28, 2026
Merged

max-sixty merged 8 commits into
mainfrom
anchored-thread-box

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

pageSettled is what page_at_rest and the render gate wait on. It counted only finite Web Animations, and a landing's smooth scroll is not one, so a reading taken after a key press could land mid-glide. In the corpus ring sweep, pressing ] on a diff line left the page scrolling from 6602 to 6926 for about 250ms after page_at_rest returned. The ring was then read 32px away from where it was painted. #4565 worked around that one case with a scroll_settled call.

pageSettled now also asks the runtime's own reading of scrolls in flight. That is scrolling in browser/runtime/arrivals.js, newly exported on the check API. A scroll counts as in flight until scrollend, or until a settle after the last scroll frame. The probe module takes one reading as it loads, so the runtime is already listening before any input the probes wait out. The kernel is rebuilt for the new export.

With this change, the sweep's landing has reached 6926 by the time page_at_rest returns, so the scroll_settled call from #4565 is removed.

Checks run locally on current main:

  • the corpus ring sweep, test_card_reply.py and the render gate's test_diagrams_preserve_late_state_labels_and_sequence_titles pass (46 tests);
  • pnpm run test:runtime passes (692);
  • pnpm run check:browser passes.

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

max-sixty and others added 8 commits October 27, 2026 23:00
Next on me lands focus on the agent reply it reaches. In a margin card that message
wore a ring of its own, drawn over its sticky head since #4556: a frame inside the
card, the frame-in-a-frame the card's own rule records rejecting for the thread. The
card now wears the ring for a focused message as it does for the focused thread,
since the keys that message answers (r, Enter) act on its thread, and the message
draws none.

The card test now expects the ring on the card face. Firefox showed the old message
ring cut at the transcript's end too, which the card ring avoids.

Co-Authored-By: Claude <[email protected]>
… it can't colour

A one-off run of the corpus ring sweep with #4556's pixel reading
(`test_each_sampled_focus_ring_is_shown_whole_in_its_surface`) stopped
on four faults in the readers before any ring defect.

- macOS raised StopIteration in `_read_ring_boxes` (#4432): the probe
  stashed the projected focus mark, the runtime replaced it before the
  CDP read, and the detached node had no `::after` styles. `rings_drawn`
  now waits for `rendered` before reading, as does the Tab walk after
  each Tab, and the per-test wait #4556 added to the table test goes.
- #4538 folds resolved threads under Threads' Resolved heading, so
  `open_panel_thread_holding` never found a resolved thread. It unfolds
  them (`show_resolved`).
- `test_rings.py`'s fixture widget still passed `offerAction` the
  `icon` option #4547 renamed to `action`, so the page failed to load.
- The landed diff line was read while `]`'s landing still scrolled the
  page smoothly, which `page_at_rest` doesn't wait on; that scope now
  waits with `scroll_settled`.

The pixel reading then flagged six rings, all whole on screen. It now
leaves to the hit-test reading a ring it can't expect in its known
colour: one faded with its box (disabled controls at 0.55 opacity), one
in a scaled box (a film's terminal in an SVG foreignObject), and an
inline box split over lines. It also leaves out points where a button
or link of the box's own stands in front, as a draft's toolbar seated
on its top border does. Ring geometry now scales a scaled box's band
and offset.

Restoring the card message's own outline still fails with "its top edge
shows the ring at 0% of its 24 samples".

Closes #4432

Co-Authored-By: Claude <[email protected]>
`pageSettled`, which `page_at_rest` and the render gate wait on, counted
only finite Web Animations. A landing's smooth scroll is none, so a
reading taken after a key could land mid-glide: in the corpus ring
sweep, `]` on a diff line left the page scrolling from 6602 to 6926 for
about 250ms after `page_at_rest` returned, and the ring was read 32px
from where it was painted.

`pageSettled` now also asks the runtime's own reading of scrolls in
flight (`scrolling` in arrivals.js, newly on the check API), which ends
at `scrollend` or a settle after the last scroll frame. The probes take
one reading as they load, so the runtime is listening before any input
they wait out. With it, the sweep's landing has reached 6926 when
`page_at_rest` returns, and the sweep's own `scroll_settled` for that
scope goes.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit a524c6b into main Oct 28, 2026
4 checks passed
@max-sixty
max-sixty deleted the anchored-thread-box branch October 28, 2026 09:21
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