Implement localized error state for inactive or unreachable org
epic-organization-selection-and-onboarding-ui-task-004 — When OrgSelectionService returns an error (inactive org, network failure, or unreachable tenant), show a localized inline error state within OrgSelectionScreen instead of a generic dialog. The error message must use plain-language wording, reference the selected org name, suggest a retry action, and provide a contact support link. Error strings must be defined in the app's localization files and must not be hardcoded.
Acceptance Criteria
Technical Requirements
Execution Context
Tier 3 - 413 tasks
Can start after Tier 2 completes
Implementation Notes
Define a sealed class or enum OrgSelectionErrorType { inactive, network, unreachable } and include it in the OrgSelectionError state alongside the orgName string. In the screen, use a BlocBuilder that switches on errorType to select the correct localization key. Place the error banner at the top of the scrollable content area (below the OnboardingProgressIndicator if present) — not as an overlay. Use Flutter's built-in localization ARB files; add parameterized messages with the org name as a placeholder argument.
For the support link, use url_launcher to open mailto or a web URL. Ensure the Semantics node for the banner has liveRegion: true so TalkBack/VoiceOver reads it without user focus. The retry button should dispatch the same SelectOrg event stored in the error state.
Testing Requirements
Write widget tests for each error type: (1) inactive org shows inactive_org_error string with correct org name interpolated, (2) network failure shows network_error string, (3) unreachable tenant shows unreachable_tenant_error string. Verify: (4) retry button re-triggers selection, (5) support link widget is present and has correct URL, (6) no hardcoded strings exist (grep test). Write Cubit unit test ensuring OrgSelectionError carries the errorType and orgName fields. Use flutter_test with a test localization delegate.
Verify WCAG contrast in design review, not in automated tests.
OrgSelectionScreen and OrgContextSwitcher render partner-specific logos, colors, and text from dynamic data. Golden tests (pixel-comparison screenshots) will fail whenever branding assets are updated in the backend, causing CI failures that block unrelated PRs and eroding developer trust in the test suite.
Mitigation & Contingency
Mitigation: Use fixture-based golden tests with static mock Organization models containing embedded test assets rather than network-fetched assets. Separate branding asset acceptance tests into a dedicated CI job that only runs on branding-related PRs and is maintained by the design team.
Contingency: If golden test maintenance overhead becomes excessive, replace pixel-comparison goldens with semantic widget tests that assert widget tree structure and key property values, reserving golden tests for only the most stable, design-critical elements.
Several partner organizations (especially Blindeforbundet) have users who rely entirely on VoiceOver or TalkBack. Complex branded card layouts with overlaid logos, names, and selection states are notoriously difficult to make fully accessible; missing semantics or incorrect focus order could make the selection screen completely unusable for screen reader users before launch.
Mitigation & Contingency
Mitigation: Involve an accessibility specialist in the design review before any widget implementation begins. Use Flutter's Semantics widget with explicit label, hint, and button role on OrgCardWidget. Conduct manual screen reader testing on both iOS (VoiceOver) and Android (TalkBack) for every sprint that touches these screens, not just before release.
Contingency: If full WCAG compliance cannot be achieved within the sprint, implement a simplified text-list fallback mode that activates when the system detects an active screen reader, presenting orgs as plain accessible list tiles instead of the branded card layout.