Repository navigation
Credit a gesture with the carry its own layout begins in its first frame's ResizeObserver delivery - #6020
Merged
Conversation
…zeObserver delivery The shift watch credits a gesture with the motion it begins, which it collects at each frame's tick: the effects begun since the gesture, while no news has landed. A floating box follows its own layout through a ResizeObserver (box-motion.js), so the carry a send's reply sets going begins in the delivery of the frame the send draws in, after that frame's tick. When the server's answer was stamped before the next tick, as it is within a long frame, news had sealed the gesture's credit and the next tick took nothing; the carry, often finished by then too, was nobody's, and the panel's head moving with it read as moved without input. test_one_field_starts_a_thread_takes_its_reply_and_settles_it failed so on macOS (back button "moved without input by (0, -39)px"). A probe on a failing run put the reply's draw at 2300ms, the next tick at 2319ms, box-motion's reading and its carries at 2379-2392ms in that frame's delivery, the answer's stamp at 2416ms, and the next tick, which found the gesture sealed, after it. box-motion reads on time; the watch's collection missed the delivery. The watch now owns, as it begins, an effect a ResizeObserver delivery begins in the frame the gesture first draws in, while no news has landed. The runtime holds news that arrives while a gesture is unresolved until that frame paints (state-application.js, `afterOwedFrame`), so that delivery carries none of news's layout, and a carry following the news's own layout, in a later delivery, is still reported. Two arms of the press-versus-news stand-in hold both: the press's delivery with news before the next tick passes (main's watch fails it 3 of 3), and the news's delivery three frames on still fails. On this Mac's efficiency cores (`taskpolicy -b`) the one-field test passes 16 of 16 with this change, and main's watch fails it 7 of 16 in the same conditions, each time the back button moving 1 to 53px. Part of #5780. > _This was written by Claude Code on behalf of max-sixty_
leaf-agent
approved these changes
Nov 15, 2026
This was referenced Nov 15, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 23, 2026
…me's ResizeObserver delivery (#6854) The flake in #6736 is in the shift watch, not in the panel. The watch credits a rendering with an effect a ResizeObserver delivery begins in the frame that rendering first draws in, as the effect begins (#6020), so a server reading that lands before the next tick cannot seal the rendering first. That rule covered only the open input rendering, not a widget preparation's landing. A pasted image in an open thread lands through a preparation, and the floating panel's `.lf-fp-head` carry begins in that landing's first delivery. If the reading landed between that `animate` call and the next tick, the landing was sealed before its tick could collect the carry. The carry stayed unowned, so releasing the held carry read as the Back, Resolve and Close buttons moving 124 px without input. Landings now note the frame they first draw in (`drawsIn`), and `deliveredBy` gives each unsealed rendering drawing in that frame, open or landing, the effects its delivery begins. **Evidence:** - A probe run showed the order in a failing run: carry begun at 4845 ms with a landing open and no input rendering, the reading landed at 4871 ms, and the next tick at 4873 ms found the landing sealed. In a passing run the tick came first. - `test_a_carry_a_landing_s_own_layout_begins_is_the_input_s_though_news_lands`, a new test in `test_render_shift_watch.py`, reproduces that order deterministically. It fails 3 of 3 on main's watch (`button#control moved without input`) and passes 5 of 5 with the fix. - `test_an_image_pasted_in_an_open_thread_stands_between_the_thread_and_the_box[key]`, run alone one at a time: 6 of 20 errored on main, 0 of 20 with the fix. - The shift-watch tests covering landings, preparations, news, carries and deliveries pass (74), as do the floating panel's paste cases. Closes #6736 — 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.
test_one_field_starts_a_thread_takes_its_reply_and_settles_itfails on macOS with the panel's back button "moved without input" by 1 to 53px. The cause is in the shift watch, not in box-motion.The watch credits a gesture with the motion it begins, collected at each frame's tick until news lands. A floating box follows its own layout through a ResizeObserver, so the carry a sent reply starts begins in the delivery of the frame the send draws in, after that frame's tick. When the server's answer is stamped before the next tick, as it is within a long frame, news has sealed the gesture's credit, the next tick collects nothing, and the head's carry reads as passive. A probe on a failing run shows the order: reply drawn 2300ms, tick 2319ms, box-motion's reading and carries 2379–2392ms in that frame's delivery, the answer's stamp 2416ms, next tick after it.
The watch now owns, as it begins, an effect that a ResizeObserver delivery begins in the frame the gesture first draws in, while no news has landed. The runtime holds news that arrives while a gesture is unresolved until that frame paints (
afterOwedFrame), so that delivery carries none of news's layout. A carry that follows the news's own layout, in a later delivery, is still reported.test_render_shift_watch.py: the press's delivery with news before the next tick passes, where main's watch fails it 3 of 3. The news's delivery three frames later still fails, as it should.taskpolicy -b), the one-field test passes 16 of 16; main's watch fails it 7 of 16 in the same conditions.pnpm run checkandpnpm run test:runtime(974).Part of #5780.