Skip to content

feat(session): persist accordion collapse state across session views - #560

Open
RonenMars wants to merge 4 commits into
mainfrom
feat/persist-accordion-collapse-state
Open

feat(session): persist accordion collapse state across session views#560
RonenMars wants to merge 4 commits into
mainfrom
feat/persist-accordion-collapse-state

Conversation

@RonenMars

Copy link
Copy Markdown
Owner

Summary

  • Add a viewPrefs zustand store (AsyncStorage-backed, hydrated on startup) that persists collapsible-section state across app restarts.
  • Tree view: server accordions remember their collapsed state; a lone visible server still force-expands via the existing multiServer gate.
  • Browse view: the recent-directories accordion remembers open/closed.
  • Hub view: server accordions reuse the same persisted collapsedServers, so a collapsed server stays collapsed across the tree and hub layouts.
  • Classic view: the live-sessions header persists via a nullable flag where null keeps the count-based default and an explicit toggle is remembered.

Test plan

  • __tests__/unit/stores/viewPrefs.test.ts (6 tests) and collapsedServerLockout.test.ts pass
  • Collapse a server in tree/hub, restart app, verify it stays collapsed
  • Collapse then remove the other server — the remaining single server shows expanded
  • Toggle the browse recents accordion, restart, verify state persists
  • Toggle the classic live-sessions header, restart, verify state persists

Add a viewPrefs store that persists via AsyncStorage which tree-view server accordions the user collapsed and whether the browse-view recent-directories accordion is open, hydrated on startup.
Single-server tree view still renders expanded regardless of the saved flag, via the existing multiServer gating.
Hub server accordions now reuse the shared persisted collapsedServers, so a collapsed server stays collapsed across the tree and hub layouts (single-server force-expand still handled by the existing collapseApplies gate).
Classic's live-sessions header persists via a nullable flag where null keeps the count-based default and an explicit toggle is remembered.
…d classic

Rename the persisted classicSessionsCollapsed flag to sessionsHeaderCollapsed and wire both the tree and classic views to it, so the live-sessions header keeps the same collapsed state when switching layouts (matching how the server accordion is already shared between tree and hub).
…stency

The merged classic list (MergedClassicList in app/index.tsx) kept its own local server-accordion and live-sessions-header state.
Wire both to the shared viewPrefs store so a collapsed server and the live-sessions header stay consistent across the tree, hub, and classic layouts.
@RonenMars
RonenMars force-pushed the feat/persist-accordion-collapse-state branch from c664415 to 2321a45 Compare August 8, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant