Skip to content

Add standard shelf keyboard actions - #1

Merged
tarikbc merged 3 commits into
tarikbc:mainfrom
brzvsk:feat/shelf-keyboard-actions
Sep 11, 2026
Merged

tarikbc merged 3 commits into
tarikbc:mainfrom
brzvsk:feat/shelf-keyboard-actions

Conversation

@brzvsk

@brzvsk brzvsk commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Hi! A little backstory: my Paste subscription came up for renewal, and I realized I was not ready to keep paying for it. I asked my Codex agent to look for alternatives; among several similar projects, Copy was the one I liked most. I would be happy to contribute improvements here—straightforward fixes as pull requests, and more opinionated ideas as issues.

What changed

  • Backspace deletes the selected shelf card while preserving normal search editing
  • Cmd+C copies the primary card to the clipboard and closes the shelf on success
  • Cmd+V pastes the selected card
  • Cmd+, opens the real Settings window instead of the placeholder SwiftUI scene
  • README documents the new shelf shortcuts
  • A successful shelf Cmd+C emits a lightweight completion event used by optional feedback in Add optional clipboard capture sounds #3; without Add optional clipboard capture sounds #3 it is a no-op

Testing

  • swift test --package-path CopyCore --disable-automatic-resolution — 184 tests passed
  • Debug app target builds successfully with Xcode 26.6
  • Installed and launched a locally signed Debug build using the existing bundle identifier

brzvsk and others added 3 commits September 10, 2026 22:06
…field

Three corrections to the new shelf shortcuts.

⌘C acted on `primaryItem` while ⌘V and ⌘⌫ both act on the whole selection,
so it was the one multi-select gesture that quietly did something else.
`copySelection` now mirrors `pasteSelection`: one card copies its full
representations, several copy their joined text, because the pasteboard
holds one item at a time.

⌘C and ⌘V now only claim the key when the search box is empty. The shelf
keeps that field focused at all times, so the unguarded versions took the
one key needed to paste a search term in and to copy it back out. With
text in the field both fall through to `default`, which is what Backspace
in the same switch already does.

Drops the notification the copy posted. Nothing listened to it here, the
app defines no other `Notification.Name`, and the sound feature can call
its player from `copyToClipboard` directly instead of going through a
stringly-typed event.
@tarikbc
tarikbc force-pushed the feat/shelf-keyboard-actions branch from 4cd6bf6 to 62df2a1 Compare September 11, 2026 01:08
@tarikbc

tarikbc commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Good first contribution, and thanks for the backstory. The Backspace handling in particular is right: it lets the existing pill handler run first and returns false when there is search text, which is the shape the rest of that switch wants.

I rebased on main and pushed one commit with three corrections:

  1. ⌘C ignored multi-select. It used primaryItem, while ⌘V (pasteSelection) and ⌘⌫ (deleteSelection) both act on the whole selection. That made ⌘C the one multi-select gesture that quietly did something narrower. There is now a copySelection() mirroring pasteSelection: one card copies its full representations, several copy their joined text.

  2. ⌘C and ⌘V took the search field. The shelf keeps that field focused at all times, so as written a user could no longer paste a search term in, or copy one back out. Both now only claim the key when the search box is empty, and otherwise fall through to default for the field to handle, exactly as your Backspace case does.

  3. Dropped the notification. Nothing in this PR listened to it, and the app defines no other Notification.Name. Add optional clipboard capture sounds #3 can call its player from copyToClipboard directly, which I will do when I merge it.

I kept the ⌘, settings fix even though it is unrelated to the title. It is a real fix and splitting it now would be churn. Worth its own PR next time.

Builds clean, 187 tests pass. Merging.

@tarikbc
tarikbc merged commit 6eaa7ca into tarikbc:main Sep 11, 2026
1 check passed
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