Repository navigation
Description
Summary
Persist the expanded/collapsed state of sidebar navigation groups so each user's navigation layout remains consistent across reloads and authentication sessions.
Current behavior
Navigation groups lose their expanded/collapsed state when the page or session is recreated. Users repeatedly reopen or collapse the same groups.
Desired behavior
Remember the expanded or collapsed state of every collapsible navigation group. Restore it after route navigation, page reload, browser restart where appropriate, and logout/login.
Persistence architecture
Inspect existing user preference/settings infrastructure first. Prefer its per-user preference mechanism, including server-side preferences if available. The state must survive logout/login, so temporary React component state alone is insufficient. If there is no suitable mechanism, choose the smallest clean persistence solution without building a large new settings subsystem.
The preference should be isolated per user where the existing architecture supports that. It must not be coupled to permissions or navigation availability.
Navigation identity
Persist stable internal group IDs, not translated labels such as "Security" or "Sicherheit". Follow existing project schema conventions; conceptually the preference can map a group ID such as security to an expanded/collapsed boolean.
Missing and new groups
Define deterministic behavior when a group is added or removed, a user's permission to see it changes, or stored data contains a stale or unknown group ID. Unknown IDs must never break navigation rendering. Regaining permission should not corrupt a previously stored preference.
Initial/default behavior
Users without a persisted preference retain the current default navigation behavior. Do not introduce surprising initial collapsed states.
UX
Toggling a group should update the UI immediately. If persistence uses a server mutation, update optimistically and save asynchronously with the project's existing safe mutation patterns. Persist only intentional changes and avoid writes during ordinary renders.
Security
Navigation state is only a UI preference. It must never be treated as authorization. Server-side RBAC remains authoritative regardless of the stored or visible navigation state.
Tests
Cover expanding/collapsing, route navigation, reload, logout/login, separate users, new and removed groups, stale IDs, permission changes, localization changes, mobile/sidebar variants where applicable, and absence of excessive persistence requests.
Acceptance criteria
- Collapsible NavItem groups persist expanded/collapsed state.
- State survives page reload and logout/login.
- Preference is isolated per user where supported by the current architecture.
- Stable internal IDs are stored instead of translated display labels.
- Stale or unknown IDs fail safely.
- New groups and permission changes follow documented defaults without corrupting stored state.
- UI responds immediately to a toggle.
- Persistence does not create excessive API/database writes.
- Server-side RBAC is unaffected.
- Automated tests cover persistence and restoration.
- Final Beta UX/accessibility review fix: complete beta accessibility and UX review #74 validates the behavior.
Priority and sequencing
Beta 1 UX polish. Complete before final review #74 and release gate #75.
Activity