Filter Statistics by Time Window
The stats period filter bar must appear at the top of the coordinator statistics dashboard and persist the selected window across all chart and list widgets on the page. Preset options should include: This Week, This Month, Last 3 Months, This Year, and Custom Range. Selecting Custom Range opens a date range picker. The selected period must be reflected in chart axis labels, summary card subtitles, and the peer mentor stats list. The time window selection must be preserved in state so navigating away and returning does not reset the filter.
User Story
Acceptance Criteria
- Given the coordinator is on the statistics screen, When they tap a period preset chip, Then all dashboard widgets refresh to show data for that period only
- Given the coordinator selects 'Custom Range', When the date picker appears, Then they can select a start and end date and all widgets update accordingly
- Given a time window is selected, When the coordinator navigates to a detail screen and returns, Then the same time window remains active
- Given the coordinator selects 'This Year', When summary cards render, Then the subtitle of each card reads the year (e.g., '2026')
- Given no data exists for the selected period, When widgets render, Then an empty state message is shown instead of blank charts
Business Value
HLF reported one peer mentor with 380 individual registrations in a single year. Coordinators need to slice this data by period to identify trends, prepare Bufdir reports (which require annual totals), and spot months with unusually low activity that may indicate a peer mentor needing support. Period filtering is foundational to every other statistics use case.
Components
- Statistics Period Filter Bar ui
- Coordinator Statistics BLoC infrastructure
- Coordinator Statistics Service service
- Time Window Service service
- Time Window Selector ui
- Stats Async Notifier service
- Statistics Cache Manager data
- Stats Repository data
Dependencies
- View Team Activity Summary Cards critical