Personal Activity Statistics
Feature Detail
Description
This feature provides peer mentors with a personal statistics dashboard showing their own activity history, totals, and trends. The dashboard displays counts of completed activities, hours contributed, types of contacts helped, and comparisons across time periods. A simplified stats summary widget gives an at-a-glance overview, while an activity chart widget visualizes trends over weeks, months, or the full year. This feature directly supports motivation and self-awareness for volunteer peer mentors.
Analysis
Peer mentors are volunteers whose continued engagement depends on feeling that their contributions are recognized and meaningful. Providing personal statistics makes invisible work visible, giving mentors a sense of accomplishment and progress. NHF and HLF both explicitly requested Spotify Wrapped-style summaries and activity overviews. Coordinators benefit from having mentors who are self-aware about their activity levels, reducing the need for manual follow-up. This feature also supports the gamification pipeline and yearly impact summary, making it foundational for engagement-oriented features planned in later phases.
Statistics are calculated server-side using Supabase edge functions or materialized views on the activities and activity_logs tables, scoped strictly to the authenticated user. The Statistics Calculation Service aggregates totals by activity type, date range, and contact category. The Activity Chart Widget uses a lightweight Flutter charting library (e.g., fl_chart) supporting bar and line visualizations with accessible color contrast meeting WCAG 2.2 AA. Date range filtering (week/month/year/all-time) is handled client-side with BLoC state management. The Statistics Repository caches computed results with TTL to reduce redundant computation on repeated dashboard loads.
Dependencies
Definition of Done
Components (5)
User Stories (6)
As a As a Peer Mentor (Likeperson)
I want I want to see my statistics broken down by activity type — for example home visits, phone calls, group sessions — so that I can understand how I distribute my volunteering time
So that So that I can reflect on which kinds of peer support I provide most, and identify areas where I might expand my impact
- Given I am on the Statistics Dashboard Screen, when I view my statistics, then I can see a breakdown of activity counts and hours grouped by activity type
- Given I have activities of multiple types in the selected period, when the breakdown renders, then each activity type is listed with its individual count and hours separately
- Given I apply a date range filter, when the filter changes, then the activity type breakdown updates to reflect only activities within the selected period
- +2 more
As a As a Peer Mentor (Likeperson)
I want I want to see a comparison between my current period's activity count and the equivalent previous period — for example this month versus last month — so that I can understand whether I am doing more or less than before
So that So that I can stay motivated by seeing growth, or recognise when I need to re-engage if my activity level has dropped
- Given I am on the Statistics Dashboard Screen with 'this month' selected, when the data loads, then I see a comparison label showing the difference in activity count compared to last month
- Given the current period has more activities than the previous period, when the comparison renders, then the difference is shown as a positive number or upward indicator
- Given the current period has fewer activities than the previous period, when the comparison renders, then the difference is shown neutrally without alarming colour or negative language
- +2 more
As a As a Peer Mentor (Likeperson)
I want I want to see a compact summary card with my most important statistics — total activities, total hours, unique contacts helped, and my current activity streak — displayed as a quick-read tile grid
So that So that I can grasp my key contributions at a glance without needing to read a detailed report or scroll through a chart
- Given I open the Statistics Dashboard Screen, when the summary loads, then I see the Stats Summary Widget displaying at least four key metrics: total activities, total hours, unique contacts helped, and current streak
- Given the Stats Summary Widget is displayed, when I view it, then each metric is shown as a large bold number with a short descriptive label, readable without scrolling
- Given I have recorded activities in the current period, when the widget loads, then the streak metric reflects consecutive periods of activity
- +2 more
As a As a Peer Mentor (Likeperson)
I want I want to open my personal statistics dashboard and see a complete overview of my activity history including total activities completed, total hours contributed, and unique contacts I have helped
So that So that I can understand the cumulative impact of my volunteer work and feel a sense of accomplishment that motivates me to continue
- Given I am a logged-in peer mentor, when I navigate to the statistics section, then I see the Statistics Dashboard Screen displaying my personal stats
- Given the dashboard has loaded, when I view it, then I can see total activities completed, total hours contributed, and number of unique contacts helped
- Given the dashboard is loading, when the data fetch is in progress, then a loading indicator is shown so I know data is being retrieved
- +2 more
As a As a Peer Mentor (Likeperson)
I want I want to filter my statistics by a specific date range — this week, this month, this year, or all time — so that I can track my activity patterns for different periods
So that So that I can see how active I have been recently versus historically, and identify periods where I contributed more or less
- Given I am on the Statistics Dashboard Screen, when I tap a date range option (week, month, year, all-time), then all displayed statistics update to reflect only activities within that period
- Given I have selected a date range, when I view the dashboard, then the active range filter is visually highlighted so I know which period is selected
- Given I have cached statistics data, when I switch between date range filters, then the transition is fast (under 300ms) without a full network reload
- +2 more
As a As a Peer Mentor (Likeperson)
I want I want to see a visual chart of my activity trends over the selected time period, with the option to switch between a bar chart and a line chart
So that So that I can quickly see at a glance whether my volunteering activity is increasing, decreasing, or staying consistent over time
- Given I am on the Statistics Dashboard Screen, when the chart loads, then I see an Activity Chart Widget displaying my activity volume plotted over time for the selected period
- Given the chart is displaying in bar mode, when I tap the chart type toggle, then the chart switches to line mode and vice versa
- Given I have selected the 'week' date range, when the chart renders, then the x-axis shows individual days of the current week
- +3 more