feat(a11y): implement market and bet status announcements for screen … - #915
Merged
greatest0fallt1me merged 1 commit intoAug 29, 2026
Conversation
…readers Closes Predictify-org#906 ## Summary Adds deterministic, production-ready accessibility announcements for market and bet status changes via WCAG 2.1 AA-compliant screen reader live regions. ## Changes ### Core Implementation - lib/status-announcement-messages.ts: State machine validation with explicit transitions (open→closing_soon→closed→resolved, any→cancelled) - app/state/statusAnnouncements.ts: Zustand store with 2-second deduplication and thread-safe concurrent update handling - hooks/useStatusChangeAnnouncement.ts: Live region integration bridge with optional debug mode ### Component Integration - StatusBadge.tsx: Announces market status changes (opt-in via marketId prop) - BetForm.tsx: Announces validation errors and pending bets (assertive priority) - ActiveBetCard.tsx: Automatically announces bet status updates ### Test Coverage (117 Tests) - lib/__tests__/status-announcement-messages.test.ts: 37 tests * Message generation, valid/invalid transitions, priority assignment - app/state/__tests__/statusAnnouncements.test.ts: 45 tests * Store operations, concurrency, deduplication, validation - hooks/__tests__/useStatusChangeAnnouncement.test.ts: 35 tests * Hook integration, live region, error handling, debug mode ### Documentation - ISSUE_906_IMPLEMENTATION.md: Comprehensive guide with API docs and examples - ISSUE_906_PR_DESCRIPTION.md: Code review summary - ISSUE_906_VALIDATION_REPORT.md: Quality verification and acceptance criteria - ISSUE_906_DELIVERABLES.md: Complete delivery checklist ## Acceptance Criteria (All Met) ✓ Deterministic behavior: Explicit state machine, 37 transition tests ✓ Validation invariants: Invalid transitions rejected with logging ✓ Retry/concurrency safety: Deduplication + immutable Map updates ✓ Focused tests: 117 deterministic tests covering all scenarios ✓ Backward compatibility: All new props optional, zero breaking changes ✓ Failure diagnosability: Console logging + debug mode, no data leaks ## Quality Metrics ✓ TypeScript strict mode (all files) ✓ WCAG 2.1 AA compliance verified ✓ Zero sensitive data exposure ✓ O(1) operations (negligible performance impact) ✓ 100% backward compatible ✓ JSDoc on all public APIs ## Testing All 117 tests are deterministic and pass: - Message generation (37 tests) - Store operations and concurrency (45 tests) - Hook integration and error handling (35 tests) ## Integration Usage examples: Market status announcements: <StatusBadge status={market.status} marketId={market.id} marketTitle={market.title} /> Bet form announcements: <BetForm onSubmit={handlePlaceBet} marketId={market.id} marketTitle={market.title} /> Automatic bet updates: <ActiveBetCard bet={bet} /> ## Breaking Changes None. All new features are opt-in via optional props. ## Migration Path No migration required. Existing code continues to work without changes. Enable announcements per-component by passing marketId and marketTitle props.
|
@chrissarah054-dotcom Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@chrissarah054-dotcom 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #906
…readers
Closes #906
Summary
Adds deterministic, production-ready accessibility announcements for market and bet status changes via WCAG 2.1 AA-compliant screen reader live regions.
Changes
Core Implementation
Component Integration
Test Coverage (117 Tests)
Documentation
Acceptance Criteria (All Met)
✓ Deterministic behavior: Explicit state machine, 37 transition tests ✓ Validation invariants: Invalid transitions rejected with logging ✓ Retry/concurrency safety: Deduplication + immutable Map updates ✓ Focused tests: 117 deterministic tests covering all scenarios ✓ Backward compatibility: All new props optional, zero breaking changes ✓ Failure diagnosability: Console logging + debug mode, no data leaks
Quality Metrics
✓ TypeScript strict mode (all files)
✓ WCAG 2.1 AA compliance verified
✓ Zero sensitive data exposure
✓ O(1) operations (negligible performance impact)
✓ 100% backward compatible
✓ JSDoc on all public APIs
Testing
All 117 tests are deterministic and pass:
Integration
Usage examples:
Market status announcements:
Bet form announcements:
Automatic bet updates:
Breaking Changes
None. All new features are opt-in via optional props.
Migration Path
No migration required. Existing code continues to work without changes. Enable announcements per-component by passing marketId and marketTitle props.
Pull Request
Description
Type of Change
Related Issues
Closes #[issue-number]
Related to #[issue-number]
Changes Made
Files Modified
Key Changes
Testing
Test Coverage
Screenshots/Videos
Minimum screenshots for UI/design PRs
Before
After
Pre-submission Checklist
Code Quality
Functionality
Documentation
Security & Accessibility
Breaking Changes
Breaking Changes:
Migration Steps:
Additional Notes
Dependencies
Performance Impact
Browser/Device Support
Labels
feature- for new featuresbugfix- for bug fixesdocumentation- for documentation changesenhancement- for improvementsbreaking-change- for breaking changesfrontend- for frontend changesbackend- for backend changesui/ux- for design changesReviewers
Note: Please ensure all checkboxes are completed before submitting this PR. This helps maintain code quality and speeds up the review process.