Build Activity History List Widget
epic-contact-detail-and-edit-main-screen-task-010 — Implement the activity history list section widget that renders paginated past activity entries for a contact, sourced from contact-detail-service. Each row shows activity type icon, date, duration, and coordinator name. Support infinite scroll with skeleton loading states. Fully accessible with screen reader row announcements and focus management per WCAG 2.2 AA.
Acceptance Criteria
Technical Requirements
Execution Context
Tier 2 - 518 tasks
Can start after Tier 1 completes
Implementation Notes
Use `ListView.builder` with a `ScrollController` attached. Detect near-bottom via `controller.position.pixels >= controller.position.maxScrollExtent - (3 * rowHeight)`. Pass a callback prop (e.g., `onLoadMore`) to keep the widget decoupled from the service. Use `shimmer` package or a simple `AnimatedContainer` pulse for skeleton rows — avoid third-party packages not already in pubspec.
Activity type icons should be mapped from a `const Map
Testing Requirements
Widget tests (flutter_test): (1) render with mock data list — verify each row shows correct icon, date, duration, coordinator name; (2) render with empty list — verify empty state widget is shown; (3) simulate scroll to bottom — verify pagination callback is invoked; (4) verify skeleton rows appear when state is loading; (5) verify error state renders retry button with accessible label. Accessibility test: use `flutter_test` `SemanticsHandle` to verify each row has a combined Semantics announcement. No golden tests required. Target ≥80% widget test coverage.
The Peer Mentor Profile tab on the contact detail screen depends on the peer-mentor-detail-screen-widget being delivered by the separate Peer Mentor Detail feature. If that feature is delayed, the navigation affordance will be present but lead to a stub screen, which may confuse coordinators in the TestFlight pilot.
Mitigation & Contingency
Mitigation: Implement the peer mentor tab with a feature flag guard. When the Peer Mentor Detail feature is incomplete, the flag disables the tab. Coordinate delivery timelines with the team responsible for Peer Mentor Detail to align TestFlight releases.
Contingency: If the Peer Mentor Detail feature is significantly delayed, ship the contact detail screen without the peer mentor tab in the first TestFlight build and add it as an incremental update once the dependent screen is ready.
The contact detail screen must adapt its layout significantly based on organisation context: NHF shows affiliation chips, Blindeforbundet shows encrypted fields and assignment status, standard contacts show neither. Managing this conditional rendering without introducing bugs in each variant is complex and increases the risk of organisation-specific regressions.
Mitigation & Contingency
Mitigation: Define a ContactDetailViewModel that resolves all org-specific flags (showEncryptedFields, showAssignmentStatus, showMultiChapterChips) from the organisation config before the widget tree renders. Widget tests must cover all three organisation variants as separate test cases to catch regressions.
Contingency: If conditional rendering logic grows unwieldy, refactor into separate composable section widgets (ProfileHeaderSection, AffiliationSection, EncryptedFieldsSection) that are conditionally included by the parent screen, isolating org-specific logic to individual components.