critical priority medium complexity testing pending testing specialist Tier 8

Acceptance Criteria

Every interactive element (buttons, list rows, segment controls) in all six widgets has a minimum touch target of 44×44dp; verified via Flutter SemanticsChecker and manual measurement
All body and label text passes a 4.5:1 contrast ratio against its background; large text (≥18sp regular or ≥14sp bold) passes 3:1 — verified with a colour contrast analyser tool
Chart colour palette passes Coblis or equivalent colour-blindness simulator for deuteranopia, protanopia, and tritanopia — at minimum use shape/pattern differentiation in addition to colour
Every chart segment and KPI card has a meaningful Semantics label that a screen reader can announce (e.g., 'Activities this week: 12, up 3 from last week') — not just a raw number
Redundant Semantics labels (e.g., button labelled 'Close' with a tooltip also saying 'Close') are collapsed to a single announcement
Focus traversal order across all widgets is logical and follows the visual reading order; verified with keyboard navigation and VoiceOver/TalkBack
All violations found during the audit are documented in a findings report (markdown or ticket comments) with severity, WCAG criterion reference, and fix applied
Zero WCAG 2.2 AA violations remain after remediation — re-audit confirms clean pass
Chart empty and loading states also pass all accessibility checks

Technical Requirements

frameworks
Flutter
flutter_test (SemanticsChecker)
accessibility_tools package (optional)
performance requirements
Accessibility Semantics tree generation must not add more than 2ms per frame — avoid overly deep Semantics widget nesting
security requirements
Semantics labels must not expose sensitive user data (e.g., full names in chart tooltips read aloud in public)
ui components
TimeWindowSelector
StatsSummaryCards
ActivityChartWidget
PeerMentorStatsList
PeerMentorStatsScreen
CoordinatorStatsScreen

Execution Context

Execution Tier
Tier 8

Tier 8 - 48 tasks

Can start after Tier 7 completes

Implementation Notes

Use Flutter's built-in `Semantics` widget to wrap chart segments with `label`, `value`, and `hint` properties — the `label` should state what the segment represents, `value` the numeric value, and `hint` any interaction available (e.g., 'Double tap to see details'). For the chart colour palette, switch to a design-token-based palette that includes both colour and a `strokePattern` or `iconShape` discriminator for colour-blind users — consult the project's design token system. For tap targets smaller than 44dp visually, wrap with a `GestureDetector`/`InkWell` inside a `SizedBox(width: 44, height: 44)` with `clipBehavior: Clip.none` to avoid visual overflow. The accessibility audit findings should be tracked as sub-issues linked to this task; close them one by one and re-run the checker before marking the task complete.

Given this app's user base (users with motor, cognitive, and sensory impairments per the requirements doc), treat WCAG 2.2 AA as a hard gate, not a best-effort target.

Testing Requirements

Accessibility widget tests using `tester.getSemantics()` and `SemanticsChecker` to assert correct labels, roles, and actions for each widget. Automated contrast checks via flutter_test golden comparisons at multiple text sizes. Manual VoiceOver (iOS) and TalkBack (Android) walkthrough of each screen — document the announcement sequence for each widget. Colour-blindness simulation via Coblis for each chart colour variant.

Tap target tests asserting `RenderBox.size` >= Size(44, 44) for all interactive widgets. Re-run full audit suite after each remediation fix to confirm no regression in previously passing checks.

Component
Activity Chart Widget
ui medium
Epic Risks (4)
high impact high prob technical

fl_chart renders chart elements on a Canvas, making individual bars and data points invisible to the Flutter Semantics tree by default. Without explicit Semantics wrappers, VoiceOver and TalkBack users receive no chart information, violating the WCAG 2.2 AA requirement mandated by all three partner organizations.

Mitigation & Contingency

Mitigation: Wrap the fl_chart widget in a Semantics node with a dynamically generated textual description of the chart data (e.g., 'Bar chart: January 12, February 8, March 15 sessions'). Implement a collapsible data table alternative beneath the chart that screen readers can navigate row by row. Validate with VoiceOver on iOS and TalkBack on Android before the epic is marked complete.

Contingency: If fl_chart's Canvas rendering cannot be made accessible within the epic timeline, ship the chart hidden from the Semantics tree with ExcludeSemantics and promote the data table alternative to first-class UI so screen reader users have full access to the information. Log a tech-debt item to revisit native chart accessibility in a future sprint.

medium impact medium prob scope

Coordinators managing up to 5 chapters (NHF requirement) require the PeerMentorStatsList to display chapter affiliation labels for each row. With large chapter lists and many peer mentors, the list could become overwhelming and cause layout overflow or scrolling performance issues on lower-end Android devices.

Mitigation & Contingency

Mitigation: Implement chapter filtering as a segmented control above the list so coordinators can scope the list to one chapter at a time. Use ListView.builder (lazy rendering) rather than a Column of all rows. Profile scroll performance on a low-end Android device (Pixel 4a equivalent) with 50 peer mentors in scope during development.

Contingency: If multi-chapter display causes unacceptable performance, ship with single-chapter scope as the default view and a chapter switcher dropdown, deferring the combined cross-chapter list to a follow-up sprint.

low impact low prob technical

Summary cards and the chart widget rebuilding simultaneously on provider state change could cause a visible jank frame on slower devices, degrading perceived quality especially since this screen is intended to feel motivating and polished for gamification purposes.

Mitigation & Contingency

Mitigation: Use AnimatedSwitcher with a short fade transition (150ms) on the stats cards and chart so that data replacement feels intentional rather than jarring. Profile with Flutter DevTools on a mid-range device and ensure no frame exceeds 16ms during a time-window switch.

Contingency: If animation introduces complexity that delays delivery, ship without animation and use a loading skeleton (shimmer effect) during re-fetch instead, which is simpler and equally effective at masking the data swap.

high impact low prob security

If the role-based screen dispatch is misconfigured, a peer mentor could navigate to the coordinator stats screen and see aggregated chapter data for all peer mentors, which is a data privacy violation and a compliance risk for all three organizations.

Mitigation & Contingency

Mitigation: Implement role guard at the router level using an existing role-route-guard component so the coordinator screen route is unreachable for peer mentor roles. Add a widget test that mounts the coordinator screen with a peer mentor session token and asserts that the guard redirects to the no-access screen.

Contingency: If a bypass is found in QA, add a secondary in-screen role assertion in the coordinator screen's initState that throws an AuthorizationException and navigates to the error screen, ensuring defence in depth regardless of router configuration.