Repository navigation
test: keep a carry's first step when the shift watch sees box-motion re-time it - #6649
Merged
Merged
Conversation
When box-motion cancels a running carry and begins a replacement from where it was drawn, as when a second message lands in the thread view mid-carry, the shift watch's continueMotion gave the replacement the cancelled carry's ledger, beginning and owners, but beginsOwned then gave it a carrySteps entry of its own, dated at the re-time. carriesWithin read that entry, so it judged the one trajectory against a mid-carry reading instead of the reading before the step that began it, and the run comparison found the thread view's head and messages moved without input. The replacement now keeps the cancelled carry's step whenever it is itself a carry. New test: test_a_reply_that_lands_mid_carry_continues_it stretches the thread view's carry to 1500 ms so the second message always lands in it. It fails on the old watch (the back button and messages "moved without input by (0, 110)px") and passes with this change. Closes #6553
max-sixty
pushed a commit
that referenced
this pull request
Nov 22, 2026
…ding in the shift watch (#6729) The shift watch refused box-motion's carry of the thread view's growth when the carry's first animation sample came from a read that reads no nodes. It then reported the panel's head and messages as "moved without input" by the whole step. This is the 1-in-40 failure of `test_a_website_turn_posts_its_answer_when_the_move_is_settled_first[here]` on CI's Mac. `carriesWithin` now reads where the step put the node at the node's first reading once the carry drew, instead of at the carry's first sample. **Cause.** When the last reading before a carry already holds the layout step, `carriesWithin` steps back one reading to find where the node stood before it. It recognises that reading by comparing it with `landed`: the node's layout at the carry's first sample (`animated[1].at`), net of the carry. Some reads sample animations without reading nodes, such as the cancel that re-times a carry ([`Animation.prototype.cancel`](https://github.com/max-sixty/leaf/blob/3da4a81ee84139cfa1e881780038fa0c2ead2a18/tests/shift_watch.js#L1473)). When the first sample comes from one of those reads, the node's ledger at that time still holds it where it stood before the carry drew. So `landed` came out as the step less the carry, the held reading never matched it, and the comparison started from the grown layout. **Evidence.** A [macOS flake run](https://github.com/max-sixty/leaf/actions/runs/44995326673) on main plus logging (`exp/6609-carries`) failed 1 of 54 copies. For the Back button it logged readings 723 → 646 → 723, carry began 1890.4, first sample 1941.3, and the node's carried reading at 1942.9. That gives `landed` 569 = 646 − 77, which doesn't match the held 646, so the carry was refused. The same comparison with the landing read at 1942.9 gives 723 − 77 = 646, which matches. **Test.** The new `retimed` case of `test_a_carry_draws_the_way_of_a_step_news_may_take` cancels the carry and begins it again in the delivery that began it. It fails on main 3 of 3 runs (`button#head` moved without input by (0, 40)) and passes with the change. The other carry cases, including the faulted ones that must still fail, and #6649's `test_a_reply_that_lands_mid_carry_continues_it` pass (61 tests). Whether the journey test is clean on the Mac is left to a 54-copy flake dispatch on this branch. Closes #6609 — automated triage Co-authored-by: leaf-agent <[email protected]>
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.
When box-motion re-times a running carry (it cancels it and begins a replacement from where it was drawn, as when a second message lands in the thread view mid-carry), the shift watch now keeps the cancelled carry's step on the replacement. Before this change,
continueMotionhanded the replacement the cancelled carry's ledger, beginning and owners, and thenbeginsOwnedgave it a freshcarryStepsentry dated at the re-time.carriesWithinreads that entry, so it judged the whole trajectory against a mid-carry reading instead of the reading before the step that began it. It then refused the credit, and the run comparison reported the thread view's head and messages as "moved without input".The new test
test_a_reply_that_lands_mid_carry_continues_itstretches the thread view's--lf-motion-box-resizeto 1500 ms so the second message always lands inside the first carry. On the old watch it fails every run (button.lf-fp-back … moved without input by (0, 110)px); with this change it passes. Instrumenting the old watch on that run showed the mechanism directly: the original carry was entered as{began: 3180, step: 3128}, the replacement as{began: 3595, step: 3481}, and every uncredited comparison had carry terms but failedcarriesWithinagainst the replacement's entry.The CI failure in #6553 (1 px,
test_new_reply_leads_to_the_reply_once_one_follows_the_work) has the same signature: its carry was still 1 px off 306 ms after its recordedbegan, which a single 300 ms carry can't produce, so it had been re-timed. That run wasn't reproduced at its original timing, so the link to the CI failure is inferred from the evidence rather than replayed.Checks run
test_new_reply_leads_to_the_reply_once_one_follows_the_workandtest_a_streaming_answer_grows_the_view_until_it_outgrows_its_cap, 3 runs each: all pass.tests/browser/test_render_shift_watch.py -k "carr or cancel or continu or replac or replay or news or step or ride or resum or revers": 95 passed.Closes #6553 — automated triage