Desired outcome
The per-comment permalink button is reachable and understandable for keyboard and screen reader users.
Why it matters
CommentAnchorLink in components/post/CommentsSection.tsx renders:
<button
onClick={copy}
className="... opacity-0 transition-opacity group-hover:opacity-100 ..."
title="Copy link to comment"
>
{copied ? "Copied" : "#"}
</button>
Two real gaps:
- The button is
opacity-0 and is only revealed by group-hover. A keyboard user tabbing through the comment list focuses an invisible control, so there is no visible focus indicator anywhere on screen. That is a WCAG 2.4.7 failure.
- Its accessible name is the character
#. title is not a reliable accessible name and is never surfaced on touch or keyboard. A screen reader announces something like "number sign, button".
Steps
- Add
focus-visible:opacity-100 (and keep group-hover:opacity-100) to the button classes so focus reveals it.
- Replace
title with aria-label="Copy link to this comment", and wrap the visible # in aria-hidden="true".
- Announce the copied state, for example by adding
aria-live="polite" to the element that swaps to "Copied".
Small, self-contained, one file.
Claiming this
Comment below to claim it. A reply usually comes within a day.
Desired outcome
The per-comment permalink button is reachable and understandable for keyboard and screen reader users.
Why it matters
CommentAnchorLinkincomponents/post/CommentsSection.tsxrenders:Two real gaps:
opacity-0and is only revealed bygroup-hover. A keyboard user tabbing through the comment list focuses an invisible control, so there is no visible focus indicator anywhere on screen. That is a WCAG 2.4.7 failure.#.titleis not a reliable accessible name and is never surfaced on touch or keyboard. A screen reader announces something like "number sign, button".Steps
focus-visible:opacity-100(and keepgroup-hover:opacity-100) to the button classes so focus reveals it.titlewitharia-label="Copy link to this comment", and wrap the visible#inaria-hidden="true".aria-live="polite"to the element that swaps to "Copied".Small, self-contained, one file.
Claiming this
Comment below to claim it. A reply usually comes within a day.