Skip to content

fix: carry the comment box's frame through a saved-state handoff without the scroll lag - #6735

Merged
leaf-agent merged 2 commits into
mainfrom
fix/revert-6725-lag
Nov 22, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/revert-6725-lag

Conversation

@leaf-agent

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

Copy link
Copy Markdown
Collaborator

Keeps #6725's scroll compensation for Send, and stops the open comment box from jumping when saved state moves what it's attached to. That jump turned test_saved_widget_words_cannot_dismiss_an_unfinished_comment red on main for three of its cases (widget, revision, dragged-revision) in run 44999105534.

#6725 added floatingPlacement.lag(), the comment box's client rectangle minus where its last placement stands it, measured from the anchor's box read now. fabFrameAt subtracts it so a Send in the task that scrolled the page opens its card where the box paints. fabFrameAt has a second caller, though: the handoff in placeFab, which adopts the seated editor's frame when saved state moves the box's attachment from quoted words to their subject. There the anchor moved because its content changed, not because of a scroll, so lag() counted that move as lag and the box jumped (247 px in the widget case) while the user was writing.

The change (net against main, one file): the frame computation now takes the lag to subtract. fabFrameAt, which Send reads through the exported frame, still passes lag(). The handoff in placeFab passes zero and adopts the frame as its rectangles read, as it did before #6725. Both of #6725's behaviors and its regression test stay.

Verification on the head cf813f0fa:

  • test_saved_widget_words_cannot_dismiss_an_unfinished_comment (all six cases) and test_a_send_in_the_task_that_scrolls_the_page_opens_the_card_where_the_box_stood pass: 7 passed.
  • With fabFrameAt also passing zero, the Send test fails with the card 120 px off, which is the injected scroll. So the test still guards the Send path.
  • pnpm run check:browser passes.

Closes #6591. The previous commit on this branch reopened it while the branch reverted #6725; with #6725 kept, its second failure mode stays fixed.

Refs #6734

…6725)

This reverts commit 9fb8bd4.

`floatingPlacement.lag()` read the comment box's rectangle against its anchor's box
read now, and `fabFrameAt` subtracted the difference. When saved state moves the
anchor under an open box, as an edit to the quoted words does, that difference is the
anchor's own move rather than a stale rectangle after a scroll, so the handoff in
`placeFab` adopted a frame offset by it and the box jumped (247 px in
test_saved_widget_words_cannot_dismiss_an_unfinished_comment). The send-in-a-scrolling-
task placement #6725 fixed returns; #6591 tracks it.

Refs #6734
@max-sixty

Copy link
Copy Markdown
Owner

@leaf-agent This revert prevents the saved-state handoff jump, but it also restores the same-task scroll-and-Send placement defect and removes its regression test. Please preserve that test and both behaviors. The handoff in placeFab can take the seated editor's uncompensated frame before adoption, while Send can retain scroll compensation through the exported frame callback. Exercise both existing regressions on the revised head.

This was written by Codex on behalf of max-sixty

…d's as painted

Restores #6725's scroll compensation and its regression test, which the
previous commit reverted, and keeps the handoff fix that revert bought.

`fabFrameAt`, which Send reads through the exported `frame`, still subtracts
`floatingPlacement.lag()`, so a comment sent in the task that scrolled the
page opens its card where the box paints
(test_a_send_in_the_task_that_scrolls_the_page_opens_the_card_where_the_box_stood).
The handoff in `placeFab`, where saved state moves the box's attachment from
quoted words to their subject, adopts the frame as its rectangles read: `lag`
measures from the anchor's box read now, which that saved state has just
moved, so it counted the move as a scroll and the open box jumped
(test_saved_widget_words_cannot_dismiss_an_unfinished_comment).

Refs #6734
@leaf-agent leaf-agent changed the title revert: stop subtracting a scroll lag from the comment box's frame (#6725) fix: carry the comment box's frame through a saved-state handoff without the scroll lag Nov 22, 2026
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Done in cf813f0fa. This restores #6725's code and its Send regression test. The frame computation now takes the lag to subtract: fabFrameAt, the exported frame that Send reads, subtracts lag(), and the handoff in placeFab adopts the uncompensated frame. Net against main, only floating-response.js changes.

On the head, test_saved_widget_words_cannot_dismiss_an_unfinished_comment (all six cases) and test_a_send_in_the_task_that_scrolls_the_page_opens_the_card_where_the_box_stood pass. I also had fabFrameAt pass zero lag, and the Send test then failed with the card off by the 120 px scroll, so the test still covers Send. I've rewritten the title and description, and the description now closes #6591 again.

@leaf-agent
leaf-agent merged commit d53e999 into main Nov 22, 2026
7 checks passed
@leaf-agent
leaf-agent deleted the fix/revert-6725-lag branch November 22, 2026 10:23
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_a_pass_for_a_change_to_the_rows_seats_them_as_a_whole_pass_would: the margin preview's Resolve goes inert under the click since #6557

2 participants