high priority low complexity frontend pending frontend specialist Tier 0

Acceptance Criteria

Widget accepts a List<ActivityType> and an optional String? initialSelectedId as constructor parameters
On first render, if initialSelectedId is non-null and present in the list, that chip is pre-selected; otherwise no chip is selected
Each chip has a minimum touch target of 48x48 logical pixels (use SizedBox or Padding to pad smaller chips to meet this requirement)
Selected chip uses a filled/highlighted visual state distinguishable from unselected chips at WCAG AA contrast (4.5:1 for text, 3:1 for non-text indicator)
Each chip is wrapped in a Semantics widget with role semanticsRole == SemanticsRole.radio and inMutuallyExclusiveGroup: true so screen readers announce it as a radio button in a group
Selecting a chip calls the onChanged(ActivityType selected) callback immediately
Only one chip can be selected at a time — selecting a new chip deselects the previous one
If the activity type list is empty, the widget renders an empty state message ('No activity types available') rather than a blank space
Chips are displayed in a Wrap layout that reflows gracefully at narrow screen widths (min 320pt)
Widget test verifies pre-selection, single-selection enforcement, and Semantics tree structure

Technical Requirements

frameworks
Flutter
Riverpod
flutter_test
data models
activity_type
performance requirements
Chip list renders up to 30 items without jank (no ListView rebuild on every selection change)
security requirements
Activity type names displayed verbatim from database — sanitize against XSS-equivalent injection in Flutter text rendering (Flutter Text widget is safe by default; ensure no HTML rendering)
ui components
ActivityTypeChip (custom chip with 48dp touch target)
Wrap (layout container)
EmptyState (text fallback)

Execution Context

Execution Tier
Tier 0

Tier 0 - 440 tasks

Implementation Notes

Implement as a StatelessWidget driven by external state (Riverpod provider or parent widget state) — the widget itself should be purely presentational, receiving selectedId and onChanged. Use Flutter's FilterChip or a custom widget wrapping InkWell with explicit constraints. For Semantics, use Semantics(child: ..., inMutuallyExclusiveGroup: true, selected: isSelected, label: activityType.name). Do not use Radio widgets as they have fixed visual styling that may conflict with design tokens.

The Wrap widget handles reflow automatically — no custom layout needed. Pre-selection logic belongs in the parent (wizard state provider), not inside this widget, to keep it stateless and testable.

Testing Requirements

Widget tests using flutter_test. Test 1: renders N chips for N activity types. Test 2: chip matching initialSelectedId is selected on build. Test 3: tapping an unselected chip fires onChanged and updates selection state.

Test 4: tapping the already-selected chip does not fire onChanged a second time (or fires with same value — document chosen behavior). Test 5: Semantics tree contains radio role nodes in a mutually exclusive group. Test 6: empty list renders empty state message. Test 7: each chip's render box height and width >= 48 logical pixels.

Component
Activity Type 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.