Filter Statistics by Time Window
The statistics dashboard must provide a time window selector that allows peer mentors to choose preset periods (current week, current month, last 3 months, current year) or define a custom date range. The selection should persist during the session and all charts and summary cards must react to the change. The component should be visually prominent and easy to interact with for users with cognitive or motor accessibility needs.
User Story
Acceptance Criteria
- Given I am on the statistics screen, When I tap the time window selector, Then I see options for: This Week, This Month, Last 3 Months, This Year, and Custom Range
- Given I select 'This Month', When the selection is confirmed, Then all statistics including charts and summary cards update to show data only for the current calendar month
- Given I select 'Custom Range', When I provide a start and end date, Then the statistics recalculate for exactly that date range
- Given I have selected a time window, When I navigate away and return to the stats screen, Then the previously selected time window is still applied
- Given the selected time window returns no data, When charts attempt to render, Then I see an informative empty state message specific to the selected period rather than a blank or broken chart
Business Value
Time-period filtering enables peer mentors to identify patterns in their own engagement — seeing that activity drops in certain months helps both the mentor and coordinator plan outreach. It also supports HLF's use case where mentors logged up to 380 activities in a year and need to review specific periods for self-assessment and performance conversations.
Components
- Time Window Selector ui
- Time Window Service service
- Stats Async Notifier service
- Stats Repository data
- Coordinator Statistics BLoC infrastructure
- Statistics Period Filter Bar ui