Implement OrgLabelsProvider Riverpod stream
epic-peer-mentor-detail-screen-ui-components-task-001 — Create the OrgLabelsProvider as a Riverpod StreamProvider that reactively streams org-specific terminology strings from Supabase. Implement the provider with proper async state handling, caching, and error propagation so downstream widgets can consume labels without managing fetch logic themselves.
Acceptance Criteria
Technical Requirements
Implementation Notes
Use `supabase.from('org_labels').stream(primaryKey: ['id']).eq('org_id', orgId)` as the Supabase stream source. Wrap in a `StreamProvider.family` keyed on org ID so that different org contexts (e.g., multi-org admin) each get their own cached stream. Convert the `List
Testing Requirements
Unit test using flutter_test + riverpod's ProviderContainer. Mock the Supabase stream with a StreamController>>. Test: (1) initial loading state is AsyncLoading, (2) emitting a row transitions to AsyncData with correct label map, (3) stream error transitions to AsyncError, (4) provider disposes cleanly when container is disposed. Use `mockito` or manual fakes — do not call real Supabase.
The org labels system may not yet have label keys defined for peer mentor detail screen terminology (role labels, section headings), requiring additions to the label key registry that must be coordinated with the admin configuration team.
Mitigation & Contingency
Mitigation: Audit existing label keys in the terminology system before starting OrgLabelsProvider integration. Submit required new label keys for admin configuration in parallel with component implementation.
Contingency: If label keys are not available at integration time, use hardcoded English fallbacks with a clear TODO for admin configuration, ensuring the widget renders correctly while keys are being provisioned.
The design token semantic colors (warning, error surface) may not meet WCAG 2.2 AA 4.5:1 contrast ratio when rendered on the app's background surface tokens, requiring design system changes that affect the entire app.
Mitigation & Contingency
Mitigation: Run contrast ratio validation on the token palette during Epic 1 design token implementation. Flag any failing pairs to the design system owner before building UI components that depend on them.
Contingency: If tokens fail contrast requirements, define supplementary high-contrast override tokens specific to alert and badge contexts that meet AA without modifying the global palette.