ProfileSwitchWidget
Component Detail
Description
A persistent UI control displayed in the app header or home screen that shows the user's currently active profile and organization context. It allows users to open a profile picker and select a different organizational role. The widget updates visually to reflect the newly selected profile after a successful switch.
profile-switch-widget
Sources & reasoning
Profile Switching is v1.0 per the blueprint [v1.0] marker, aligning with Fase 2 of the roadmap. The need is driven by NHF's multi-association requirement (line 106) requiring unambiguous affiliation to prevent double-reporting, and the platform-wide design decision that Org Admins are surfaced as Coordinators on mobile (line 257), both demanding a context-switch mechanism that does not require re-authentication.
-
docs/source/likeperson.md · line 106**Håndtering av medlemmer i flere lokallag (opptil 5):** Avklare tilhørighet og hindre dobbeltrapportering.
-
docs/source/likeperson.md · line 257**On mobile, an Org Admin is surfaced as a Coordinator** - they use the same mobile experience as coordinators without a separate UI path.
Responsibilities
- Display the active profile name, role, and organization badge
- Open the profile selection bottom sheet or modal on tap
- Reflect loading state during the context switch operation
- Show error feedback if the switch fails
Interfaces
renderActiveProfile(profile: ActiveProfile): void
openProfilePicker(): void
onProfileSelected(profileId: string): void
setLoadingState(loading: boolean): void