feat: shareable link copy feedback and mobile clipboard support#4
Open
jaydenkalu wants to merge 1 commit into
Open
feat: shareable link copy feedback and mobile clipboard support#4jaydenkalu wants to merge 1 commit into
jaydenkalu wants to merge 1 commit into
Conversation
…belJoe#476) - copy-button.tsx: add writeToClipboard() with execCommand fallback for mobile browsers that lack navigator.clipboard; add aria-pressed state; add optional onCopied callback; export writeToClipboard for reuse - verify/page.tsx: replace bare navigator.clipboard.writeText with writeToClipboard; push success/error toast on copy; add aria-live region to Share button label for screen-reader feedback - Update snapshots for CopyButton/CopyableText (aria-pressed added) Closes AnnabelJoe#476
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.
Closes AnnabelJoe#476
Summary
Copy actions now confirm success visually, via toast, and via
aria-live— and work on mobile browsers that don't support the Clipboard API.Changes
src/components/copy-button.tsx:writeToClipboard(text)— triesnavigator.clipboard.writeText, falls back toexecCommand('copy')via a temporary<textarea>for mobileCopyButton: addsaria-pressed={copied}for screen-reader state; optionalonCopiedcallbackwriteToClipboardfor reuse elsewheresrc/app/verify/page.tsx:copyLink(): useswriteToClipboard, pushessuccesstoast on copy orerrortoast with fallback instruction on failure<span aria-live="polite">for screen-reader announcementAcceptance criteria
aria-liveannounces copy state to screen readersexecCommandfallback