Skip to content

Wait for the margin card to rest before clicking Open in panel after a thread walk - #7126

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-7124
Nov 25, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-7124

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

After the second t press moves the margin card from the thread on p10 to the one on p40, the card glides from its old seat to its new one for about a dozen frames after the document's scroll has landed (box-motion's animations on .lf-margin-preview). test_back_returns_to_the_card_a_later_open_in_panel_left and test_a_rewrite_written_in_a_card_back_returned_to_reopens_there clicked Open in panel as soon as the card's data-lf-thread named the second thread, which happens before the glide. On CI's runner in run 45539313453, Playwright's click hit p41 beside the moving card, and the card closed. Both tests now wait for the scroll to settle and for the card to rest (CARD_AT_REST, tests/browser/margin/__init__.py, which the card-reply tests already use) before clicking. The product is unchanged: a card moving to its new passage is the designed glide, not motion left over from the step.

Verification: a probe that sampled the card in the original ordering found it still animating when the click was issued, and found it at rest once the new waits ran. The failure itself didn't reproduce locally (12 of 12 passed under leaf-dev suite flake --load 2 --cpu-throttle 6, and slowing animations through CDP made Playwright wait the motion out). Both tests pass in Chromium and Firefox, and in the wide and narrow windows, with the change.

Closes #7124 — automated triage

…a thread walk

After `t` steps from the thread on p10 to the one on p40, the card glides from its
old seat to its new one for about a dozen frames after the scroll lands. Two tests
clicked Open in panel as soon as the card named the second thread, so on a slow
runner the click could land on the page beside the moving card and dismiss it. They
now wait for the scroll and the card's motion to end (`CARD_AT_REST`) first. No
product behavior changes.

Closes #7124
@leaf-agent
leaf-agent merged commit 284f7c7 into main Nov 25, 2026
7 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-7124 branch November 25, 2026 06:22
leaf-agent added a commit that referenced this pull request Nov 25, 2026
…fter Back (#7197)

`test_a_rewrite_written_in_a_card_back_returned_to_reopens_there[browser]`
double-clicked the first message in the card Back reopens as soon as the
card named its thread. The card is still gliding into its seat at that
moment, so in [run
45706289846](https://github.com/max-sixty/leaf/actions/runs/45706289846)
the double-click landed on `p18` beside it ("subtree intercepts pointer
events"), the card closed ("element is not visible" for the rest of the
120 s timeout), and the test failed. The test now waits for the scroll
and the card's motion to settle (`scroll_settled` and `CARD_AT_REST`)
before the double-click, as #7126 did for the Open in panel click
earlier in the same test. This changes the test only; the glide is the
card's designed motion, as #7124's diagnosis found.

Verification: a probe evaluating `CARD_AT_REST` just before the
double-click read `false` in all 6 runs (3 runs × Chromium and Firefox)
on the old ordering and `true` with the wait added. The original timeout
didn't reproduce locally, so the evidence is the ordering rather than a
before-and-after failure. Both engines of this test and of
`test_back_returns_to_the_card_a_later_open_in_panel_left` pass.

Refs #7196 — automated triage

Co-authored-by: leaf-agent <[email protected]>
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_back_returns_to_the_card_a_later_open_in_panel_left: Open in panel click lands while the margin card is still moving

1 participant