Skip to content

feat(site): add copy link button to chat sharing popover - #29365

Merged
kylecarbs merged 1 commit into
mainfrom
feat/chat-sharing-copy-link
Sep 15, 2026
Merged

kylecarbs merged 1 commit into
mainfrom
feat/chat-sharing-copy-link

Conversation

@kylecarbs

@kylecarbs kylecarbs commented Sep 15, 2026

Copy link
Copy Markdown
Member

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 ChatSharingPopover stories already screenshot the header for Pixel.


Generated by Coder Agents on behalf of @kylecarbs.

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.
@kylecarbs
kylecarbs marked this pull request as ready for review September 15, 2026 20:30
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>
);
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe we already have a copy button. Before merging, can you check to see if it is applicable for our usage here

export const CopyButton: FC<CopyButtonProps> = ({

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

@kylecarbs
kylecarbs merged commit 2c5edf9 into main Sep 15, 2026
57 of 58 checks passed
@kylecarbs
kylecarbs deleted the feat/chat-sharing-copy-link branch September 15, 2026 23:07
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants