Skip to content

a11y: make comment permalink button keyboard-visible and named - #67

Open
waterlemonnn wants to merge 1 commit into
AgentPostmortem:mainfrom
waterlemonnn:fix/comment-anchor-a11y
Open

a11y: make comment permalink button keyboard-visible and named#67
waterlemonnn wants to merge 1 commit into
AgentPostmortem:mainfrom
waterlemonnn:fix/comment-anchor-a11y

Conversation

@waterlemonnn

Copy link
Copy Markdown

Closes #28.

CommentAnchorLink in components/post/CommentsSection.tsx was only revealed on group-hover, so a keyboard user tabbing to it focused an invisible control with no visible focus indicator (WCAG 2.4.7). Its accessible name was also just the # character via title, which isn't a reliable accessible name and isn't surfaced on touch/keyboard.

  • Added focus-visible:opacity-100 alongside the existing group-hover:opacity-100 so focus reveals the button.
  • Replaced title with aria-label="Copy link to this comment", and wrapped the visible #/Copied glyph in aria-hidden="true".
  • Added an aria-live="polite" sr-only span that announces "Copied" when the state flips, so screen reader users get feedback too.

Test plan

  • npm run lint — clean
  • npx tsc --noEmit — clean
  • npx vitest run — 87/87 passing (no existing coverage for this component)

CommentAnchorLink only revealed on hover, so a focused button had no
visible indicator (WCAG 2.4.7), and its accessible name was the "#"
character via title. Add focus-visible:opacity-100, swap title for
aria-label, hide the glyph from assistive tech, and announce the
copied state via a live region.
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.

a11y: per-comment permalink button is invisible on keyboard focus and named only "#"

1 participant