Skip to content

feat(dispute-card): add aria-live region for polite status announcements - #867

Open
waterWang wants to merge 1 commit into
Predictify-org:mainfrom
waterWang:feat/disputecard-aria-live
Open

feat(dispute-card): add aria-live region for polite status announcements#867
waterWang wants to merge 1 commit into
Predictify-org:mainfrom
waterWang:feat/disputecard-aria-live

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Adds a polite aria-live region to DisputeCard so screen-reader users are announced whenever the dispute state changes.

Changes

  • src/pages/DisputeCard.tsx
    • Added the reusable LiveRegion component (aria-live="polite", role="status", WCAG 2.1 SC 4.1.3).
    • Added a useState announcement value that mirrors the current resolved-state label.
    • A useEffect re-announces the state label whenever resolvedState changes (e.g. “Dispute open — staking”, “Community voting”, “Voting ended”, “Outcome executed”, “No active dispute”).
  • src/pages/__tests__/DisputeCard.test.tsx
    • Added focused tests asserting the live region exists with the correct aria-live/role attributes, and that it announces the correct label for the none, open, voting, ended, and executed states.

Why

The card’s state is driven by data.state, which can transition (OPEN → VOTING → ENDED → EXECUTED). Without a live region these transitions are invisible to screen-reader users. The announcement reuses the existing stateLabels map, so it stays consistent with the visible footer text.

Closes #780

Adds a LiveRegion (aria-live="polite" / role="status") to DisputeCard
that announces the current dispute state whenever the resolved state
changes. This ensures screen-reader users are notified of state
transitions.

Closes Predictify-org#780
@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

@waterWang is attempting to deploy a commit to the Jagadeesh B's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Add aria-live region for DisputeCard status updates [b#046]

1 participant