Skip to content

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

Open

Description

@calumk

What is broken

Two related failures, both silent:

  1. Pasting image files does nothing. Cmd+V is intercepted by the container keydown handler, which preventDefault()s it and routes to pasteFromClipboard() (async Clipboard API). That kills the native paste event — the one event carrying Finder files in clipboardData.files. The async API generally does not expose local file references, so file paste falls into the void. Screenshots via the event's items are likewise never read (the paste handler only checks files).
  2. Shape copy/paste dies without clipboard permission. Copy writes only to the system clipboard; paste reads it back via clipboard.read()/readText(). If the clipboard-read permission is blocked, both fail inside bare catch {} blocks — copy/paste is dead with zero feedback, while Duplicate (in-memory) keeps working.

Proposal

  • In-memory clipboard as primary: copies keep a shared payload, paste prefers it — same-page editing works offline and permission-free (including across boards on one page).
  • Stop intercepting Cmd+V; unify all paste on the native paste event: files, then raw image data via items.getAsFile(), then the memory payload, then Quickdraw JSON text. No permissions needed for the event paths.
  • Audible failures: the silent catches now warn.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions