Add per-segment accessibility labels to breakdown widget
epic-annual-impact-summary-ui-components-task-012 — Wire SummaryAccessibilityProvider into ActivityTypeBreakdownWidget to produce a Semantics node per segment with a complete announcement string: '[org-specific label]: [percentage]%, [absolute count] activities'. Ensure the expand interaction announces expanded content to screen readers. Use organisation-specific terminology via OrgLabelsProvider.
Acceptance Criteria
Technical Requirements
Execution Context
Tier 3 - 413 tasks
Can start after Tier 2 completes
Implementation Notes
Construct the announcement string in SummaryAccessibilityProvider as a pure function taking (label: String, percentage: double, count: int, activityTerm: String) → String, so it can be unit-tested independently of the widget. Resolve OrgLabelsProvider for the activity term (e.g. orgLabels.activityNounPlural) before passing it into the Semantics label. Use Semantics(label: announcementString, child: ExcludeSemantics(child: visualSegmentContent)) pattern per segment.
For the expand announcement, use a didUpdateWidget check: when expandedSegmentId changes to a non-null value, call SemanticsService.announce with the detail row content. Mark the GestureDetector or InkWell as Semantics(button:true, hint:...) rather than relying on Flutter's automatic button semantics to avoid platform-specific behaviour differences between VoiceOver and TalkBack. This task is critical because the Blindeforbundet user base relies heavily on screen readers — do not defer or simplify the implementation.
Testing Requirements
Widget tests using flutter_test SemanticsController: (1) for each segment, assert tester.getSemantics returns label matching '[label]: [N]%, [count] [activity_term]'; (2) assert decorative elements have no semantics label; (3) tap a segment and assert SemanticsService.announce was called with a string containing the expanded detail content; (4) mock OrgLabelsProvider to return custom activity term (e.g. 'sessions') and assert the announcement string uses 'sessions' not 'activities'; (5) assert each segment Semantics node has isButton:true with an appropriate hint. Run tester.ensureSemantics() before all semantics tests.
Simultaneous count-up animations across multiple stat cards and chart draw-in animations on lower-end Android devices may cause frame drops below 60fps, degrading the premium Wrapped experience and making the feature feel unpolished.
Mitigation & Contingency
Mitigation: Stagger animation starts using AnimationController with staggered intervals rather than starting all animations simultaneously. Use RepaintBoundary around each animated widget to isolate rasterisation. Profile on a mid-range Android device (e.g., equivalent to Pixel 4a) during development, not just at QA.
Contingency: If frame rate targets cannot be met on low-end devices, implement a device-capability check at startup and substitute simpler fade-in animations for the count-up and chart draw-in on devices below a CPU performance threshold.
The activity-type-breakdown-widget must render organisation-specific activity type labels sourced from the terminology system. If the terminology provider is not yet integrated at the time this widget is built, the widget will display hardcoded system labels, which is a regression risk for multi-org support.
Mitigation & Contingency
Mitigation: Accept activity type labels as a typed parameter in the widget constructor rather than reading from the terminology provider directly inside the widget. The BLoC or repository layer resolves labels before passing them to the widget, maintaining clean separation and testability.
Contingency: If terminology resolution is unavailable at widget integration time, display internal activity type keys as a temporary fallback with a localised suffix '(label pending)' visible only in non-production builds so QA can identify unresolved labels.