Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sanity): add always present document action to copy url to clipboard #7416

Merged
merged 8 commits into from
Aug 26, 2024

Conversation

drewlyton
Copy link
Contributor

@drewlyton drewlyton commented Aug 23, 2024

Description

This PR adds a document pane menu item that enables user's to easily copy the current
document's URL to their clipboard and share it with colleagues and collaborators.

Linear issue

Screen.Recording.2024-08-23.at.12.11.58.PM.mov

What to review

The code add for this feature is relatively straightforward. However, I'm unsure if the logic's location and the placement of the internalization strings is acceptable. Feedback on this would be greatly appreciated.

Testing

To test, navigate to a document and click on the added menu item. The current URL should be successfully copied to the clipboard.

Copy link

vercel bot commented Aug 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 26, 2024 6:52pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 26, 2024 6:52pm
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 26, 2024 6:52pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 26, 2024 6:52pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 26, 2024 6:52pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Aug 26, 2024 6:52pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Aug 23, 2024

Component Testing Report Updated Aug 26, 2024 6:55 PM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 43s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 31s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 36s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 17s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 10s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 3m 0s 0 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 43s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 43s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 14s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 8s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 25s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 17s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 14s 21 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

bjoerge
bjoerge previously approved these changes Aug 26, 2024
Copy link
Member

@bjoerge bjoerge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good from my side.

I'll defer to @runeb about UI location, etc. Just a note: this is copying a link to the document within the navigation structure that the user took to get to it, and might not always be what the user expect. As an alternative to consider (if you didn't already), you could copy the intent link for editing the document (this is what you navigate to when clicking the presence menu, for reference)

@bjoerge bjoerge requested a review from runeb August 26, 2024 13:53
@joneidejohnsen
Copy link
Contributor

Code looks good from my side.

I'll defer to @runeb about UI location, etc. Just a note: this is copying a link to the document within the navigation structure that the user took to get to it, and might not always be what the user expect. As an alternative to consider (if you didn't already), you could copy the intent link for editing the document (this is what you navigate to when clicking the presence menu, for reference)

@drewlyton Support this, and suggest we use the intent link here rather than the actual URL

@ricokahler ricokahler added this pull request to the merge queue Aug 26, 2024
Merged via the queue into next with commit 7afcdb4 Aug 26, 2024
42 checks passed
@ricokahler ricokahler deleted the feat/copy-document-link-gro-2405 branch August 26, 2024 20:01
jordanl17 pushed a commit that referenced this pull request Aug 29, 2024
…oard (#7416)

* feat: add always present document action to copy url to clipboard

* chore: add comment to menuitems

* feat: add check for navigator presence

* feat: add tracking for copy document URL

* fix: update to use intent URL instead of just current URL

* feat: resolve intent link on demand

* revert: go back to just copying current URL

* chore: add comment explanation
jordanl17 added a commit that referenced this pull request Aug 29, 2024
…oard (#7416)

* feat: add always present document action to copy url to clipboard

* chore: add comment to menuitems

* feat: add check for navigator presence

* feat: add tracking for copy document URL

* fix: update to use intent URL instead of just current URL

* feat: resolve intent link on demand

* revert: go back to just copying current URL

* chore: add comment explanation
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.

4 participants