Integrate ExportConfirmationDialog and ExportProgressIndicator into execution phase
epic-bufdir-report-export-user-interface-task-010 — In BufdirExportScreen's Execution phase, show the ExportConfirmationDialog when the user taps 'Confirm Export'. On confirmation, invoke BufdirExportService.startExport() and transition to the progress sub-phase displaying ExportProgressIndicator. Handle success by transitioning to a completion state that shows a download prompt via FileDownloadHandler. Handle failure with a plain-language error message and a 'Retry' option that stays in the Execution phase.
Acceptance Criteria
Technical Requirements
Execution Context
Tier 4 - 323 tasks
Can start after Tier 3 completes
Implementation Notes
BufdirExportService.startExport() should return a Stream
Ensure the 'Retry' path does not re-open the confirmation dialog — the user already confirmed once.
Testing Requirements
Widget tests: (1) tapping 'Confirm Export' shows dialog, (2) cancelling dialog stays in Preview, (3) confirming dialog calls startExport() and enters ExportExecutionLoading state, (4) success state renders completion card and calls FileDownloadHandler, (5) failure state renders inline error with 'Retry' button, (6) 'Retry' re-calls startExport(), (7) progress indicator Semantics live region is present. Integration test (task-012 scope): full flow from Preview → Confirmation → Success → Download prompt using a mocked BufdirExportService.
The preview panel requires a round-trip to the edge function to compute aggregated counts. If this call takes 5–15 seconds for large scopes, users may assume the app has frozen and navigate away, potentially triggering duplicate preview requests or leaving the export in an undefined state.
Mitigation & Contingency
Mitigation: Show an immediate skeleton loading state on the preview panel as soon as the period and scope are confirmed, with named stage labels (e.g. 'Querying activities…', 'Computing totals…') streamed from the edge function's progress events. Set a clear user-visible timeout with a retry option. Pre-warm the edge function with a lightweight ping when the scope selector is opened.
Contingency: If preview latency consistently exceeds 10 seconds for large scopes, cache the preview payload in local BLoC state and allow the coordinator to proceed to confirmation without re-fetching if scope and period have not changed since the last preview.
The export preview panel contains dynamic content (warning badges, loading skeletons, aggregated counts) that must be announced correctly by VoiceOver and TalkBack. Incorrect semantics annotations could make the preview unreadable for blind coordinators, violating the project's WCAG 2.2 AA accessibility mandate.
Mitigation & Contingency
Mitigation: Implement semantic annotations using Flutter's Semantics widget with explicit labels for all dynamic content. Use live region announcements for loading state transitions. Schedule a dedicated accessibility review session with a screen reader user (Blindeforbundet has relevant expertise) before marking the epic complete.
Contingency: If the preview panel cannot be made fully screen-reader-accessible in time for launch, ship a simplified text-only summary mode activated by a toggle at the top of the preview panel, which renders all data as a single readable paragraph with no interactive badges.