feat(a11y): add descriptive alt text and ARIA labels to map markers#130
Conversation
- Add aria-label and title to AED markers with the defibrillator name - Add aria-label to search location marker with drag instructions - Add aria-label to cluster markers describing the count - Add role="region" and aria-label to the map container - Add aria-label to "Ver detalles" popup button with AED name - Add role="status" and aria-live="polite" to loading indicator - Add role="alert" to error indicator - Mark decorative SVGs and visual elements with aria-hidden="true" - Add alt prop to react-leaflet Marker components - Cache AED icons per name to maintain performance Closes GlobalEmergency#116
|
@rdcrampton is attempting to deploy a commit to the vgpastor's projects Team on Vercel. A member of the Team first needs to authorize it. |
- Add role="button", aria-label, and title to spiderfy cluster icons - Hide visual count from screen readers with aria-hidden - Label describes overlapping markers and the click action
|
VoiceOver testing completed (macOS, Safari) Tested locally with 500 seeded AEDs across Madrid. All ARIA attributes are working as expected:
No visual rendering changes observed. Markers display and interact identically to before. |
|
Hi @rdcrampton thanks for your efforts I will review this weekend in details yours commits. Many thanks!!!! |
…ility - Revert per-name aedIconCache (memory leak: 35k+ DivIcon objects) to single shared aedIcon — use Leaflet-native `alt` and `title` props on <Marker> for per-marker accessibility (zero perf cost) - Remove role="button"/tabindex="0" from divIcon HTML (Leaflet handles marker interactivity — inner elements caused duplicate tab stops) - Fix ClusterMarker: move aria-label/title from cached divIcon HTML to <Marker> props (bucket caching made labels show wrong counts) - Add prefers-reduced-motion media query to disable animations for users with vestibular/motion sensitivity - Add sr-only CSS class + aria-live region for AED count announcements - Mark decorative MapPin icon in popup as aria-hidden Co-Authored-By: rdcrampton <17489362+rdcrampton@users.noreply.github.com>
|
Hey @rdcrampton! 👋 First of all, thank you so much for this contribution — accessibility is something we really care about and it's great to see someone tackling it. Your VoiceOver testing was really thorough and we appreciate the effort! I've pushed a commit on top of yours with a few adjustments. Let me explain the reasoning so it makes sense: 🔧 Reverted the per-name
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thanks so much for the detailed review and the care you put into optimizing the changes, @vgpastor. The performance feedback is really valuable. I hadn't considered the memory impact of per-name icon caching at the scale of 35k+ markers, and using Leaflet's native alt/title props is a much cleaner approach. The duplicate tab stop issue with role="button" + tabindex="0" on divIcon HTML is a good catch too. Good to know Leaflet handles marker interactivity natively. The additions you made (prefers-reduced-motion, the live region for AED counts, aria-hidden on decorative icons) round things out nicely. Really glad to see the four new accessibility issues as well. I'd be happy to pick up one of those if you'd like a hand. |
Summary
Adds accessibility attributes to the map markers, popups, and status indicators so that screen reader users can identify and interact with AED locations on the map.
Changes across two files:
MapView.tsx
aria-label,title, andaltattributes including the defibrillator name (e.g. "DEA: Hospital La Paz")role="region"and a descriptivearia-labelaria-labelrole="status"witharia-live="polite"role="alert"aria-hidden="true"ClusterMarker.tsx
role="button",aria-label, andtitledescribing the count (e.g. "Grupo de 42 desfibriladores. Haz clic para ampliar.")aria-hidden="true"Test plan
titleattribute)npm run lint:fixandnpm run buildwith no errorsCloses #116