Skip to content

Fix search-mode Command-Delete, silent paste failures, and buried pasted clips - #92

Open
alvst wants to merge 1 commit into
momenbasel:mainfrom
alvst:alvie/pr-16-paste-reliability
Open

Fix search-mode Command-Delete, silent paste failures, and buried pasted clips#92
alvst wants to merge 1 commit into
momenbasel:mainfrom
alvst:alvie/pr-16-paste-reliability

Conversation

@alvst

@alvst alvst commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Three things that make pasting feel unreliable: ⌘⌫ destroying a clip when you meant to clear the search, a paste that silently does nothing when Accessibility isn't granted, and a clip you just pasted staying wherever it was in history.

What changed

  • ⌘⌫ while a search query is being edited clears the query instead of deleting the selected clip. The cmd check previously ran before the search-text check, so it always won regardless of what was being typed.
  • A paste blocked by a missing Accessibility grant no longer no-ops silently: a once-per-launch alert explains the clip was still copied, that ⌘V pastes it manually, and links to the Accessibility pane. This is a common state — every rebuild invalidates the grant.
  • Pasting can promote the clip to the top of history, matching how Copy already behaves. It's a Behavior toggle; turning it off restores the old stay-in-place ordering.

Screenshots

Before:
00-baseline screenshots bar.png

After:
11-paste-reliability screenshots after.png

The ⌘⌫ fix has no visual delta — it's a key-handling correction, shown only by the query surviving the keystroke.

Notes for review

  • promoteOnPaste ships ON by default, and that's deliberate. Pasting a clip is a re-use of it, exactly like copying one, and Copy already reorders history this way — shipping the two with opposite defaults would be the inconsistency. It's a silent reordering for existing users, so it gets a Behavior toggle that restores the old ordering in one click. Happy to flip the default if you'd rather; the toggle exists either way.
  • The Accessibility alert is compiled out of the MAS build (the #if MAS branch never reaches it) — verified, so there's no App Store review surface here.
  • Merge-order note: alvie/pr-cmd-c-copy adds a byte-identical ClipboardStore.promoteCopiedItem(_:at:). Git puts them in different regions of the file, so it will not conflict — it will produce two identical methods and a redeclaration error. Whichever merges second, delete the duplicate.

This feature should be bundled into v2.

Part of #80.

Cmd-Delete while a search query is being edited now clears the query
instead of destroying the selected clip - previously the cmd check ran
before the search-text check, so it always won regardless of what was
being typed.

Direct paste blocked by a missing Accessibility grant no longer no-ops
silently: an alert (once per launch) explains the clip was still
copied, that Cmd-V pastes it manually, and links to the Accessibility
pane - a common state, since every rebuild invalidates the grant.

Pasting can now promote the clip to the top of history, matching how
Copy already behaves (reuses ClipboardStore.promoteCopiedItem, the
same method the Cmd-C branch adds - trivial to reconcile when both
merge). It's a Behavior toggle, on by default; turning it off restores
the old stay-in-place ordering.
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