Skip to content

feat(a11y): add aria-label to clickable media cards#1356

Merged
MODSetter merged 1 commit into
MODSetter:devfrom
mvanhorn:osc/913-aria-label-clickable-cards
May 9, 2026
Merged

feat(a11y): add aria-label to clickable media cards#1356
MODSetter merged 1 commit into
MODSetter:devfrom
mvanhorn:osc/913-aria-label-clickable-cards

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

@mvanhorn mvanhorn commented May 9, 2026

Summary

Adds the missing aria-label to the two clickable media cards on the homepage so screen readers announce what each card does. The cards already had role="button", tabIndex={0}, and onKeyDown from 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:107 and surfsense_web/components/homepage/use-cases-grid.tsx:66-74. Re-reading both files at HEAD: role, tabIndex, and onKeyDown are all present (hero-carousel.tsx:118-129 and use-cases-grid.tsx:67-79). Only the aria-label was 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

  • Visually inspected both clickable divs at HEAD before editing
  • Verified title prop is in scope at both edit sites (the HeroCarouselCard props at hero-carousel.tsx:68 and UseCaseCard at use-cases-grid.tsx:51)
  • Diff is +2 lines

Fixes #913

High-level PR Summary

This PR adds aria-label attributes to two clickable media cards on the homepage to improve screen reader accessibility. The cards already had role="button", tabIndex, and onKeyDown handlers; 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
Order File Path
1 surfsense_web/components/homepage/use-cases-grid.tsx
2 surfsense_web/components/ui/hero-carousel.tsx

Need help? Join our Discord

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
@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

@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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3c5f21c3-c23f-42ab-99f4-fc2af0231e56

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MODSetter MODSetter merged commit 316a900 into MODSetter:dev May 9, 2026
7 of 11 checks passed
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