Skip to content

fix: screen reader compatibility #31

Open
djoseph-apphelix wants to merge 1 commit intomainfrom
djoseph-apphelix/TNL2-343
Open

fix: screen reader compatibility #31
djoseph-apphelix wants to merge 1 commit intomainfrom
djoseph-apphelix/TNL2-343

Conversation

@djoseph-apphelix
Copy link
Member

  • Add screen reader announcements via aria-live regions for both flashcards and matching games, so users hear card flips, correct/incorrect matches, page transitions, and game completion
  • Add keyboard navigation support to matching game boxes (role="button", tabindex="0", Enter/Space key handlers) and manage focus throughout gameplay (start, navigation, after matches,
    end screen)
  • Add aria-hidden to decorative elements (loading spinner, progress SVG, card faces) and focus-visible outlines for keyboard users
  • Add sr-only CSS utility class for visually hidden but screen-reader-accessible content

Copilot AI review requested due to automatic review settings March 23, 2026 06:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves accessibility for the games XBlock by adding screen-reader announcements, keyboard navigation/focus management, and hiding decorative UI from assistive technologies for the flashcards and matching games.

Changes:

  • Added aria-live regions and JS-based announcements for key gameplay events (page changes, matches, flips, completion).
  • Improved keyboard operability and focus management (tabbable matching boxes, Enter/Space activation, focus routing at start/end).
  • Added sr-only utility styles, focus-visible outlines, and aria-hidden for decorative elements; bumped package version.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
setup.py Bumps package version to 1.0.14.
games/static/js/src/matching.js Adds live region announcements and keyboard/focus behavior for the matching game.
games/static/js/src/flashcards.js Adds live region announcements, aria updates, and focus behavior for flashcards.
games/static/html/matching.html Adds aria-live region, keyboardable roles/tabindex for boxes, aria-hidden for decorative SVG/spinner, and focusable end-screen region.
games/static/html/flashcards.html Adds aria-live region and adjusts ARIA attributes for the flashcard component/container.
games/static/css/matching.css Adds sr-only utility and focus-visible styling for matching boxes.
games/static/css/flashcards.css Adds sr-only utility and focus-visible styling for the flashcard element.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@djoseph-apphelix djoseph-apphelix force-pushed the djoseph-apphelix/TNL2-343 branch from 10dbf50 to 3d3056d Compare March 23, 2026 06:51
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