Compare Activity Across Two Periods
The period comparison widget allows a peer mentor to select two distinct periods and view their key metrics (total activities, hours, unique contacts, activity type distribution) displayed in parallel columns or a delta view. Positive growth is highlighted with a green-adjacent accent color and negative change with a neutral indicator (never alarming red) to maintain an encouraging tone consistent with the cognitive accessibility principles from the workshop. The comparison respects organization data isolation so only data belonging to the peer mentor's authorized scope is included.
User Story
Acceptance Criteria
- Given I am viewing my periodic summary, when I activate the comparison mode, then I can select a second comparison period from the same preset options available for the primary period
- Given two periods are selected, when the comparison loads, then I see metrics for both periods displayed side by side with delta indicators (arrows and percentage change) for each metric
- Given the comparison shows a decline in a metric, when it is rendered, then the visual indicator uses a neutral color and neutral language (not alarming red or negative wording) consistent with cognitive accessibility guidelines
- Given I switch back to single-period view, when the comparison is dismissed, then the primary period selection is preserved
- Given I have fewer than 7 days of data in one of the periods, when the comparison loads, then a contextual note is shown explaining that the period may be incomplete
Business Value
Period comparison enables peer mentors to self-regulate and set personal benchmarks without requiring coordinator intervention. It supports healthy engagement habits and allows the organization to passively promote continuous improvement through data transparency, reducing the administrative burden on coordinators.
Components
- Period Comparison Widget ui
- Period Calculator Service service
- Activity Aggregation Repository data
- Summary Period Repository data
- Organisation Data Isolation Guard infrastructure
- Summary Period Selector ui