Implement Export Progress Indicator and Status Feedback
epic-bufdir-reporting-export-ui-task-008 — Build the animated progress indicator widget displayed during active export, showing a percentage bar and status label (e.g., 'Fetching records…', 'Generating file…', 'Upload complete'). Progress value is driven by ExportTriggerBloc. On completion, show a success banner with a Download button. On error, show a plain-language error message with a Retry action. All dynamic status changes must be announced via accessibility live regions.
Acceptance Criteria
Technical Requirements
Execution Context
Tier 5 - 253 tasks
Can start after Tier 4 completes
Implementation Notes
Model ExportTriggerBloc progress as a double (0.0–1.0) and map to labelled phases in the UI layer, not in the BLoC. Use TweenAnimationBuilder
For error messages, prefer generic user-facing text like 'Export failed. Please check your connection and try again.' — log the technical error only to debugPrint or a crash reporter. Ensure the Retry button is at least 44×44 dp to meet WCAG touch target requirements.
Testing Requirements
Write widget tests with flutter_test covering: (1) progress bar renders and animates through mocked progress states, (2) status label text matches each BLoC state phase, (3) success banner appears with correct filename and Download button on completion, (4) error message and Retry button appear on error state, (5) Retry button re-dispatches ExportInitiated, (6) Semantics tree contains liveRegion nodes for status updates. Use MockExportTriggerBloc. Run flutter analyze and ensure no accessibility warnings. Test on both small (360dp) and large (412dp) screen widths.
For large exports that run for 10–30 seconds, a static loading spinner will feel broken to users on slow mobile connections. If the UI cannot display meaningful progress during the export pipeline, coordinators may abandon the flow or trigger duplicate exports by pressing the button multiple times.
Mitigation & Contingency
Mitigation: Implement streaming progress events from the orchestrator BLoC through named pipeline stages (querying, mapping, generating, uploading). Display each stage label with a progress indicator on the trigger screen. Disable the generate button immediately on first tap to prevent duplicates.
Contingency: If streaming pipeline progress is not feasible in the first release, implement a deterministic stage-based progress animation (10% querying, 50% generating, 90% uploading) that gives users feedback without requiring real server events.
Custom date range pickers are among the most common accessibility failures in mobile apps. Blindeforbundet users rely on VoiceOver, and NHF users include people with cognitive impairments. A non-accessible period picker could make the entire export workflow unusable for a significant portion of the intended user base.
Mitigation & Contingency
Mitigation: Build the period picker using Flutter's native date picker semantics as the foundation, with preset shortcuts as primary navigation (reducing the need to interact with the custom range picker at all). Test with VoiceOver on iOS and TalkBack on Android before UI epic sign-off. Engage Blindeforbundet's test contact for accessibility validation.
Contingency: If the custom date range picker cannot be made fully accessible before release, ship only the preset period shortcuts (covering the majority of use cases) and add the custom range picker in a follow-up sprint after dedicated accessibility remediation.