Skip to content

fix: QuestionContainer has no timeout handler and the timer isn't announced #120

Description

@Mkalbani

File: src/components/gameplay/QuestionContainer.tsx + src/components/gameplay/Question.tsx

Problem

  • When timeLeft reaches 0, the interval stops but nothing else happens — no auto-submit, no failure state, no toast.
  • The countdown timer has no role="timer" / aria-live="polite", so screen-reader users get no warning that time is running out.

Expected

  • Add a handler for the timeLeft === 0 case that:
    • Auto-submits as incorrect (or whatever the game design decides)
    • Triggers the existing game-over modal in Gameplay.tsx
  • Wrap the visible timer in <span role="timer" aria-live="polite" aria-atomic="true"> so AT users hear updates.
  • When ≤30s remain, expose a prefers-reduced-motion-safe pulse / color change (already partially styled via Time Warning Alert setting — use it).

Acceptance

  • Running the clock down ends the level/game via the same flow as a wrong answer.
  • Screen readers announce remaining time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions