Skip to content

feat: copy image and text files to the clipboard from the file page - #194

Merged
polyrainbow merged 1 commit into
mainfrom
feat/copy-file-to-clipboard
Oct 14, 2026
Merged

polyrainbow merged 1 commit into
mainfrom
feat/copy-file-to-clipboard

Conversation

@polyrainbow

Copy link
Copy Markdown
Owner

Adds a Copy to clipboard header button on the file page, shown for image and text files.

  • Images: the async clipboard only accepts image/png, so JPEG, WebP, GIF and SVG are drawn onto a canvas and encoded as PNG first. Animated GIFs copy their first frame. The PNG is passed to ClipboardItem as a promise so the write starts while the click's user activation is fresh.
  • Text: copied as plain text.
  • The button shows a checkmark and "Copied" for 1.5 s after copying.
  • New strings in en-US and de-DE.

Known limitation: an SVG with no intrinsic width/height may rasterize to an empty image.

Lint, type check, build and i18n tests pass; not yet tried in the running app.

🤖 Generated with Claude Code

Adds a "Copy to clipboard" header button on the file page for image
and text files. Images are rasterized to PNG first, since the async
clipboard only accepts image/png.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@polyrainbow
polyrainbow merged commit 3ae0b4b into main Oct 14, 2026
6 checks passed
@polyrainbow
polyrainbow deleted the feat/copy-file-to-clipboard branch October 14, 2026 11:50
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