Skip to content

Add clipboard paste button to send text dialog - #513

Open
Marshmellow31 wants to merge 1 commit into
schlagmichdoch:masterfrom
Marshmellow31:feat/clipboard-paste-button-492
Open

Marshmellow31 wants to merge 1 commit into
schlagmichdoch:masterfrom
Marshmellow31:feat/clipboard-paste-button-492

Conversation

@Marshmellow31

Copy link
Copy Markdown

Summary

Adds a Paste button to the send-text dialog so users can paste clipboard text directly into the message field.

Closes #492

Changes

  • Added a Paste button to the send-text dialog
  • Added clipboard reading using navigator.clipboard.readText()
  • Preserved the current caret/selection when clicking Paste
  • Added graceful handling when clipboard access is unavailable or denied
  • Reused the existing insertion logic for native paste and the new Paste button
  • Added the required English localization strings

Behavior

The Paste button:

  • inserts text at the current caret position
  • replaces selected text when a selection exists
  • appends text when no active caret is available
  • preserves multiline text and Unicode
  • leaves existing content unchanged when the clipboard is empty

Native Ctrl/Cmd + V behavior continues to work normally.

Verification

Tested:

  • normal text sending
  • clipboard paste into an empty field
  • paste with existing text
  • selection replacement
  • empty clipboard
  • multiline text
  • Unicode and emojis
  • denied clipboard permission
  • unavailable Clipboard API
  • existing native paste behavior
  • drag-and-drop behavior

Also ran:

node --check public/scripts/ui.js
git diff --check

Both completed successfully.

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.

[Enhancement] Clipboard paste button

1 participant