Repository navigation
Hold the caret still in stills' and probe's screenshots - #5278
Merged
Merged
Conversation
leaf-agent
reviewed
Nov 4, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
No findings on this head. I'm holding back approval only because the description says the Firefox catalogue sweep is still running and its result goes into the description before merge. Once that result is in, the next review can approve.
Owner
Author
|
@leaf-agent The Firefox sweep has finished and its result is in the description, in the catalogue line: 235 of 249 states drew one image; 10 failed to reach their state, and of the 4 that varied, 3 lost a hover look after settling and 1 is
|
leaf-agent
approved these changes
Nov 4, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 4, 2026
…ough browser.screenshot (#5305) record-demo and refresh-previews took their frames with Playwright's `caret="hide"`, which reaches fields in the document and open shadow roots only, so it never hid the composer's caret, drawn inside the text field's closed root: a README GIF frame or catalog preview with the composer focused drew the caret or not depending on where its blink stood. They, `leaf-dev pins` and the arrangement eval's arrival captures now take each capture through `browser.screenshot`, the function stills and probe use since #5278, which draws every caret steadily in Chromium. `screenshot` returns the PNG rather than writing it to a path, so a caller that composes frames, as record-demo's GIF and refresh-previews' JPEGs do, takes it the same way as one that saves a file. These captures drop `animations="disabled"`. Each opens its tab with `tab`'s reduced motion, under which the theme's guard (`state.css`) and the runtime (`motion.js`, `motionPlays`) play no motion, and no catalog page runs motion of its own at rest, so the option finished nothing: main's frames and this change's differ only in the caret. record-demo waited for the floating panel to say "Moved to During" after its board move. Since #4323 a widget's gesture raises no notice (`notifications.js`), so on main the command timed out there. Its last frame now waits for the page to apply the server's reading of the move, which it already waited for after the frame. A republish changes what the images show in one way: in Chromium a focused field's caret is drawn in every capture, where it was drawn in about half of them. That covers the README GIF's composer and thread reply frames, the README's two stills and the site's link card, whose reply field has focus, and any catalog preview whose field has focus. Checked under `taskpolicy -b`, each capture taken 8 times 250 ms apart: - record-demo's composer frame and thread reply frame: on main the caret came and went within each burst (5 of 8 captures drew it in both); here all 8 drew it, and each burst was one image. The run completes and writes the GIF and its three stills. - refresh-previews of review-a-plan and triage-board with the composer focused, main's capture call and this one in the same run: main's drew 2 images of each page, differing only in a 1 by 17 px caret; this one drew 1, identical to main's capture with the caret. - `leaf-dev pins` and an arrangement-eval arrival capture through the new path; `dev/tests/model/test_stills.py`. Thread snapshots, `eval_ui_review.py` and `widget_format_eval.py` keep their own captures while the user decides what becomes of them. > _This was written by Claude Code on behalf of max-sixty_
max-sixty
added a commit
that referenced
this pull request
Nov 4, 2026
…e once the server's reading lands (#5356) 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_
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On identical runtimes, stills read
plan-card-reply,triage-composerandtriage-composer-emptyas changed by 68 px in 5 of 12 captures on main undertaskpolicy -b: the composer's caret blinked, and each arm caught it in its own phase. Playwright hides a caret by colouring each field it can reach transparent, but the composer draws its caret inside the text field's closed shadow root, which set the caret's colour itself.Stills and probe now take their screenshots through
browser.screenshot, whose docstring states the rule both follow: a capture holds each animation the browser draws of its own accord in one state. For the shot it adds a style that draws every caret steadily where the engine can stop its blink (caret-animation: manual, which Playwright's Chromium supports) and hides every caret where it can't: Playwright's WebKit fades its caret in and out, and its Firefox draws none headless. The overlay scrollbar that #5270 keeps shown throughlaunchis the docstring's other case;launch's own docstring now points there.Both declarations are inherited. For the hide to reach the composer's caret in WebKit, the text field takes the caret's colour from its host:
:hostsetscaret-color: currentColorand the editor inherits it. The caret keeps the ink of the words it stands in (computed values compared in Chromium, Firefox and WebKit), and a rule on the field now colours its caret, as one on a textarea does.What stills shows changes in two ways. In Chromium every focused field's caret is drawn, where Playwright used to hide all but the composer's; in WebKit and Firefox none is. Against a base from before this change, WebKit draws the base's composer caret and hides the head's, so those states read as changed there until the base includes this commit.
Checked on identical runtimes unless noted:
taskpolicy -b: 0 of 12 captures of the three states changed, against 5 of 12 for main against itself. The caret is drawn in both arms.screenshot, 1 each. Firefox drew 1 either way.screenshot: one image each for 247 of 249 states in Chromium, 242 in WebKit and 235 in Firefox; the rest failed to reach their state or varied. Focus rings, spellcheck marks and scrolled states held still. What still varied is not an animation the capture's style can hold. In every engine,image-previewchanged when PhotoSwipe dropped its placeholder, about a second after the page reported settled. In Firefox and WebKit, three states each lost a hover look 250 to 500 ms after settling: the button or link under the resting pointer, after the click or scroll that left it there (film-inspectorandactivity-feedin both,screenshot-optionsin Firefox,authored-timeline-keyboardin WebKit).