high priority low complexity frontend pending frontend specialist Tier 0

Acceptance Criteria

Widget renders in collapsed state by default; the help icon (question mark) is visible and has a Semantics label of 'Help' (localised)
Tapping the icon expands the widget to show the full help text using AnimatedContainer with a duration between 200ms and 300ms and a curve (e.g., Curves.easeInOut)
Tapping the icon again collapses the widget back to the icon-only state with the same animation
The Semantics node wrapping the icon has `onTap` callback, `hint` set to the `collapsedHint` string when collapsed and `expandedHint` string when expanded
Screen readers (VoiceOver/TalkBack) announce the state change without requiring the user to navigate away and back
The help icon touch target is at minimum 44×44dp (logical pixels) in both states, measured via `tester.getSize()`
The widget can be placed inline next to a TextFormField label without causing the surrounding Row to overflow at 320dp screen width
Widget does not steal focus from the adjacent form field when expanding or collapsing
Tab/focus order is preserved: the form field before the widget, then the help icon, then the form field after — no help text Text widget receives focus
Widget accepts a `helpText` String parameter and a `helpKey` String parameter (for future registry wiring in task-009)
Widget is stateful and manages expand/collapse state internally with no external BLoC/Riverpod dependency

Technical Requirements

frameworks
Flutter
flutter_test
data models
accessibility_preferences
performance requirements
AnimatedContainer animation must run at 60fps on a mid-range Android device (no jank)
Widget must not cause any layout reflow in sibling widgets when expanding — use a ClipRect or constrained Align to contain height changes
security requirements
Help text content is static/localised — no user-controlled input rendered in the expanded state
ui components
InlineContextualHelpWidget
AnimatedContainer
GestureDetector/InkWell
Semantics
Icon (Icons.help_outline)

Execution Context

Execution Tier
Tier 0

Tier 0 - 440 tasks

Implementation Notes

Use a `bool _isExpanded = false` state variable and toggle it in the tap handler. Wrap the GestureDetector or InkWell in a `Semantics` widget with `button: true`, `label: 'Help'`, `hint: _isExpanded ? widget.expandedHint : widget.collapsedHint`, and `onTap: _toggle`. For the AnimatedContainer, animate `height` from `0` to `null` (intrinsic height) — but note that animating to `null` requires wrapping the content in a `ClipRect` and using a measured height or a `SizeTransition` instead.

The recommended pattern is to use `AnimatedSize` wrapping a `Visibility(visible: _isExpanded, ...)` child, which avoids the need to measure the text height explicitly. For the touch target, wrap the Icon in a `SizedBox(width: 44, height: 44)` with an alignment center — do not rely on padding alone, as padding is not part of the semantic bounds on all platforms. Provide `expandedHint` and `collapsedHint` as constructor parameters with sensible English defaults ('Collapse help text' / 'Show help text') so the widget is usable without configuration.

Testing Requirements

Write widget tests covering: (1) default collapsed state — icon visible, help text not visible; (2) tap expands — help text visible after `pumpAndSettle()`; (3) tap again collapses — help text not visible; (4) Semantics hint value changes between collapsed and expanded states; (5) touch target size >= 44×44dp via `tester.getSize()`; (6) focus order test using `FocusTraversalGroup` — confirm help icon is between its neighboring form fields in traversal order. Golden tests for collapsed and expanded visual states. All tests must pass with `flutter test`.

Epic Risks (4)
high impact medium prob technical

The WizardStateManager BLoC must guarantee that step transitions only occur on explicit user action, never automatically. Subtle reactive patterns in Bloc (e.g. stream listeners triggering add() calls) could inadvertently auto-advance the wizard, violating the core cognitive accessibility rule and creating a regression that is difficult to detect without dedicated tests.

Mitigation & Contingency

Mitigation: Write a dedicated unit test that subscribes to the BLoC stream and asserts no StepChanged event is emitted for 5 seconds after a state update, without an explicit user-sourced event being dispatched. Make this test part of the CI gate for the WizardStateManager.

Contingency: If an auto-advance regression is discovered post-integration, introduce a mandatory UserActionToken parameter on all step-transition events so the BLoC can structurally refuse transitions that do not originate from a user gesture handler.

medium impact medium prob integration

The ConfirmBeforeSubmitScreen requires deep-linking back to specific wizard steps for corrections. Implementing bidirectional navigation within a multi-step wizard while preserving all previously entered state is architecturally non-trivial and may conflict with the existing StatefulShellRoute navigation setup described in the app architecture.

Mitigation & Contingency

Mitigation: Design the ConfirmBeforeSubmitScreen's back-navigation links to dispatch a GoToStep event on the WizardStateManager rather than using GoRouter's pop() chain. This keeps navigation state entirely in the BLoC and avoids coupling to the router's stack semantics.

Contingency: If BLoC-driven step navigation proves incompatible with the router, implement the correction flow as a dedicated sub-route that pre-populates its form from the WizardStateManager's current draft, then merges the edited field back into the draft on completion before returning to the confirm screen.

medium impact medium prob technical

The CognitiveAccessibilityAudit utility must inspect live widget trees for violations such as icon-only buttons. Flutter's widget tree inspection APIs are available in test mode but have limitations in identifying semantic intent (e.g. distinguishing a decorative icon from a navigation button). False negatives could give a false sense of compliance.

Mitigation & Contingency

Mitigation: Augment the audit with a convention-based approach: require all navigation buttons to use a named wrapper widget (e.g. LabelledNavigationButton) that the audit can detect by type, rather than relying solely on widget-tree semantics analysis.

Contingency: If widget-tree detection proves insufficiently reliable, scope the CognitiveAccessibilityAudit to route-configuration analysis (verifying back navigation availability per route) and static analysis of wizard step count definitions via the CognitiveLoadRuleEngine, which provides deterministic results.

low impact high prob scope

The InlineContextualHelpWidget sources content from a bundled JSON asset via the HelpContentRegistry. If help texts are missing for newly added screens or fields (a likely scenario as the 61-feature app grows), the widget silently shows nothing, degrading the accessibility experience without any visible failure.

Mitigation & Contingency

Mitigation: Integrate a CognitiveAccessibilityAudit check that verifies every registered (screenId, fieldId) pair that requests help has a corresponding entry in the HelpContentRegistry bundle. Run this check in CI as part of the audit report.

Contingency: Add a debug-mode overlay that highlights fields with missing help entries using a visible warning indicator, making coverage gaps immediately obvious to developers during local development before they reach CI.