Skip to content

fix(sidebar): preserve canonical section state - #586

Open
beruro wants to merge 2 commits into
developfrom
junyu/sidebar-state-correctness
Open

fix(sidebar): preserve canonical section state#586
beruro wants to merge 2 commits into
developfrom
junyu/sidebar-state-correctness

Conversation

@beruro

@beruro beruro commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Problem

Sidebar cloud-session ordering and persisted section-collapse state can be overridden by pagination/search projections, causing unstable order or lost user state.

Solution

  • Keep the Pinned section from current develop, then sort unpinned cloud-scoped local sessions by canonical activity before pagination.
  • Keep persisted collapse state authoritative while search only filters visible rows.
  • Add focused ordering and collapse-state regression coverage.
  • Keep the ordering invariant compatible with the current Pinned section and backend/local pagination rules.

Potential risks

  • Changes to canonical activity timestamps could alter ordering semantics.
  • Search expansion must not accidentally persist temporary expanded/collapsed state.

A session missing from sessionById falls back to its incoming order until metadata arrives; this preserves visibility but can temporarily defer canonical activity ordering.

Verification

  • ./node_modules/.bin/vitest run for cloudScopedMenuItems.test.ts, menuSelection.test.ts, and workstationSidebarMenuItems.test.ts — 3 files / 20 tests passed on merge commit 1be1125b6.
  • pnpm typecheck — passed on merge commit 1be1125b6.
  • Focused Prettier and ESLint checks for the three conflict-resolution files — passed.
  • git diff --cached --check — passed before the merge commit.
  • GitHub CI for the pushed merge commit is running.

@beruro
beruro force-pushed the junyu/sidebar-state-correctness branch from aa6eb07 to 4d5704b Compare July 30, 2026 15:10
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