Skip to content

Wait for the engine's hover before a capture, and take each demo frame once the server's reading lands - #5356

Merged
max-sixty merged 5 commits into
mainfrom
agent-a9a03e588cab9e626
Nov 4, 2026
Merged

max-sixty merged 5 commits into
mainfrom
agent-a9a03e588cab9e626

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A 10-shot sweep of every stills state after #5278 and #5305 found captures that read differently from run to run on the same code. This fixes the causes that live in developer tooling. The causes behind image-preview and screenshot-pixels are unregistered work in the runtime and the default package, and go separately.

The hover after a scroll. When a state's driver presses a control and then scrolls, the pointer ends up over whatever scrolled under it. The engine keeps the pressed control hovered until it hit-tests again, on a timer of its own. On this Mac Firefox took about 100 ms, WebKit 20–120 ms, and Chromium about a frame, though under load sometimes longer than the rest of settle. A capture taken first drew the old hover. settle now waits until the hover ends at the deepest element under the pointer, then settles again, since the page may answer the pointerover the engine sends. So that settle knows where the pointer rests, each tab records where a mouse last was in each frame and which buttons it held. A held button keeps the hover where the press began, and a pointer that last moved in a child frame is out of the top document's sight, so settle leaves both to the engine.

settle waits rather than moving the pointer to where it already is. Such a move sends pointermove in every engine. The merge film answers pointermove by closing the details its Inspect button opened, so a move turned Chromium's steady film-inspector capture, details shown, into one without them.

film-inspector. After pressing Inspect, the driver now moves the pointer away before scrolling the film into place. The scroll used to leave the pointer over the stage, which inspects whatever a pointermove lands on. WebKit sends one by itself about 100 ms after a scroll, so its capture lost the details.

record-demo. The demo's leaf wait ends the moment the comment arrives, so frame 3 read "Ready" or "Away" depending on how far it had got. The agent now takes the comment, acknowledges it and waits again before frame 3, which shows the comment Delivered and the agent at work. Before frame 3 the command also waits for the page server's request for the thread's title to end, so frames 4–5, both README stills and the link card show the model's title rather than "Generating thread name…". The title is still worded afresh each run. Every frame waits until the page has applied the server's current reading, read through PageClient.state() in place of record-demo's own fetch. No README asset is republished here.

Evidence

Each burst is 8 captures 250 ms apart through browser.screenshot. On this change, with the runtime part applied, each of these states drew one image per burst in Chromium, Firefox and WebKit. On main:

state distinct images of 8 on main (Chromium, Firefox, WebKit)
film-inspector 1, 1, 2 (WebKit's details close after the first)
activity-feed 1, 2, 1
screenshot-options 1, 1, 1 in this run; Firefox varied in the earlier sweep
plan-capture, plan-capture-drag (button held) 1, 1, 1

A one-capture Chromium sweep of all 201 states with an input, on main and on this change: settle waited for the hover in 14 states, and every one of those captures matches main's. 196 captures match; of the rest, page-about and share-link also differ between two runs of main, and image-preview and screenshot-pixels are the runtime part's.

Two record-demo runs on this change differ only in the title's wording.

Changed behavior

  • A state's capture shows the hover where the pointer rests, in every engine.
  • film-inspector shows the details card in WebKit too; Chromium's and Firefox's captures are unchanged.
  • record-demo's frame 3 shows the comment Delivered and the agent at work, where it showed "Ready" or "Away".

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

@max-sixty
max-sixty merged commit 7e45d38 into main Nov 4, 2026
4 checks passed
max-sixty added a commit that referenced this pull request Nov 4, 2026
…how the agent's step in demo frame 3 (#5387)

Follow-ups to #5356 from its independent review.

**A native drag's drop.** `settle` reads where the mouse rests from what
each frame records. A native drag sends no `pointerup`, so the record
kept the button held from the press and `settle` skipped its hover wait.
The record now also takes `dragend`, which every engine sends where the
drag drops, with no button held. `pointercancel` would not do: measured
on 2026-11-04 it read (0, 0) in Chromium and the button still held in
Firefox, and WebKit sent none. After a Playwright `drag_to` in each
engine, the record now holds the drop point with no button, and the
hover there reads as caught up.

**record-demo's title wait.** A "title generated" row whose title the
server did not write (`written: false`) left the thread untitled, yet
passed the wait; it now fails it. The wait's deadline is now derived as
`thread_titles.RETRY_FOR + inference.TIMEOUT` instead of a typed 180 s.

**record-demo's frame 3.** The agent now says what it is doing
(`cmd_start`, "answering the backfill question") before frame 3, so the
frame shows the comment "On it" with the agent's step in the panel,
where it showed an empty status line. Two runs of this code drew all
eight frames, both README stills and the card identically. The model
happened to word the title the same way both times.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Nov 5, 2026
… on Web Awesome views and gallery frames (#5438)

In Firefox, `leaf-dev stills` and `probe` could no longer capture
`screenshot-pixels`. Since #5393 put the shot's views in a Web Awesome
radio group, `settle`'s hover wait either hung or timed out there. Both
failures came from #5356's hover check, which this fixes.

**The hang.** The hover check read where the mouse had last moved in
each of the page's frames, to tell whether the pointer rested inside a
child frame. On the gallery page, with 19 frames, reading an
`about:blank` frame never returned in Firefox. The check no longer
visits frames. A mouse inside a child frame shows in the top document as
a hovered `iframe`, so that is what the check now reads, and the
per-frame timestamps are gone.

**The timeout.** The check followed both the hover chain and the element
under the pointer down through open shadow roots. In Firefox those
disagree inside a Web Awesome radio button: the host is hovered, but the
slot under the pointer isn't. So the hover never counted as caught up.
The check now compares the two in the document's own tree, where a
shadow host stands for everything its shadow root draws. It no longer
sees a stale hover that stays inside one host, which no known state
needs.

### Evidence

- **Bursts of 8 captures 250 ms apart.** In each of Chromium, Firefox
and WebKit, every one of these states drew one image:
`screenshot-pixels`, `screenshot-options`, `image-preview`,
`film-inspector`, `activity-feed`, `plan-capture` (button held),
`diff-file-reply` (pointer in a frame) and `dynamic-request-preview`.
`retained-quote` also drew one image in Chromium and WebKit. In Firefox
it fails before capture, and it fails the same way with main's
`browser.py`.
- **The check's own cases, in every engine.** A container whose button
scrolled out from under the pointer reads as behind in 12 of 12
readings, until the engine moves the hover. A mouse resting in an iframe
reads as caught up. After a native drag, the record holds the drop
point.

> _This was written by Claude Code on behalf of max-sixty_
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