Skip to content

Paste check: stop calling spreadsheet cells and terminals "Not pasted" - #1926

Merged
r3dbars merged 1 commit into
mainfrom
claude/paste-check-narrow-roles
Sep 29, 2026
Merged

r3dbars merged 1 commit into
mainfrom
claude/paste-check-narrow-roles

Conversation

@r3dbars

@r3dbars r3dbars commented Sep 29, 2026

Copy link
Copy Markdown
Owner

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:

  • a selected cell in Numbers, Excel or Sheets
  • GPU terminals whose focus resolves to the window or a group (kitty, Alacritty, Ghostty, Warp)

So the text went in, the notice said "Not pasted", Auto Enter held Return, and the user's clipboard wasn't restored.

Fix

  • FocusedTextPasteConfirmationPolicy.nonTextEntryRoles now 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.
  • The Paste: a quick clipboard read isn't a paste when the focus can't take text #1888 case still works: a quick read while the focus is a web page body with no editable ancestor is still "Not pasted". I checked Chrome live with an AX probe: page-body focus reports AXWebArea, not settable, no editable ancestor. Paste: a quick clipboard read isn't a paste when the focus can't take text #1888's test for that case used AXGroup ("a page region"); I switched that row to AXWebArea, since AXGroup is exactly what Ghostty/Warp report.
  • Small overlay fix: if the user pressed ⌘V anywhere while "Not pasted" was up, the notice flipped to a green Pasted. Seeing the keypress proves nothing about where the words went. Now the notice just closes, the same way it does when you close it with X. There's no green check, no "Pasted" VoiceOver label, and the island doesn't show a "Pasted" linger. I didn't use a "Sent ⌘V" label because the user sent that keypress themselves, and keeping the recovery controls up after a manual paste invites a double paste. The only visual change is that the notice closes without a success flash.
  • Sources/Support/CLAUDE.md says 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

  • New table test with the role classification as a pure function. Rows: cell, row, table, window, group, outline, list, split group, tab group and scroll area never refute. Web area with no text box refutes. Web area with an editable ancestor, or with a settable value, doesn't. Static text, link, image, menu item and toolbar refute.
  • Mutation check: putting AXCell/AXWindow/AXGroup back in the set turns exactly those three rows red.
  • Paste: a quick clipboard read isn't a paste when the focus can't take text #1888's tests still pass (policy suite plus the paste-outcome suite with a fake focus).
  • bash run-tests.sh --filter ClipboardRestoringTextPaster: 298/298
  • bash 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.
  • Independent review of the full diff (not run yet)

Manual test list

Dictate a short phrase into each one with Auto Enter off, then again with it on where it applies:

  • Numbers: select a cell (don't enter edit mode) and dictate. Text lands, no "Not pasted", and your clipboard comes back.
  • Excel: same with a selected cell.
  • Google Sheets in Chrome: same with a selected cell.
  • kitty: dictate at a prompt. Text lands, no "Not pasted", and Auto Enter behaves as it did before Paste: a quick clipboard read isn't a paste when the focus can't take text #1888.
  • Ghostty: same.
  • Warp: same.
  • Alacritty (if installed): same.
  • Chrome page body: click on plain page text with no text box focused and dictate. You should still get "Not pasted" with your words.
  • Claude desktop: cursor outside the message box gives "Not pasted"; inside it gives Pasted (Paste: a quick clipboard read isn't a paste when the focus can't take text #1888's original case).
  • Muse: paste from the composer still counts (editable-ancestor case).
  • Manual ⌘V: trigger "Not pasted" (Chrome page body), then press ⌘V in a text box. The notice closes with no green "Pasted", and the words paste.

🤖 Generated with Claude Code

#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.
@r3dbars

r3dbars commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

Independent review (coordinator session, full diff vs main): APPROVE.

  • Narrowed set keeps Paste: a quick clipboard read isn't a paste when the focus can't take text #1888's web-page-body case refuted; containers (cell/row/table/window/group) now fall back to 1.1.66's likelyPasted, which never presses Auto Enter, so the worst case is an optimistic "Pasted" in Claude desktop when focus is outside the composer — same as 1.1.66.
  • Manual ⌘V now dismisses instead of claiming success: correct, no delivery evidence.
  • Table test pins both directions. Merge on green CI.

@r3dbars
r3dbars merged commit cc25766 into main Sep 29, 2026
8 checks passed
@r3dbars
r3dbars deleted the claude/paste-check-narrow-roles branch September 29, 2026 20:24
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.

1 participant