Skip to content

a11y: aria-live regions for upload, loading states, and history accordion#86

Merged
ChristopherRotnes merged 1 commit into
masterfrom
a11y/live-regions
May 3, 2026
Merged

a11y: aria-live regions for upload, loading states, and history accordion#86
ChristopherRotnes merged 1 commit into
masterfrom
a11y/live-regions

Conversation

@ChristopherRotnes
Copy link
Copy Markdown
Owner

Summary

Adds aria-live regions and semantic attributes so screen reader users are automatically informed of dynamic content changes — file uploads, analysis progress, save status, and expanding session cards.

MuscleMap (upload step)

  • Both dropzone states (empty and with images) get role="region" + aria-label="Last opp treningsbilde"
  • A visually-hidden aria-live="polite" paragraph announces the image count whenever files are added or removed (e.g. "2 bilder valgt")
  • Preview images get meaningful alt text ("Treningsbilde 1", "Treningsbilde 2", …) instead of empty alt=""
  • Remove-image and add-more buttons get aria-label; the add-more cell is converted from a <div> to a <button> for native keyboard support
  • Decorative Camera and Add icons get aria-hidden="true"

MuscleMap (analyzing + muscles steps)

  • Analyzing wrapper gets aria-live="polite" + aria-busy="true" so screen readers announce when analysis is running and when it completes
  • Save status row (Lagrer / Lagret / Lagring feilet) gets aria-live="polite"

History (session accordion)

  • Toggle button gets aria-expanded={isExpanded} and aria-controls pointing to the panel
  • Expanded content panel gets matching id and aria-live="polite" so screen readers announce the exercise list when a session is opened

Test plan

  • Upload a photo — screen reader announces "1 bilde valgt"
  • Remove the photo — screen reader announces "" (cleared)
  • Click "Neste" — screen reader announces the analyzing state
  • Save a session — screen reader announces "Lagret"
  • Open a session accordion in History — screen reader announces the expanded content
  • Confirm aria-expanded toggles correctly in DevTools when clicking accordion

Closes #71, #73, #74, #80

🤖 Generated with Claude Code

…tory accordion

MuscleMap:
- role="region" + aria-label on both dropzone states (empty and with images)
- aria-live="polite" status paragraph announces image count when files are added/removed
- Meaningful alt text on preview images (Treningsbilde 1, 2, …)
- aria-label on remove-image and add-more-images buttons; aria-hidden on decorative Camera/Add icons
- "Add more" cell converted from <div> to <button> for native keyboard support
- aria-live="polite" + aria-busy on analyzing step wrapper
- aria-live="polite" on save status (Lagrer / Lagret / Lagring feilet)

History:
- aria-expanded + aria-controls on session accordion toggle button
- id + aria-live="polite" on expanded session content panel

Closes #71, #73, #74, #80

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ChristopherRotnes ChristopherRotnes merged commit 7962ec6 into master May 3, 2026
1 of 2 checks passed
@ChristopherRotnes ChristopherRotnes deleted the a11y/live-regions branch May 3, 2026 15:37
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.

As a screen reader user I want the file upload area to be announced and keyboard-operable so I can log a workout without a mouse

1 participant