Skip to content

0.9.3: paste images, drop files - #37

Merged
Ege-BULUT merged 2 commits into
mainfrom
paste-and-drop
Oct 27, 2026
Merged

Ege-BULUT merged 2 commits into
mainfrom
paste-and-drop

Conversation

@Ege-BULUT

Copy link
Copy Markdown
Owner

Paste a copied image (web, desktop, Android). A screenshot or an image copied in another app goes into the message with Ctrl+V / ⌘V in the message box. The paste handler takes the clipboard's files when the paste has no text with it, because a range copied from a sheet also carries a picture of itself. A pasted image has no name of its own: browsers call it image.png, and Android's are named after a number. So each one is named image-<local date and time>.png.

On Android the WebView's text box offers no Paste when the clipboard holds only an image, and the page may not read the clipboard (navigator.clipboard.read() is denied). A small plugin, ClipboardImagePlugin.java, does the reading:

  • has() looks only at the clip's description, because reading the clip itself makes Android show its "pasted" notice.
  • read() returns the image's type and bytes.

Tapping 📎 with an image on the clipboard asks "You copied an image — Paste it / Choose a file". Without an image, 📎 opens the file picker as before. A keyboard's Ctrl+V works there too.

Drag and drop (web, desktop). Files dropped on a chat join the message, and a dashed "Drop to add to your message" shows while dragging. A file dropped anywhere else is ignored, so the browser or Electron doesn't open it in place of the app.

Tests

  • test/app.e2e.mjs files:
    • a pasted image is added and renamed
    • a paste with text pastes the text
    • the drop hint shows
    • a drop adds the file
    • a drop outside a chat is not opened
    • both files are sent
  • test/android/paste.mjs, on an emulator. The app runs in a chat against the in-memory GitHub, with its requests caught through DevTools so none leave the machine. Chrome copies a real image from a page the test serves. Then:
    • 📎 offers Paste and adds the image
    • Ctrl+V adds it
    • both are sent and arrive as PNGs
    • the chat stays open after switching to Chrome and back

The usage guide (EN+TR) and the changelog (EN+TR) are updated.

@Ege-BULUT
Ege-BULUT merged commit 9351343 into main Oct 27, 2026
1 check passed
@Ege-BULUT
Ege-BULUT deleted the paste-and-drop branch October 27, 2026 06:53
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