Repository navigation
Put a drag's words back at its release, so a key pressed before the next frame finds them - #7578
Merged
Merged
Conversation
…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_
leaf-agent
approved these changes
Nov 29, 2026
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.
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
cto 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
copens no comment box.test_saved_widget_words_cannot_dismiss_an_unfinished_commenthas 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.pypass, andpnpm run test:runtime. A probe of the same drag thenc: 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.