high priority low complexity frontend pending frontend specialist Tier 0

Acceptance Criteria

Widget pre-selects today's date on mount when no initialDate is provided
Three quick-select chips are rendered: 'Today', 'Yesterday', '2 days ago' — labels are human-readable and locale-aware (not raw date strings)
Selecting a quick-select chip updates the selected date and calls onChanged(DateTime date)
A 'Choose another date' button (or link) opens Flutter's showDatePicker with initialDate set to the currently selected date
Dates selected via the calendar picker are reflected in the chip area — if the selected date matches today/yesterday/2 days ago, that chip appears highlighted; otherwise chips appear unselected and the selected date is shown as formatted text
All date strings use the intl package DateFormat respecting the device locale (e.g., Norwegian 'nb_NO' renders '14. april 2025')
The date picker is accessible: showDatePicker is Flutter's built-in picker which supports keyboard and switch navigation natively — no custom picker is used
Selected date cannot be in the future — dates after today are disabled in the calendar picker (lastDate: DateTime.now())
Widget accepts an optional DateTime? initialDate and a required ValueChanged<DateTime> onChanged
Widget test verifies pre-fill, chip selection, calendar selection, and future-date restriction

Technical Requirements

frameworks
Flutter
Riverpod
flutter_test
intl
data models
activity
performance requirements
Date chip rendering is synchronous — no async calls during build
security requirements
No date data is persisted by this widget — it only emits via callback; persistence is handled by the repository layer
ui components
DateQuickSelectChip (today, yesterday, 2 days ago)
SelectedDateDisplay (formatted date text when calendar selection falls outside quick options)
AppButton or TextButton ('Choose another date')

Execution Context

Execution Tier
Tier 0

Tier 0 - 440 tasks

Implementation Notes

Compute the three chip dates in a helper method using DateTime.now() normalized to start-of-day (DateTime(now.year, now.month, now.day)) to avoid time-of-day comparison issues. For locale-aware formatting, use DateFormat.yMMMMd(Localizations.localeOf(context).toString()). To make showDatePicker testable, extract the call into a virtual method or a dependency-injected function so tests can stub it. The widget should be a StatelessWidget accepting state from above; avoid internal setState for the selected date.

The 'Choose another date' affordance should be visually secondary (outlined button or text link) to keep the quick-select chips as the primary interaction. Ensure the selected date indicator (when calendar picks a non-quick date) is announced by screen readers via a Semantics label update.

Testing Requirements

Widget tests using flutter_test. Test 1: today's date is pre-selected on mount (compare chip selected state and onChanged not yet called). Test 2: tapping 'Yesterday' chip calls onChanged with DateTime.now().subtract(Duration(days:1)) normalized to midnight. Test 3: simulating a calendar picker selection (mock showDatePicker or use a testable wrapper) updates the displayed date.

Test 4: a future date cannot be selected — verify lastDate constraint passed to showDatePicker. Test 5: locale-formatted date string is correct for a known locale. Test 6: onChanged is called exactly once per user interaction, not on initial mount.

Component
Date Selection Step
ui low
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.