Build ActivityHistoryList widget scaffold
epic-contact-detail-and-edit-supporting-ui-task-002 — Create the ActivityHistoryList Flutter widget with a ListView.builder that accepts a paginated activity stream. Render type label, formatted date, duration, and chapter attribution per item. Add an empty-state illustration and copy. Wire infinite scroll via a scroll controller that triggers fetchNextPage at 80% scroll depth.
Acceptance Criteria
Technical Requirements
Execution Context
Tier 1 - 540 tasks
Can start after Tier 0 completes
Implementation Notes
Extract `_ActivityHistoryTile` as a private stateless widget that takes a single `ActivityHistoryItem` — this makes widget testing isolated and keeps the main list widget lean. For the 80% scroll threshold, use: `if (controller.position.pixels >= controller.position.maxScrollExtent * 0.8 && !state.isLoading && state.hasNextPage) { ref.read(provider.notifier).fetchNextPage(); }`. Dispose the ScrollController in the StatefulWidget's dispose() if the widget owns it, or use a `useScrollController()` hook if flutter_hooks is available. For date formatting, use the `intl` package's `DateFormat.yMMMd(locale)` to respect device locale — do not hard-code 'en' locale.
Duration formatting: prefer '1 h 15 min' over '75 min' for durations ≥60 minutes. The shimmer loading state can use a simple opacity-animated Container with the design token surface-secondary colour rather than adding a shimmer package dependency.
Testing Requirements
Widget tests using flutter_test: (1) renders correct item count for a 3-item fixture state, (2) shows empty state widget when items list is empty and isLoading is false, (3) shows shimmer when isLoading is true and items is empty, (4) shows inline loading indicator when isLoading is true and items is non-empty, (5) scroll to 85% triggers fetchNextPage call on the mock notifier, (6) scroll at 100% with hasNextPage=false does NOT call fetchNextPage. Use pumpWidget with a ProviderScope override. Run `flutter test --update-goldens` to generate golden images for the item tile widget for regression protection.
The encrypted-field-display confirmation dialog adds interaction steps that may frustrate coordinators who access sensitive fields frequently, leading to requests to bypass the flow or skip read-receipt logging, which would violate Blindeforbundet's compliance requirements.
Mitigation & Contingency
Mitigation: Design the confirmation dialog to be as minimal as possible (one clear sentence, single confirm action) and ensure it does not reappear for the same field within a single screen session. Validate the UX with Blindeforbundet coordinators during the TestFlight pilot before finalising.
Contingency: If coordinators raise strong objections, escalate to Blindeforbundet's data protection officer to determine whether a lighter confirmation pattern (e.g., biometric confirmation instead of dialog) satisfies their compliance obligation.
The activity-history-list infinite scroll requires paginated Supabase queries. Contacts with hundreds of activities (e.g., an HLF peer mentor with 380 annual registrations) could cause slow page loads or memory pressure on older devices if pagination boundaries are set too large.
Mitigation & Contingency
Mitigation: Use a page size of 20 records with cursor-based pagination. Implement list item recycling using Flutter's ListView.builder. Benchmark memory usage with 400+ item simulation on a low-end test device before TestFlight release.
Contingency: If performance degrades on older devices, reduce page size to 10 and add a time-window filter (last 30 days, last 6 months, all) so the default view loads a manageable record count for most coordinators.
The cognitive load rule engine (from the Cognitive Accessibility feature) mandates no more than 7 fields per screen section. If a contact model has more than 7 editable fields, the edit-contact-screen layout must be split into sections, adding complexity not accounted for in the initial scope.
Mitigation & Contingency
Mitigation: Audit the full contact field list from all four organisations before implementation. Group fields into logical sections (personal info, contact details, affiliation) so no single section exceeds 7 fields. Use the cognitive-load-rule-engine component if it is already delivered by the Cognitive Accessibility feature.
Contingency: If the rule-engine component is not yet available, implement a simple manual section layout with accordion-style expansion for less-frequently edited fields to stay within the 7-field guideline without blocking delivery.