Role Switch Widget
Component Detail
User Interface
medium complexity
mobile
0
Dependencies
0
Dependents
0
Entities
0
Integrations
Description
A bottom-sheet picker that lists all role-organization pairs available to the current user, sourced from user_organization_roles. Renders only when the user holds two or more role-org pairs; users with a single membership do not see the entry point. Maintains WCAG 2.2 AA focus management throughout the context-switch transition.
role-switch-widget
Sources & reasoning
NHF explicitly requires support for membership in up to five local chapters with clear affiliation switching. The role switch entry point is listed as a reusable widget in the mobile architecture, confirming it is a discrete UI component with its own lifecycle and display logic.
No source references — this artifact was included based on reasoning alone (see above).
Responsibilities
- Render a bottom-sheet list of available role-org pairs for the authenticated user
- Hide the entry point entirely when the user has only one role-org membership
- Emit a context-switch event with the selected role and organization IDs on confirmation
- Manage WCAG-compliant focus during sheet open, selection, and sheet close
Interfaces
show(availableContexts: List<RoleOrgPair>): void
onContextSelected: Stream<RoleOrgPair>
dismiss(): void