Repository navigation
fix: settle scoped motion waits through one render-gate probe that ignores scroll-driven animations - #5885
Merged
Conversation
…nores scroll-driven animations Firefox 159 gives a view-timeline animation, such as a margin card's message heads, a finite end time. Seven test and dev helpers each kept a copy of "a finite animation is still running" that read that as motion, so they waited out their 120 s limit whenever a margin card was open in Firefox; test_every_part_of_a_floating_box_moves_one_way_per_input[firefox] failed that way in the nightly run. The render gate's finiteMotion now counts only animations on a document timeline (the same rule #5846 proposes), and a new probe, restingIn, reads that motion within the elements its selectors name. The helpers in test_floating_box_motion, test_render_margin, test_composing, test_chrome_contracts and panel_paint wait on it. thread_journey's extra region wait is dropped, since the pageSettled wait before it already covers the same motion page-wide. The two helpers that already filtered on document.timeline, and CARD_AT_REST, which must also wait out motion held paused, keep their own readings. Closes #5880
max-sixty
added a commit
that referenced
this pull request
Nov 14, 2026
…ts, a gallery of thread cards by configuration (#5846) Every thread card and the comment box now open at the full measure (`--thread-card`, 592 px), or their room where that is narrower, whatever their messages hold. A card under or over its subject slides left where its start would carry it past the room's right edge, instead of narrowing. Two rules made long, thin cards before: - A card took the width of its first words and kept it while open. A short comment's box was 320 px wide, the card its Send opened kept that width, and the agent's long answer then wrapped at 320 px. - A card on a whole block started where its minimum width (`--thread-card-min`, 320 px) ended at the block's right edge, and could widen only rightward from there. On a block reaching the window's edge, it stayed at 336 px. Now a card neither narrows to its words nor widens as they arrive, so no arriving message moves its controls, and the width it remembered from its first stand is gone. It keeps a box's width only where Send opened it from that box, or the user carried it by its grip. The minimum width still decides which side has room. `placement-rules.json` states the width as `size-width` and the slide in `place-under-or-over`. `uv run leaf-dev placements` is the evidence. It opens a thread card in each case of a list and writes a gallery of where each card stands and how it's shaped. A case sets: - the subject a thread is on (quoted words or a whole block); - the thread's messages; - the route that opens its card (`m`, the margin marker, a tap, or a comment and Send); - what follows (the agent's answer arriving, a scroll); - its windows: 1728×999, 1440×900 and 1000×700, unless the case names others. At 1440×900 the margin beside a column is narrower than the measure, so a card beside its words there is as wide as that margin. Each case runs through `leaf_dev.visits`, the loop `leaf-dev probe` uses, so every size is what Leaf draws, and `--base` shows each case beside main. Each capture outlines the block Leaf resolves the thread to (`resolveAnchor`) and fills the quoted words. Each tile flags: - a card narrower than it could be, naming the limit: its unwrapped width, the measure, or its room; - a card covering its subject, marked a fault where card and block would fit in the window together; - how far the page scrolled as the card opened. Run with `--base` against main in its two original windows, the gallery's 13 cases show the change widening all eight narrow cards, and changing one other case: a short question in the 1000×700 window grows from 538 to 592 px. /developing-leaf points at the command beside `stills`. Running the gallery in Firefox exposed a render-gate defect: Playwright's Firefox 159 gives the scroll-driven animation on a margin card's message heads a finite end in time, so `pageSettled` never held while a card was open, and every `probe`, `stills` or journey that opened a card in Firefox waited out its 120 s limit. [#5885](#5885) fixed it on main the same way while this PR was open: `finiteMotion` counts only animations on a document timeline. This PR adds `test_a_scroll_driven_animation_leaves_the_page_settled` in `tests/browser/test_render_gate.py`, which checks that rule in Firefox beside the gate's other settle tests. Files: - `browser/runtime/annotation-overlay/thread-preview.js`, `comment-placement.js`, `annotation-chrome.css`, `placement-rules.json`, and `browser/runtime/thread/held-news.js`'s record: the full-measure width and the slide. - `tests/browser/test_render_send_placement.py`: Send and reopen now keep one rectangle. - `dev/leaf_dev/commands/placements.py`: the command, its fixture page and `CASES`; `dev/leaf_dev/states.py`: `open_card` returns the scroll before its click. - `tests/browser/test_render_gate.py`: the Firefox test of #5885's settle fix. - `.claude/skills/developing-leaf/SKILL.md`: when to run the command. > _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.
Firefox 159 gives a scroll-driven (view-timeline) animation, such as a margin card's message heads, a finite end time. Several test and dev helpers each kept their own copy of "a finite animation is still running", which read that animation as motion, so they waited out their 120 s limit whenever a margin card was open in Firefox.
test_every_part_of_a_floating_box_moves_one_way_per_input[firefox_browser]failed this way in the nightly run (#5880).This replaces those copies with one reading in the render gate:
finiteMotion(src/leaf/render-checks/runtime.js) counts only animations on aDocumentTimeline. The hunk is identical to the one in Open every thread card at the full measure, and add leaf-dev placements, a gallery of thread cards by configuration #5846, so whichever PR lands second merges cleanly over it.restingIn(...selectors), appliesfiniteMotionwithin the elements those selectors name, shadow trees included. A selector that matches nothing counts as at rest.at_restintest_floating_box_motion, the three card waits intest_render_margin, and the helpers intest_composing,test_chrome_contractsanddev/leaf_dev/panel_paint.pynow wait withwait_for_probe(page, "restingIn", …).thread_journey.observedrops its region wait. ThepageSettledwait just before it already covers the same motion across the whole page.render_harness's panel wait andmargin.CARD_AT_RESTalready filter ondocument.timeline, so they keep their own readings.CARD_AT_RESTalso has to wait out motion that is held paused, andrestingIndoesn't count paused motion.Verification. On main the Firefox case times out after 120 s in
at_restwith the falsifying example from the issue. With this change, both parametrizations oftest_floating_box_motion.pypass. These also pass: the editedtest_chrome_contracts/test_composingtests,test_render_thread_snapshots.py, thetest_render_floating_paneltests that usepanel_paint.settled,test_render_gate.py,pnpm run check:frameworkand ruff.test_render_gate.py::test_every_idiom_in_the_catalog_stands_in_a_corpus_sourcefailed in the selection the same way on unmodified main in Chromium, so this change doesn't cause it.test_margin_card_holds_its_top_while_read_and_its_reply_while_writtenfailed at the branch's original base because of its own outdated Send expectation. #5879 fixed that on main, and with main merged in it passes here, together withtest_floating_box_motion.py.Closes #5880 — automated triage