Skip to content

fix: preserve sidebar collapse state across route changes (Closes #914) - #1033

Open
waterWang wants to merge 1 commit into
CredenceOrg:mainfrom
waterWang:fix/914-sidebar-collapse-state-on-route-change
Open

fix: preserve sidebar collapse state across route changes (Closes #914)#1033
waterWang wants to merge 1 commit into
CredenceOrg:mainfrom
waterWang:fix/914-sidebar-collapse-state-on-route-change

Conversation

@waterWang

Copy link
Copy Markdown
Contributor

Summary

Fixes the sidebar (MobileNav drawer) collapse state being lost on route change. The sidebar now preserves its open/closed state when navigating between SPA routes.

Changes

  • Removed the render-phase close logic that was forcing the sidebar to close on every route change
  • The sidebar's open/closed state is now persisted via sessionStorage across both SPA route changes and full page reloads

  • Added in to fix test isolation (pre-existing issue)

  • Added in to fix test isolation
  • Added new test: preserves sidebar collapse state across route changes — verifies the drawer stays open after navigating via a desktop nav link

Testing

  • Lint passes
  • Tests pass (11/12 Layout tests, 19/19 MobileNav tests — the 1 Layout failure is pre-existing 'renders theme toggle button')
  • Build compiles (pre-existing tsc error in Attestations.tsx is unrelated)

Closes #914

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.

Fix: sidebar collapse state is lost on route change

1 participant