fix: support native clipboard image paste on mobile #181

Merged
hodlbod merged 2 commits from Khushvendra/flotilla:issue-54-paste-image into dev 2026-04-11 16:38:07 +00:00
Contributor

This fixes image pasting from clipboard on mobile WebViews where the standard HTML5 paste event does not provide image file data. The implementation adds a native clipboard fallback for Android and iOS while preserving normal paste behavior everywhere else.

Summary
This fixes image pasting from clipboard on mobile WebViews where the standard HTML5 paste event does not provide image file data. The implementation adds a native clipboard fallback for Android and iOS while preserving normal paste behavior everywhere else.

Closes #54

Changes

Behavior

  • Standard paste flow remains first priority.
  • Native clipboard fallback only runs when the normal paste payload is effectively empty.
  • If native clipboard contains an image, it is converted to a File and inserted through the existing upload flow, so editor UI and upload handling remain consistent.
  • No explicit paste icon UI was added. This is system-standard paste only (long-press Paste / keyboard paste), per maintainer decision.
This fixes image pasting from clipboard on mobile WebViews where the standard HTML5 paste event does not provide image file data. The implementation adds a native clipboard fallback for Android and iOS while preserving normal paste behavior everywhere else. **Summary** This fixes image pasting from clipboard on mobile WebViews where the standard HTML5 paste event does not provide image file data. The implementation adds a native clipboard fallback for Android and iOS while preserving normal paste behavior everywhere else. Closes #54 **Changes** * Added Capacitor clipboard support in [`package.json:45`](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/workbench.html) * Added Tiptap ProseMirror package in [`package.json:45`](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/workbench.html) * Added native clipboard paste fallback logic in [`index.ts:43`](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/workbench.html) * Wired a ProseMirror handlePaste plugin into the editor extensions in [`index.ts:283`](vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/workbench.html) **Behavior** * Standard paste flow remains first priority. * Native clipboard fallback only runs when the normal paste payload is effectively empty. * If native clipboard contains an image, it is converted to a File and inserted through the existing upload flow, so editor UI and upload handling remain consistent. * No explicit paste icon UI was added. This is system-standard paste only (long-press Paste / keyboard paste), per maintainer decision.
Owner

Looks good, can you just move the clipboard utils to editor/clipboard to keep things clean?

Looks good, can you just move the clipboard utils to editor/clipboard to keep things clean?
hodlbod added 2 commits 2026-04-11 16:38:00 +00:00
hodlbod force-pushed issue-54-paste-image from 7b206c0566 to 77784ffff5 2026-04-11 16:38:00 +00:00 Compare
hodlbod merged commit f6d9e52c6e into dev 2026-04-11 16:38:07 +00:00
hodlbod deleted branch issue-54-paste-image 2026-04-11 16:38:07 +00:00
Sign in to join this conversation.