End-to-end flow validation and documentation
epic-scenario-push-engagement-ui-task-013 — Perform end-to-end validation of the full scenario push engagement UI flow: preference toggle persists → evaluation cycle respects preference → Realtime event triggers banner → banner tap navigates via deep-link router → detail view renders correctly and marks as read. Document component contracts, Riverpod provider dependencies, and WCAG compliance notes for each of the three components.
Acceptance Criteria
Technical Requirements
Execution Context
Tier 6 - 158 tasks
Can start after Tier 5 completes
Implementation Notes
Use Mermaid diagrams (supported natively in GitHub Markdown) for the Riverpod provider dependency graph — this is easy to maintain and renders in the repository. Structure each component contract document with consistent headings: Overview, Public API, Provider Dependencies, Side Effects, Navigation, WCAG Compliance. Keep documentation concise and developer-focused; avoid prose-heavy descriptions. Link from each component contract to the relevant source file path and test file path for quick navigation.
The WCAG audit checklist produced in task-011 should be referenced (not duplicated) from the component contracts. This documentation will be referenced during onboarding of new team members and during future accessibility reviews for the organisations (NHF, Blindeforbundet, HLF) which have contractual accessibility obligations.
Testing Requirements
No new automated tests in this task. E2E validation is manual: execute the full scenario flow on TestFlight (iOS) and Android emulator, recording pass/fail for each step in a checklist. If any step fails, create a bug issue referencing the relevant implementation task before closing the epic. VoiceOver walkthrough should be conducted by the developer or a designated tester familiar with screen reader usage.
The in-app notification banner depends on a Supabase Realtime subscription to detect new notification records. If the subscription reconnects slowly after an app resume from background, or if Realtime delivery is delayed under high load, the banner may not appear within the 2-second acceptance criterion.
Mitigation & Contingency
Mitigation: Implement an explicit subscription reconnect handler on app foreground events using Flutter's AppLifecycleState.resumed hook, and add a polling fallback that queries for unread notifications once per app foreground event as a safety net against missed Realtime events.
Contingency: If Realtime proves unreliable in production, promote the polling fallback to the primary mechanism with a 30-second interval, accepting slight latency in exchange for reliability.
Cold-start deep linking (app not running when push notification is tapped) requires deferred navigation after the Flutter engine and Supabase session are fully initialised. If the deep link is consumed before authentication completes, the router may navigate to a protected route without a valid session, causing an error or redirect loop.
Mitigation & Contingency
Mitigation: Implement a deferred navigation queue in scenario-deep-link-router that holds the parsed deep-link target until the auth session restoration lifecycle event fires, following the existing deep-link-handler pattern used in the BankID and Vipps authentication flows.
Contingency: If deferred navigation is not achievable within the epic's scope, fall back to navigating the user to the notification centre (which is always accessible post-login) where the relevant notification record is visible and tappable.