Build Export Trigger Screen UI Layout
epic-bufdir-reporting-export-ui-task-006 — Assemble the BufdirExportTriggerScreen scaffold integrating BufdirPeriodSelectorWidget, BufdirExportFormatSelector, the primary export button, and an animated progress indicator driven by ExportTriggerBloc state. The screen must render correctly in both idle and active-export states, use design tokens exclusively (no inline styles), and follow the single-action screen layout pattern to minimise cognitive load.
Acceptance Criteria
Technical Requirements
Execution Context
Tier 3 - 413 tasks
Can start after Tier 2 completes
Implementation Notes
Use BlocBuilder
On ExportTriggerComplete, use ScaffoldMessenger.of(context).showSnackBar with a custom SnackBar containing an InkWell 'Download' link — avoid BottomSheet which interrupts the screen flow. Reset to idle by dispatching a ResetExportEvent after the snackbar duration. Follow the single-action screen layout: BufdirPeriodSelectorWidget and BufdirExportFormatSelector are the two inputs; the Export button is the single action — keep the layout clean with AppSpacing.lg vertical gaps between sections.
Testing Requirements
Write flutter_test integration tests using a fake ExportTriggerCubit: (1) idle state — Export button disabled, no progress indicator visible, (2) period + format selected — Export button enabled, (3) tapping Export opens confirmation dialog, (4) confirming dialog triggers exporting state — progress indicator visible, selectors non-interactive, (5) exporting state with progress 50 — LinearProgressIndicator value is 0.5, (6) ExportTriggerComplete — success banner visible, download link present, (7) ExportTriggerError — error card visible, 'Try again' button present. Also write a golden test at 375 dp width for idle and exporting states to catch unintended layout regressions. All tests use fake Cubit — no real API calls.
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.