feat(a11y): add aria-label to clickable media cards#1356
Conversation
The hero carousel video card and use-cases grid image card already had
role="button", tabIndex={0}, and onKeyDown handlers. Adds the missing
aria-label so screen readers announce what each clickable card does.
Both cards now use aria-label={`Expand ${title}`}, matching the example
in the issue.
Fixes MODSetter#913
|
@mvanhorn is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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
Adds the missing
aria-labelto the two clickable media cards on the homepage so screen readers announce what each card does. The cards already hadrole="button",tabIndex={0}, andonKeyDownfrom earlier work; this completes the four-attribute set called out in #913.Why this matters
@MODSetter filed #913 on 2026-03-24 listing four required attributes for keyboard accessibility on
surfsense_web/components/ui/hero-carousel.tsx:107andsurfsense_web/components/homepage/use-cases-grid.tsx:66-74. Re-reading both files at HEAD:role,tabIndex, andonKeyDownare all present (hero-carousel.tsx:118-129anduse-cases-grid.tsx:67-79). Only thearia-labelwas outstanding. The two-line addition uses the exact pattern from the issue's example:aria-label={Expand ${title}}. Without an accessible name, screen readers fall back to the inner image alt-text or the video element, which doesn't convey the affordance.Testing
titleprop is in scope at both edit sites (theHeroCarouselCardprops athero-carousel.tsx:68andUseCaseCardatuse-cases-grid.tsx:51)Fixes #913
High-level PR Summary
This PR adds
aria-labelattributes to two clickable media cards on the homepage to improve screen reader accessibility. The cards already hadrole="button",tabIndex, andonKeyDownhandlers; this completes the set of required attributes for proper keyboard accessibility by providing an accessible name that announces the expand action to screen reader users.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
surfsense_web/components/homepage/use-cases-grid.tsxsurfsense_web/components/ui/hero-carousel.tsx