feat(site): add copy link button to chat sharing popover - #29365
Merged
Merged
Conversation
Installed PWAs hide the address bar, so users had no way to grab a chat URL to share. Add a Copy link button to the Chat sharing popover header that copies the absolute /agents/:chatId URL to the clipboard.
DanielleMaywood
approved these changes
Sep 15, 2026
Comment on lines
+160
to
+180
| /** | ||
| * Copies the absolute chat URL so it can be shared from contexts without an | ||
| * address bar, such as an installed PWA. | ||
| */ | ||
| const CopyChatLinkButton: FC<CopyChatLinkButtonProps> = ({ chatId }) => { | ||
| const { copyToClipboard, showCopiedSuccess } = useClipboard(); | ||
| const chatLink = new URL(`/agents/${chatId}`, window.location.origin).href; | ||
|
|
||
| return ( | ||
| <Button | ||
| size="sm" | ||
| variant="outline" | ||
| onClick={() => { | ||
| void copyToClipboard(chatLink); | ||
| }} | ||
| > | ||
| {showCopiedSuccess ? <CheckIcon /> : <LinkIcon />} | ||
| {showCopiedSuccess ? "Copied" : "Copy link"} | ||
| </Button> | ||
| ); | ||
| }; |
Contributor
There was a problem hiding this comment.
I believe we already have a copy button. Before merging, can you check to see if it is applicable for our usage here
Member
Author
There was a problem hiding this comment.
Checked it. CopyButton is a fixed icon-only button (size="icon", variant="subtle") whose accessible name only surfaces via a hover tooltip. The main motivation here is installed PWA / touch usage, where there is no hover, so I kept a labeled Copy link button with the same useClipboard hook and CheckIcon success state that CopyButton uses internally.
Happy to switch to CopyButton (icon + tooltip) if you'd prefer the header stay compact; otherwise I'll leave it labeled.
Reply generated by Coder Agents on behalf of @kylecarbs.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Installed PWAs hide the address bar, so there was no way to grab a chat's URL to share it. This adds a Copy link button to the Chat sharing popover header (opened from the Share button on
/agents/:chatId) that copies the absolute chat URL to the clipboard and briefly shows a "Copied" confirmation.Behavior is covered by a new Vitest test asserting the clipboard write; the existing
ChatSharingPopoverstories already screenshot the header for Pixel.Generated by Coder Agents on behalf of @kylecarbs.