User Interface medium complexity mobile
0
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

A mobile UI widget that displays the user's available organizational profiles and role contexts, allowing them to select and switch between them. It renders the current active profile prominently and presents a list or sheet of alternate profiles. The widget reflects the updated context visually after a successful switch without requiring a full app reload.

Feature: Profile Switching

profile-switch-widget

Sources & reasoning

The source doc explicitly lists a "role switch" widget in the shared widget inventory (line 305) and calls out multi-association membership (up to 5 local associations, line 109) as an NHF-specific requirement. The Org Admin-as-Coordinator mobile pattern (line 258) reinforces the need. The blueprint assigns this v1.0, consistent with Fase 2 scope for multi-org handling; MVP covers the single-context case first.

  • docs/source/likeperson.md · line 109
    Håndtering av medlemmer i flere lokallag (opptil 5): Avklare tilhørighet og hindre dobbeltrapportering.
  • docs/source/likeperson.md · line 258
    On mobile, an Org Admin is surfaced as a Coordinator - they use the same mobile experience as coordinators without a separate UI path.
  • docs/source/likeperson.md · line 305
    Reusable widgets: AppButton, AppTextField, bottom nav, page header, role switch, custom fields table

Responsibilities

  • Render the currently active profile with role label and organization name
  • Present a selectable list of available profiles for the authenticated user
  • Trigger profile switch action and display a loading state during context transition
  • Update visual state to reflect the newly selected profile upon successful switch
  • Respect RBAC and module toggle visibility rules per selected organization

Interfaces

renderProfileList(profiles: UserProfile[]): void
onProfileSelect(profileId: string): void
getCurrentProfile(): UserProfile
showSwitchingIndicator(isLoading: boolean): void