Peer Mentor Single Selector WCAG 2.2 AA compliance
epic-bulk-and-proxy-registration-mentor-selection-task-007 — Apply WCAG 2.2 AA accessibility requirements to the Peer Mentor Single Selector: accessible touch targets (44×44 dp minimum) on all list rows and the search bar, correct Semantics roles for the selectable list items (radio group semantics), live region announcements when search results update, and screen reader testing with TalkBack and VoiceOver. Ensure NHF cognitively impaired users benefit from plain-language labels and logical focus order.
Acceptance Criteria
Technical Requirements
Execution Context
Tier 6 - 158 tasks
Can start after Tier 5 completes
Implementation Notes
Radio group semantics in Flutter are achieved by wrapping each selectable row in Semantics(inMutuallyExclusiveGroup: true, checked: isSelected, ...) — do NOT rely on Radio widget if the design uses custom rows, as Radio's built-in semantics may conflict with MergeSemantics. For the live region result count, add a Semantics(liveRegion: true) wrapper around a Text widget showing 'X mentors found'; update this count via the same derived provider used for filtered list length. The error message live region follows the same pattern — Semantics(liveRegion: true) on the error Text so it announces immediately when it becomes visible. Cognitive accessibility for NHF: keep all labels concise and free of jargon; the mentor row label should read '[Name] — [area/status]' not internal codes.
Avoid relying on colour alone for the selected state — combine background highlight with a checkmark icon that is visible in both colour and high-contrast modes.
Testing Requirements
Widget tests: (1) pump screen with 3 mentors, read semantics tree and assert each row has inMutuallyExclusiveGroup: true and a non-empty label; (2) assert search bar has minimum height ≥ 44 dp via tester.getSize(); (3) simulate search query change and assert live region widget is present in the semantics tree; (4) simulate Continue tap with no selection and assert error live region is present. Manual tests: follow WCAG SC 1.3.1, 2.1.1, 2.4.3, 2.5.3, 4.1.2 checklists with TalkBack (Android 13+) and VoiceOver (iOS 16+). Document manual pass/fail in a checklist file committed to the repo.
NHF coordinators may manage dozens of peer mentors across multiple chapters. If the multi-select list renders all contacts in a single unsorted ListView, performance degrades with 50+ items, and coordinators cannot efficiently locate a specific mentor, increasing the probability of selection errors and wrong-person proxy registrations.
Mitigation & Contingency
Mitigation: Use a SliverList with itemExtent for fixed-height rows to enable O(1) scroll position calculation. Implement the search filter using a debounce utility operating on an in-memory list (no extra API calls). Sort the contact list alphabetically by default. Add chapter-filter chips above the list for NHF's multi-chapter coordinators.
Contingency: If performance issues arise in testing with real data sets, introduce pagination with a 'load more' trigger at the bottom of the list and cache rendered rows using Flutter's AutomaticKeepAliveClientMixin.
NHF has a complex 12-national-association / 9-region / 1,400-chapter hierarchy. It is ambiguous whether a coordinator can proxy-register for peer mentors outside their immediately assigned chapter. If the contact list is not correctly scoped by RLS, coordinators might see — and register on behalf of — peer mentors they do not manage, creating fraudulent activity records that skew Bufdir statistics.
Mitigation & Contingency
Mitigation: The Proxy Contact List Provider must query only peer mentors linked to the coordinator's own chapter scope via RLS. Add an explicit Supabase query test asserting that a coordinator from chapter A cannot retrieve peer mentors from chapter B. Display each mentor's chapter affiliation in the list row so coordinators can visually verify scope.
Contingency: If RLS scope is found to be too permissive in testing, apply a server-side coordinator_id filter as a secondary guard on the query. Block the feature release until the scope test passes consistently.