Files
feishin/src/renderer/features/sharing
Ilya Shurupov b6519e9839 fix(sharing): copy share link to clipboard from within the user gesture (#2135)
The share URL is only known after the create-share request resolves, so the
previous navigator.clipboard.writeText() in the mutation onSuccess callback ran
outside the originating click's user activation. Firefox and Safari reject such
writes ('Clipboard write was blocked due to lack of user activation'), so the
link was never copied (and the toast still claimed success).

Issue clipboard.write() synchronously inside the submit gesture with a
ClipboardItem whose text/plain value is a promise resolving to the share URL,
which preserves the user activation while the share is created. Falls back to
writeText, and finally to the existing 'click to open' toast when the clipboard
is unavailable or blocked, with the toast text reflecting whether the copy
actually succeeded.

Co-authored-by: ilusha <ilusha.basic@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 22:03:38 -07:00
..