Skip to content

fix: settle scoped motion waits through one render-gate probe that ignores scroll-driven animations - #5885

Merged
leaf-agent merged 2 commits into
mainfrom
fix/issue-5880
Nov 12, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/issue-5880

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

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 a DocumentTimeline. 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.
  • A new probe, restingIn(...selectors), applies finiteMotion within the elements those selectors name, shadow trees included. A selector that matches nothing counts as at rest.
  • at_rest in test_floating_box_motion, the three card waits in test_render_margin, and the helpers in test_composing, test_chrome_contracts and dev/leaf_dev/panel_paint.py now wait with wait_for_probe(page, "restingIn", …).
  • thread_journey.observe drops its region wait. The pageSettled wait just before it already covers the same motion across the whole page.

render_harness's panel wait and margin.CARD_AT_REST already filter on document.timeline, so they keep their own readings. CARD_AT_REST also has to wait out motion that is held paused, and restingIn doesn't count paused motion.

Verification. On main the Firefox case times out after 120 s in at_rest with the falsifying example from the issue. With this change, both parametrizations of test_floating_box_motion.py pass. These also pass: the edited test_chrome_contracts/test_composing tests, test_render_thread_snapshots.py, the test_render_floating_panel tests that use panel_paint.settled, test_render_gate.py, pnpm run check:framework and ruff. test_render_gate.py::test_every_idiom_in_the_catalog_stands_in_a_corpus_source failed 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_written failed 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 with test_floating_box_motion.py.

Closes #5880 — automated triage

…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
@leaf-agent
leaf-agent merged commit 553e614 into main Nov 12, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5880 branch November 12, 2026 09:09
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_
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.

test_every_part_of_a_floating_box_moves_one_way_per_input[firefox]: at_rest never settles under Firefox 159's view-timeline end time

1 participant