Skip to content

Put a drag's words back at its release, so a key pressed before the next frame finds them - #7578

Merged
max-sixty merged 1 commit into
mainfrom
drag-putback-sync
Nov 29, 2026
Merged

max-sixty merged 1 commit into
mainfrom
drag-putback-sync

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A drag released over the page's chrome puts back the words it held while the hand was still on them. That put-back ran a frame later, with the snap, so a key pressed first, such as c to comment, read the browser's own selection and cancelled the deferred put-back. This went unseen while every widget drew after its words, since the browser's far end then still held them.

Drawing a light widget's box first (#7572) put the draft's toolbar before its words. A drag along a draft's line released over its Copy button now leaves only a newline selected, so c opens no comment box. test_saved_widget_words_cannot_dismiss_an_unfinished_comment has failed on main since #7572 (bisected: it passes on #7572's parent).

The release now puts the range back and remembers it at once, as a release inside the words already did; only the snap waits for the frame. That covers any widget whose drawing stands before its words, such as a tab strip.

Tests: the draft test and the drag-overshoot tests in test_render_anchors.py pass, and pnpm run test:runtime. A probe of the same drag then c: in Chromium, main ends holding a newline and opens no box, and this branch holds the words and opens it; Firefox, whose selection never ended on the toolbar, opens it on both.

This was written by Claude Code on behalf of max-sixty

…ext frame finds them

A drag released over the page's chrome puts back the words it held while
the hand was still on them. That put-back ran in the next frame, with the
snap, and a press that arrived first, such as `c` to comment, superseded
it: the key read the browser's own selection, and the deferred put-back
was cancelled. The words came out right only where the browser's far end
already held them, as it did while a widget drew after its words.

Drawing a light widget's box first (#7572) put the draft's toolbar before
its words. A drag along a draft's line released over its Copy button now
ends the browser's selection before the words, holding only a newline, so
`c` opened no comment box (`test_saved_widget_words_cannot_dismiss_an_unfinished_comment`,
failing on main since #7572).

The release now restores the remembered range and remembers it as the
gesture's selection at once, as a release inside the words already does;
only the snap waits for the frame. So any widget whose drawing stands
before its words, such as a tab strip, keeps the drag's passage.

> _This was written by Claude Code on behalf of max-sixty_
@max-sixty
max-sixty merged commit df4a42c into main Nov 29, 2026
7 checks passed
@max-sixty
max-sixty deleted the drag-putback-sync branch November 29, 2026 02:11
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.

2 participants