Skip to content

fix(web): copy code component accessibility#2868

Merged
gabrielmfern merged 6 commits intoresend:canaryfrom
yanthomasdev:fix/copy-button-a11y
Jan 21, 2026
Merged

fix(web): copy code component accessibility#2868
gabrielmfern merged 6 commits intoresend:canaryfrom
yanthomasdev:fix/copy-button-a11y

Conversation

@yanthomasdev
Copy link
Contributor

@yanthomasdev yanthomasdev commented Jan 19, 2026

This PR adds screen reader-only text to the copy-code.tsx component with aria-live to give feedback once the content is copied.

This is meant to make it compliant with WCAG's Success Criterion 1.1.1: Non-text Content (Level A), ensuring the button's purpose and state, represented by an icon, can be understood by users of assistive technologies.

Changes were tested on Windows 11, Chrome, NVDA. For reference, before the announcement would be "button", now "button, copy to clipboard" and "copied" after clicked.

I haven't opened an issue since it wasn't clear if they should be opened for issues/bugs outside the library itself. Let me know if one's necessary.


Summary by cubic

Adds a screen reader–only live region to the copy-code button so assistive tech announces “Copy to clipboard” and “Copied.” This clarifies the button’s purpose and state and aligns with WCAG 1.1.1.

Written for commit 4f7cb18. Summary will update on new commits.

@changeset-bot
Copy link

changeset-bot bot commented Jan 19, 2026

⚠️ No Changeset found

Latest commit: 4f7cb18

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 19, 2026

@yanthomasdev is attempting to deploy a commit to the resend Team on Vercel.

A member of the Team first needs to authorize it.

@yanthomasdev yanthomasdev changed the base branch from canary to main January 19, 2026 20:37
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@gabrielmfern gabrielmfern changed the base branch from main to canary January 20, 2026 12:04
@yanthomasdev
Copy link
Contributor Author

Look like community PRs need approval in the Vercel dashboard to be deployed, I think they do have options to make it more flexible. Let me know if I can help somehow.

@gabrielmfern
Copy link
Member

@yanthomasdev not waiting for the deployments, they shouldn't be required to merge, just CodeQL and cubic that are just not running for some reason

@yanthomasdev
Copy link
Contributor Author

yanthomasdev commented Jan 20, 2026

@gabrielmfern oh, I have an idea what might be the issue. Could you take a look at the branch protection rules? Since it only affected me (contributor) but doesn't seem to affect you and other maintainers (that might be able to bypass branch protection rules) depending on the branch, it might be because it requires some workflow to run that doesn't exist anymore.

Here's a GitHub discussion on this issue: https://github.com/orgs/community/discussions/26698

@gabrielmfern gabrielmfern merged commit a53a00f into resend:canary Jan 21, 2026
7 of 10 checks passed
@gabrielmfern
Copy link
Member

@yanthomasdev yeah I think it's something along those lines, maybe because those two workflows only run for maintainers, I'll take a look, for now I've removed the requirement for them to succeed before merging

cpenned pushed a commit that referenced this pull request Jan 27, 2026
Co-authored-by: Gabriel Miranda <gabrielmfern@outlook.com>
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.

2 participants