View Personal Activity Summary Cards
Peer mentors need an at-a-glance overview of their key activity metrics displayed as summary stat cards on the statistics dashboard. Cards should show total activities logged, total hours, unique contacts supported, and any other key KPIs relevant to their role. The data must reflect the currently selected time window and update reactively when the period filter changes.
User Story
Audience Summaries
Peer mentor retention and activity logging consistency are two of the most critical operational challenges identified across all three partner organizations. This high-priority story directly addresses both by giving peer mentors immediate, visible confirmation that their work is being tracked and valued. When volunteers can see their total activities, hours contributed, and number of unique individuals they have supported, they experience a tangible sense of impact that motivates continued engagement. This is foundational to the gamification and Spotify Wrapped-style recognition goals described in the product requirements.
Organizations that improve logging rates reduce the gap between actual mentor activity and reported activity, which strengthens grant applications and demonstrates greater program impact to government funders. Higher retention of trained peer mentors also reduces recruitment and onboarding costs significantly, making this feature a direct contributor to organizational sustainability and cost efficiency.
This is a high-priority, foundational story with no upstream dependencies, making it a strong candidate for early-sprint delivery. It establishes the statistics dashboard as a reusable screen that later stories (Bufdir alignment, filtering, charts) will build upon, so architectural decisions made here will cascade forward. The story requires agreement on which KPIs to display beyond the three specified (total activities, total hours, unique contacts) — this needs a brief stakeholder alignment session before development begins. The time window filter integration is an explicit acceptance criterion and creates a soft dependency on the period filter component.
Offline caching behavior is also in scope, requiring a defined caching strategy and a visual indicator for stale data. The privacy requirement (mentors see only their own data) must be enforced at the API layer, not just the UI, and should be validated as part of security testing. User acceptance testing should involve actual peer mentors to confirm the empty state messaging is clear and not discouraging.
This story requires building a statistics dashboard screen with reactive summary stat cards that update when the time window filter changes. The data layer needs a query interface that accepts a date range and returns aggregated metrics (activity count, total hours, distinct contact count) scoped to the authenticated user — the privacy constraint must be enforced server-side via user-scoped queries, not client-side filtering. Reactive updates when the period filter changes should be implemented with a state management pattern (e.g., derived state or a query subscription) rather than imperative re-fetch calls, to avoid race conditions. Offline support requires a local cache layer (e.g., SQLite or AsyncStorage) that stores the last fetched result per time window, with a staleness flag surfaced in the UI.
The empty state (zero values) must render stat cards with zero rather than hiding them, accompanied by a friendly message — this prevents layout shift and sets a consistent visual pattern for other dashboard stories. Define a shared StatCard component here that downstream stories can reuse for Bufdir and other metric views.
Acceptance Criteria
- Given I open the statistics screen, When the screen loads, Then I see summary cards displaying total activities, total hours, and contact count for the default time period (current month)
- Given I am viewing the stats dashboard, When I change the time window filter, Then all summary cards update immediately to reflect the selected period without requiring a manual refresh
- Given I have no activities logged in the selected period, When the dashboard loads, Then summary cards display zero values with a friendly empty state message rather than errors
- Given the app is offline, When I open the stats dashboard, Then cached data is shown with a visual indicator that data may not be current
- Given I am a peer mentor, When I view the dashboard, Then I only see my own personal statistics and no other mentor's data
Business Value
Peer mentors who can see their contribution metrics are significantly more motivated to continue volunteering. Visible impact data directly addresses the underreporting problem identified across all three organizations — when mentors see their work quantified, they are more likely to log activities consistently. This is foundational to the gamification and Spotify Wrapped goals identified in the requirements.
Components
- Peer Mentor Stats Screen ui
- Stats Summary Cards ui
- Stats Async Notifier service
- Time Window Service service
- Stats Repository data
- Stats Data Models data
- Supabase Stats Database Views infrastructure
- Coordinator Statistics BLoC infrastructure
- Personal Statistics BLoC infrastructure
- Personal Statistics Service service
- Statistics Cache Manager data