Repository navigation
Paste check: stop calling spreadsheet cells and terminals "Not pasted" - #1926
Merged
Merged
Conversation
#1888 overruled a quick clipboard read when the focus role was in a set that included AXCell, AXRow, AXTable, AXWindow, AXGroup and other containers. Selected spreadsheet cells and GPU terminals (kitty, Alacritty, Ghostty, Warp) report exactly those roles and do take a paste, so the text landed while the notice said "Not pasted", Auto Enter held Return, and the clipboard wasn't restored. The set now holds only roles that can't be a paste target: a web page body, static text, links, images, button-like controls, menus and toolbars. The web page body case #1888 fixed (Claude or Chrome with no text box focused) still reads as not pasted. Also: the user's own Cmd+V while "Not pasted" is up no longer flips it to a green "Pasted". The keypress proves nothing about delivery, so the notice just closes.
Owner
Author
|
Independent review (coordinator session, full diff vs main): APPROVE.
|
7 of 8 tasks
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 dictation into a selected spreadsheet cell or a GPU terminal could land fine and still say Not pasted.
Why
#1888 made a quick clipboard read stop counting as a paste when the focus plainly can't take text. Its role list included containers: AXCell, AXRow, AXTable, AXOutline, AXList, AXGroup, AXWindow, AXSplitGroup, AXTabGroup (plus AXScrollArea and AXApplication). Real paste targets report exactly those:
So the text went in, the notice said "Not pasted", Auto Enter held Return, and the user's clipboard wasn't restored.
Fix
FocusedTextPasteConfirmationPolicy.nonTextEntryRolesnow lists only roles that can't be a paste target: AXWebArea, AXStaticText, AXLink, AXImage, button-like controls (AXButton, AXCheckBox, AXRadioButton, AXPopUpButton, AXMenuButton, AXDisclosureTriangle, AXSlider), and menus/toolbars (AXMenu, AXMenuItem, AXMenuBar, AXMenuBarItem, AXToolbar). The existing escape hatches are unchanged: a settable value or an editable ancestor always counts as text entry.Sources/Support/CLAUDE.mdsays why containers must stay out of the set.Known gap
If some app focuses a plain AXGroup (not the page body) when no text box has focus and still reads the clipboard on ⌘V, that case is back to "likely pasted". We accepted that on purpose: a missed "Not pasted" is cheaper than a false one on a real paste. Worth checking Claude desktop by hand (see below).
Tests
bash run-tests.sh --filter ClipboardRestoringTextPaster: 298/298bash check.sh: build,run-tests.sh(19995/19995),run-slow-pasteback-smoke.sh(11/11), test shape, concurrency census, source pins, doc paths. Deterministic proof PASS.Manual test list
Dictate a short phrase into each one with Auto Enter off, then again with it on where it applies:
🤖 Generated with Claude Code