Skip to content

Clipboard overhaul: memory-first copy/paste, unified paste event - #40

Open
calumk wants to merge 1 commit into
quickdrawjs:mainfrom
calumk:clipboard-overhaul
Open

calumk wants to merge 1 commit into
quickdrawjs:mainfrom
calumk:clipboard-overhaul

Conversation

@calumk

@calumk calumk commented Nov 1, 2026

Copy link
Copy Markdown

Fixes #39.

  • Copies keep a shared in-memory payload (Editor.localClipboard, so boards on one page exchange shapes); paste prefers it — no permissions, works offline and when clipboard access is blocked.
  • Cmd+V is no longer intercepted, so the native paste event fires and one handler covers everything: image files (Finder copies, previously eaten), raw image data via items.getAsFile() (screenshots), the memory payload, then Quickdraw JSON text.
  • Silent catch {} blocks now warn. pasteFromClipboard() stays as a public API with the same order minus event-only sources.
  • Tests: memory copy/paste with no clipboard API present, file paste, items paste, JSON-text paste, and Cmd+V left to the event. 143 core tests green.

Copy/paste no longer depends on the clipboard-read permission: copies keep
a shared in-memory payload and paste prefers it, so same-page editing works
offline and when access is blocked. Cmd+V is no longer intercepted, letting
the native paste event carry Finder files (previously eaten) and raw image
data via items.getAsFile (screenshots); quickdraw JSON still pastes from
text. Silent catch blocks now warn.
@vercel

vercel Bot commented Nov 1, 2026

Copy link
Copy Markdown

@calumk is attempting to deploy a commit to the naman's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Clipboard overhaul: pasting files does nothing, copy/paste dies without permission

1 participant