high priority medium complexity frontend pending frontend specialist Tier 2

Acceptance Criteria

PeerMentorStatsList renders all peer mentors from the coordinator stats Riverpod AsyncNotifier as PeerMentorStatsListRow items
ListView.builder is used (not ListView) to ensure lazy rendering for large lists
onTap on any row navigates to the peer mentor stats drill-down route, passing the userId as a route parameter
Multi-chapter labels display correctly (comma-separated) for peer mentors affiliated with multiple chapters
Loading state renders a skeleton list of 5 rows matching the PeerMentorStatsListRow height and layout
Empty state renders a centred illustration/icon with message 'No peer mentors found for this period'
Error state renders a retry button that re-triggers the Riverpod provider refresh
Skeleton shimmer animation uses a LinearGradient that respects reduced-motion system settings (check MediaQuery.disableAnimations)
List is accessible: each row Semantics label already handled by PeerMentorStatsListRow; the list itself has a Semantics label 'Peer mentor statistics list'
Scroll physics uses BouncingScrollPhysics on iOS, ClampingScrollPhysics on Android (platform-adaptive)
List rebuilds only when the provider data changes — no unnecessary full-widget rebuilds

Technical Requirements

frameworks
Flutter
Riverpod
data models
PeerMentorStatsSummary
CoordinatorStatsState
performance requirements
ListView.builder with itemCount and itemBuilder — never ListView(children: [...])
Skeleton items are const or cached; avoid allocating new widgets per frame during loading
security requirements
Route navigation passes only userId (opaque identifier), never full name or sensitive fields as route params
No PII in navigation logs
ui components
ListView.builder
PeerMentorStatsListRow (task-007)
Skeleton row widget (shimmer using AnimatedBuilder + LinearGradient)
EmptyStateWidget (illustration + message)
ErrorStateWidget (message + retry ElevatedButton)
Semantics wrapper on list root

Execution Context

Execution Tier
Tier 2

Tier 2 - 518 tasks

Can start after Tier 1 completes

Implementation Notes

Consume the coordinator stats Riverpod AsyncNotifier with ref.watch(coordinatorStatsProvider). Use .when(data:, loading:, error:) to branch rendering. For the skeleton, build a private _SkeletonRow widget that mirrors the ListTile dimensions exactly — same minHeight, same trailing icon area — so the layout shift on load is zero. Navigation should use GoRouter's context.push('/peer-mentor-stats/:userId') or equivalent named route.

Do not use Navigator.push directly — the project uses GoRouter with StatefulShellRoute. Shimmer: check MediaQuery.of(context).disableAnimations before starting the controller; if true, render a static grey placeholder instead.

Testing Requirements

Widget tests using flutter_test with ProviderScope overrides. Test cases: (1) loading state renders exactly 5 skeleton rows; (2) data state renders correct number of PeerMentorStatsListRow widgets; (3) empty state shows correct message when list is empty; (4) error state shows retry button; (5) tapping a row triggers GoRouter navigation to the drill-down route with correct userId; (6) reduced-motion flag disables shimmer animation — check AnimationController.isAnimating == false. Use mockProvider overrides, not real Supabase calls.

Component
Peer Mentor Stats List
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.