Skip to content

feat: add Copy Stream Link action to StreamDetail hero header (Closes #1282) - #1358

Open
waterWang wants to merge 1 commit into
Fluxora-Org:mainfrom
waterWang:feat/stream-detail-copy-link-1282
Open

feat: add Copy Stream Link action to StreamDetail hero header (Closes #1282)#1358
waterWang wants to merge 1 commit into
Fluxora-Org:mainfrom
waterWang:feat/stream-detail-copy-link-1282

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Adds a Copy Link icon button beside the existing Share button in the StreamDetail page header. When clicked, it copies the current page URL (including the :streamId) to the clipboard.

Changes

  • src/pages/StreamDetail.tsx — Added Copy Link button with useClipboard hook integration. Shows a brief 'Copied' confirmation state (green Check icon + text), then reverts. Falls back to a toast notification on clipboard-write failure.
  • src/pages/__tests__/StreamDetail.test.tsx — Added 2 test cases verifying the copy button renders with correct label, copies the URL to clipboard, and shows the 'Copied' state after a successful copy.

Requirements coverage

  • Button shows a brief 'Copied' confirmation state, then reverts (via useClipboard's built-in 2s reset delay)
  • Handles clipboard-write failure by surfacing a fallback toast
  • Button has a distinct aria-label from the nearby Share button so screen reader users can tell them apart
  • Accessible (WCAG 2.1 AA) — keyboard actionable, ARIA labels, color contrast
  • Responsive — wrapped in a flex container with the existing Share button
  • Consistent with existing design tokens and patterns (uses useClipboard hook, useOptionalToast, and Lucide icons already in the codebase)

Testing

✓ src/pages/__tests__/StreamDetail.test.tsx (12 tests) — all passing

Add a 'Copy Link' icon button beside the existing Share button in the
StreamDetail page header that copies the current page URL to the
clipboard via the existing useClipboard hook.

Shows a brief 'Copied' confirmation state with a green Check icon,
then reverts after the hook's default reset delay. Falls back to a
toast notification on clipboard-write failure.

Closes Fluxora-Org#1282
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.

1 participant