medium priority low complexity frontend pending frontend specialist Tier 3

Acceptance Criteria

A 3-second countdown timer starts immediately when RegistrationConfirmationView is first displayed
After 3 seconds the bottom sheet is closed programmatically via Navigator.pop or the sheet controller without requiring user interaction
A clearly labeled close button (e.g., 'Close' or 'X') is visible and tappable throughout the countdown and closes the sheet immediately when pressed
The countdown remaining seconds are announced to screen readers via a Semantics live region (liveRegion: true) each second (e.g., 'Closing in 3', 'Closing in 2', 'Closing in 1')
If the user taps the manual close button mid-countdown, the timer is cancelled and no duplicate Navigator.pop is called
The timer is cancelled in dispose() so navigating away before 3 seconds does not cause setState-after-dispose exceptions
The auto-dismiss does not fire if the app is backgrounded during the countdown; timer resumes or restarts cleanly on foreground
Widget test confirms the sheet closes after a 3-second timer.tick advance using a fake async zone

Technical Requirements

frameworks
Flutter
BLoC
performance requirements
Timer tick updates must not trigger full widget tree rebuilds; update only the countdown label subtree
ui components
CountdownLabel widget (StatefulWidget owning the Timer)
Semantics widget with liveRegion: true wrapping the countdown text
AppButton or IconButton for manual close

Execution Context

Execution Tier
Tier 3

Tier 3 - 413 tasks

Can start after Tier 2 completes

Implementation Notes

Implement a small StatefulWidget (e.g., AutoDismissConfirmation) that owns a dart:async Timer.periodic(Duration(seconds:1), ...) and a countdown int starting at 3. On each tick decrement the counter and call setState only on the countdown label node. At 0, call the provided onDismiss callback (do not call Navigator directly inside the child — pass a callback from the sheet's state). Wrap the countdown text in Semantics(liveRegion: true, label: 'Closing in $countdown') so VoiceOver/TalkBack reads each update.

Cancel the timer in dispose() and guard the onDismiss callback with a mounted check. Note: AppLifecycleState changes (paused/resumed) should pause/resume the timer — add WidgetsBindingObserver to the StatefulWidget to handle backgrounding gracefully.

Testing Requirements

Use flutter_test with fakeAsync and fake_async zones: (1) verify sheet pop is called exactly once after 3000ms tick, (2) verify pop is called immediately on manual close button tap and timer is cancelled, (3) verify no setState-after-dispose when widget is removed before timer fires. Semantics test: pump widget and assert that SemanticsNode with liveRegion flag exists and its label updates each second. No e2e test required for this specific task.

Epic Risks (4)
high impact medium prob scope

As wizard steps accumulate additional features (duplicate warning, retroactive date chips, custom duration entry), the two-tap happy path may inadvertently require extra interactions. A step that previously auto-advanced may start requiring a confirmation tap, breaking the core promise of the feature and increasing friction for high-frequency users like HLF's 380-registration peer mentor.

Mitigation & Contingency

Mitigation: Define and automate a regression test that performs the complete two-tap happy path (open bottom sheet → confirm → confirm) and asserts the confirmation view is reached in exactly two tap events. Run this test in CI on every PR touching the wizard. Treat any failure as a blocking defect.

Contingency: If a new feature unavoidably adds a tap to the happy path, provide a 'quick mode' toggle in user settings that collapses the wizard to a single-confirmation screen for users who never change defaults.

medium impact medium prob technical

Flutter bottom sheets are dismissed on back-button press or background tap by default. If the wizard state is not preserved, a peer mentor who accidentally dismisses mid-flow loses all their entered data and must start over — a significant frustration for users with cognitive disabilities or motor impairments who take longer to fill each step.

Mitigation & Contingency

Mitigation: Implement the wizard state as a persistent Cubit that outlives the bottom sheet widget's lifecycle, scoped to the registration feature route. On re-open, the Cubit restores the previous step and field values. Add a 'discard changes?' confirmation dialog when the user explicitly dismisses a partially filled wizard.

Contingency: If persistent state proves difficult to implement with the chosen routing strategy, implement draft auto-save to a local draft repository every time a field value changes, and restore from draft on the next open.

high impact high prob technical

Multi-step wizard bottom sheets are among the most complex accessibility scenarios in Flutter. Screen readers (TalkBack, VoiceOver) may not announce step transitions, focus may land on the wrong element after advancing, and animated transitions can interfere with the accessibility tree update cycle — making the feature unusable for Blindeforbundet users who rely on screen readers.

Mitigation & Contingency

Mitigation: Assign each wizard step a unique Semantics container with a live region announcement on mount. Use ExcludeSemantics on inactive steps during transition animations. Test each step transition manually with TalkBack and VoiceOver as part of the definition of done for each step component.

Contingency: If animated transitions cause accessibility tree corruption, disable step transition animations entirely in accessibility mode (detected via MediaQuery.accessibleNavigation) and use instant step replacement instead.

medium impact medium prob dependency

The NotesStep relies on the OS keyboard's built-in dictation button for speech-to-text input. This button's availability, position, and behaviour varies significantly between iOS (reliable, visible dictation key) and Android (varies by keyboard, OEM skin, and language settings). HLF and Blindeforbundet specifically requested this capability; if it is unreliable on Android, it fails a SHOULD HAVE requirement for a significant portion of users.

Mitigation & Contingency

Mitigation: Document that the notes dictation feature depends on the device's native keyboard dictation and requires no in-app microphone permission. Add explicit placeholder copy informing users they can use their keyboard's dictation button. Test on a minimum of three Android OEM keyboards (Gboard, Samsung, Swiftkey) and two iOS versions.

Contingency: If native keyboard dictation is too unreliable on Android, implement a fallback in-app microphone button in the NotesStep that triggers the platform's SpeechRecognition API directly via a method channel, scoped only to the notes field with no session recording capability.