Skip to content

fix(shell): restore desktop sidebar state after mobile resizing - #1059

Open
xuzijian2019 wants to merge 1 commit into
agegr:mainfrom
xuzijian2019:fix/sidebar-breakpoint
Open

xuzijian2019 wants to merge 1 commit into
agegr:mainfrom
xuzijian2019:fix/sidebar-breakpoint

Conversation

@xuzijian2019

Copy link
Copy Markdown

Fixes #1057.

Resize an open desktop sidebar to mobile, close the drawer, then resize back: the desktop sidebar stays hidden because both layouts use the same open flag.

Remember the desktop preference separately and restore it when returning to desktop. Only explicit desktop toggles update the preference; mobile drawer and toolbar actions keep their current behavior. Seed the preference from the initial URL sidebarCollapsed value so an explicitly collapsed layout stays collapsed across hydration and resizing.

Validation

  • Three behavioral regression tests execute the component's real breakpoint effect and toggle callback, covering open desktop → closed mobile drawer → desktop, explicit desktop collapse → mobile open → desktop, and URL collapse with repeated breakpoint crossings.
  • npm test: 2,286 tests passed.
  • node_modules/.bin/tsc --noEmit and npm run lint passed.
  • git diff --check passed.
  • No browser E2E performed.

Adapted from the desktop fork's independent fix; original tracking: xuzijian2019/pi-agent-desktop#10. No desktop or fork UI dependencies.

Change-Id: I3cd96254c43ddb59da17f60bd0e3d4e19de914f8

This branch has not been deployed

No deployments
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.

Desktop sidebar stays hidden after resizing through the mobile breakpoint

1 participant