fix: copying created links in Safari#1594
Merged
JammingBen merged 2 commits intomainfrom Nov 13, 2025
Merged
Conversation
f013794 to
fb5d67b
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors clipboard operations for link creation to support Safari's clipboard API requirements. Safari requires that clipboard writes occur within the same user interaction as the triggering event, so the link creation logic is now embedded directly within the clipboard operation instead of happening before it.
Key Changes:
- Created a new
useCopyLinkcomposable that handles link creation and clipboard copying in a single user interaction - Deprecated the existing
useClipboardcomposable in favor of using VueUse's implementation directly or the newuseCopyLinkfor links - Removed the callback pattern from
CreateLinkModalsince copying is now handled internally
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/web-pkg/src/composables/links/useCopyLink.ts | New composable implementing Safari-compatible clipboard operations for link creation |
| packages/web-pkg/src/composables/links/index.ts | Exports the new useCopyLink composable |
| packages/web-pkg/src/composables/clipboard/useClipboard.ts | Added deprecation notice to existing clipboard composable |
| packages/web-pkg/src/composables/actions/files/useFileActionsCreateLink.ts | Refactored to use new useCopyLink composable, removed proceedResult function |
| packages/web-pkg/src/composables/actions/files/useFileActionsCopyPermanentLink.ts | Updated to use VueUse's useClipboard directly instead of custom implementation |
| packages/web-pkg/src/components/CreateLinkModal.vue | Converted to script setup, removed callback prop, integrated useCopyLink |
| packages/web-pkg/tests/unit/composables/actions/files/useFileActionsCreateLink.spec.ts | Removed test assertions for removed functionality |
| packages/web-pkg/tests/unit/composables/actions/files/useFileActionsCopyPermanentLink.spec.ts | Updated mock to use VueUse's useClipboard API |
| packages/web-pkg/tests/unit/components/CreateLinkModal.spec.ts | Removed callback-related tests, added type assertions for Vue internals |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
For Safari to copy a newly created link to the clipboard, it requires that the link is created within the same user interaction as the clipboard write. This refactors the copying of links to do exactly that.
fb5d67b to
525230b
Compare
kulmann
approved these changes
Nov 13, 2025
Member
kulmann
left a comment
There was a problem hiding this comment.
Super nice to have it working finally 🥳
Member
Author
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
openclouders
pushed a commit
that referenced
this pull request
Nov 13, 2025
fix: copying created links in Safari
ScharfViktor
added a commit
that referenced
this pull request
Nov 13, 2025
ScharfViktor
added a commit
that referenced
this pull request
Nov 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For Safari to copy a newly created link to the clipboard, it requires that the link is created within the same user interaction as the clipboard write. This refactors the copying of links to do exactly that.
See https://wolfgangrittner.dev/how-to-use-clipboard-api-in-safari/ and https://developer.apple.com/forums/thread/691873
See c204065 for the actual fix.
fixes #1169