Add accessibility metadata to all route declarations
epic-navigation-and-gesture-accessibility-foundation-task-006 — Annotate every route declaration in NavigationRouteConfig with its RouteMetadata: semanticsLabel for screen-reader announcement on navigation, suppressSwipeBack=true for all routes, and a semanticsIdentifier used by the accessibility audit runner. Ensure metadata is accessible at runtime via a routeMetadataFor(location) lookup function so the NavigationAccessibilityService can read it without coupling to GoRouter internals.
Acceptance Criteria
Technical Requirements
Execution Context
Tier 2 - 518 tasks
Can start after Tier 1 completes
Implementation Notes
Implement `routeMetadataFor` using a two-pass approach: first try exact match, then attempt path-pattern matching by replacing path segments that look like IDs (UUID pattern or numeric) with the `:param` placeholder from the declared route pattern. A simple regex `RegExp(r'[0-9a-f-]{8,}|\d+')` on each segment is sufficient. Keep `_metadataMap` as a `const Map
Norwegian labels must be reviewed with a native speaker; use the organization's own terminology from the workshop notes (e.g., 'Aktiviteter' not 'Arbeid' if that is what HLF uses).
Testing Requirements
Unit tests in `test/navigation/route_metadata_test.dart`: (1) Call `routeMetadataFor` for each of the five tab roots and assert non-null result with correct `semanticsLabel`. (2) Call `routeMetadataFor('/contacts/detail/abc123')` and assert it matches the parameterized route metadata. (3) Call `routeMetadataFor('/unknown/path')` and assert `null` return. (4) Iterate all entries in the metadata map and assert `suppressSwipeBack == true` for every entry (regression guard).
(5) Assert `semanticsIdentifier` values are non-empty and contain no whitespace. Coverage target: 100% of the lookup function's branches.
StatefulShellRoute branch navigator state can interact unexpectedly with GoRouter's imperative navigation (go, push, replace), causing state snapshots to desync from actual route stacks. This could manifest as a user returning to a tab and seeing a different screen than expected, breaking the core motor-fatigue promise.
Mitigation & Contingency
Mitigation: Write integration tests that simulate cross-tab navigation with nested pushes before any UI layer is built. Pin go_router to a tested minor version and review the StatefulShellRoute changelog before upgrading.
Contingency: If branch navigator state consistently desyncs, fall back to a manual stack snapshot strategy using a custom NavigatorObserver that records and replays navigation events independently of StatefulShellRoute internals.
Persisted navigation stacks in shared_preferences can become stale or corrupt if route paths are renamed during development, causing app crashes or infinite redirect loops on cold start for users who have an old snapshot.
Mitigation & Contingency
Mitigation: Version the persisted schema with a format key. On app start, validate that all stored route paths exist in the current route config before restoring; silently discard invalid entries rather than crashing.
Contingency: Implement a safe-mode cold start that skips state restoration after a detected crash (via a dirty-launch flag written at startup and cleared on successful first frame), falling back to the default root tab.