fix(a11y): add aria-label to copy button in hero-code.tsx#464
Conversation
The copy button only had icon children with no accessible name. Screen readers announced it as "button" with no context. Fixes piyushdotcomm#463 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
👋 Thanks for opening a PR, @nyxsky404!Your PR has entered the 🚦 PR Review Pipeline.
What happens next
A pipeline status comment will appear below and update automatically as your PR progresses. While you wait
This comment is posted only once. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe copy button in the homepage hero code demo now includes a dynamic ChangesCopy Button Accessibility
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
aria-labelattribute to the copy-to-clipboard button in the homepage hero code demo"Copy code"in default state,"Copied to clipboard"after clicking — communicating the state change to assistive technologyType of change
Related issue
Closes #463
Validation
npm run lintnpm testnpm run buildAdditional manual verification:
"Copy code"/"Copied to clipboard"depending on stateuseAI.test.tsfailure is unrelated to this change (reproducible on unmodifiedmain)Screenshots or recordings
No visual change. The fix is only observable in the browser's Accessibility panel or with a screen reader. Before: button announced as unlabeled "button". After: announced as "Copy code, button".
Checklist
Context: Three identical fixes were merged for other components via #283, #281, and #279. The homepage hero section was missed in those passes. This brings it to the same standard.
Summary by CodeRabbit
Release Notes