feat: add Copied! confirmation with check icon and i18n to CopyButton - #20
Merged
Merged
Conversation
vrickish
force-pushed
the
vrick_fix_fe_#2
branch
from
July 16, 2026 13:53
8b9c745 to
33d716e
Compare
5 tasks
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 #2
What does this PR do?
Adds a visible "Copied!" confirmation to the
CopyButtoncomponent so users get clear feedback when content is copied to the clipboard.Changes
src/components/CopyButton.tsx— When a copy succeeds, a greenCheckIcon(HeroIcons) appears next to the label, the text turns green, and the button'saria-labelupdates dynamically (e.g."Copy - Copied!") for screen readers. Labels now fall back toreact-i18nexttranslated strings (copyButton.copy,copyButton.copied,copyButton.failed) when not explicitly provided via props.src/hooks/useCopyToClipboard.ts— Changed default success duration from 2000ms to 1500ms to match the issue spec.src/i18n/locales/*.json(8 files) — Added acopyButtonnamespace withcopy,copied, andfailedkeys in all supported languages.src/components/CopyButton.test.tsx— Extended from 3 to 10 tests, covering: check icon rendering, dynamicaria-label,aria-livescreen reader announcement, auto-revert after timeout, rapid repeated clicks without flicker, i18n default labels, and verifying no icon appears on failure.How was this tested?
Ran
vitest run src/components/CopyButton.test.tsx— all 10 tests pass.Checklist