Personal Peer Mentor Statistics View
Component Detail
Description
Individual statistics view for a single peer mentor showing their own contribution over time. Used both in the coordinator drill-down and as the home screen stats panel for peer mentors themselves. Lays the data foundation for the Phase 4 Spotify Wrapped gamification feature.
personal-stats-view
Summaries
The Personal Peer Mentor Statistics View gives individual peer mentors direct visibility into their own contribution history, transforming abstract program participation into a concrete, personal record of impact. This self-service insight is a proven driver of engagement and retention — when participants can see their progress, they are more motivated to continue. The component is deliberately architected to serve as the data foundation for a planned Phase 4 gamification feature (Spotify Wrapped-style year-in-review), meaning investment now compounds into a high-engagement feature later at minimal additional cost, offering a clear competitive differentiator for the platform.
This medium-complexity component composes three sub-components — stats-summary-cards, monthly-activity-bar-chart, and stats-period-filter-bar — creating a delivery dependency on all three being completed first. Plan the sprint sequence accordingly. The dual-use nature (coordinator drill-down and mentor home screen) means two separate integration points must be tested, doubling QA scope for this component. The showBackButton flag controls navigation chrome, so test both modes.
The Phase 4 readiness responsibility (getShareableStatsSummary returning StatsSharePayload) should be scoped as a stub in the initial delivery and fully implemented in Phase 4 to avoid scope creep now while protecting the future integration path.
PersonalStatsView is a medium-complexity composite widget that orchestrates stats-summary-cards, monthly-activity-bar-chart, and stats-period-filter-bar as child widgets, passing the mentorId and current DateRange period down as props and receiving filter change events via onPeriodChanged. The refreshStats() method triggers a re-fetch from the data layer — wire this to a pull-to-refresh gesture. The getShareableStatsSummary() method assembles a StatsSharePayload from the current rendered state for use by the share sheet in Phase 4; stub it now with a NotImplementedError or a minimal payload. The showBackButton flag gates AppBar leading widget rendering.
Ensure the period filter state is lifted to this widget level so that both the bar chart and summary cards respond to the same filter consistently.
Responsibilities
- Display personal activity totals, hours, and reimbursements
- Show monthly bar chart for personal activity history
- Support period filtering for personal view
- Indicate contribution rank or milestone badges (Phase 4 readiness)
Interfaces
PersonalStatsView({required String mentorId, bool showBackButton = false})
onPeriodChanged(DateRange period)
refreshStats()
getShareableStatsSummary() → StatsSharePayload
Relationships
Dependencies (3)
Components this component depends on
Used Integrations (1)
External integrations and APIs this component relies on