Skip to content

feat: add a mini shelf that opens at the text cursor - #26

Open
NigamDevansh wants to merge 1 commit into
tarikbc:mainfrom
NigamDevansh:mini-shelf
Open

NigamDevansh wants to merge 1 commit into
tarikbc:mainfrom
NigamDevansh:mini-shelf

Conversation

@NigamDevansh

Copy link
Copy Markdown
Contributor

Adds a mini shelf: a compact panel that opens right above the text cursor, so you can pick and paste without leaving where you're typing. Settings → General → Shelf Layout: Full / Mini picks what Open Copy opens, and an optional shortcut opens the other one.

  • Opens above the cursor, using Accessibility. If there's no room above, it opens below, and it always stays on screen. If the app doesn't report a cursor, it opens at the pointer.
  • Three sizes: Small, Medium and Large.
  • A vertical list of rows with small favorite and delete buttons. ↑ ↓ move, ↩ pastes, ⌥1–⌥9 paste directly, Space previews.
  • Floating buttons for search, the paste stack and the pinboard column. Cards can be dragged onto a pinboard in the column.
  • Runs on the same view model as the full shelf, so search, selection, the right-click menu, drag and drop, undo and the paste stack behave identically. The right-click menu and drag chip are now shared views.
  • Settings that only apply to the other layout are greyed out.

How you tested it

  • swift test --package-path CopyCore: all pass, including the new MiniShelfLayoutTests (above/below placement, screen edges, offset displays).
  • App tests pass.
  • Manually:
    • Opened the mini shelf in TextEdit, Notes, Safari's address bar, Slack and VS Code (pointer fallback), and near the top of the screen.
    • Pasted with ↩ and ⌥1–⌥9.
    • Favorite and delete.
    • Dragged a card onto a pinboard.
    • Search.
    • Paste stack, from the button and from the right-click menu.
    • All three sizes.
    • Checked the full shelf is unchanged.

Demo:

mini-shelf.mp4

  • Every commit is signed off (git commit -s, or turn on the hook once with git config core.hooksPath .githooks). The DCO check enforces this. See CONTRIBUTING.md.
  • Engine changes come with tests (swift test --package-path CopyCore)
  • CopyCore/Package.resolved still pins GRDB, KeyboardShortcuts and Sparkle

A compact shelf that opens above the text cursor (or at the pointer when the app reports none), chosen in Settings > General > Shelf Layout, with an optional shortcut for the other layout. It reuses the full shelf's view model, so search, selection, the card menu, drag and drop to pinboards, undo and the paste stack behave the same.

Signed-off-by: devansh nigam <devanshn02@gmail.com>

This branch has not been deployed

No deployments
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