Skip to content

fix(workspace): remember left panel width across collapse - #2745

Open
HandSonic wants to merge 1 commit into
OtterMind:mainfrom
HandSonic:fix/workspace-panel-width-restore
Open

fix(workspace): remember left panel width across collapse#2745
HandSonic wants to merge 1 commit into
OtterMind:mainfrom
HandSonic:fix/workspace-panel-width-restore

Conversation

@HandSonic

Copy link
Copy Markdown
Contributor

Related issue

N/A — regression found by reviewing 2771426 + its persistence helper; described below.

Summary

togglePanelLeft reset the live width to the 260px default on expand, and getPersistableWorkspaceLayout stored 0 while collapsed — a user's custom sidebar width was permanently lost after collapsing (or reloading while collapsed). The layout now tracks lastPanelLeftWidth alongside the live width via a pure nextPanelLeftLayout helper: collapsing remembers the current width, expanding restores it, setPanelLeftWidth keeps it fresh, and persistence/hydration carry the remembered value (legacy layouts without it fall back to previous behavior).

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

Risk and compatibility

  • Public API or stored data: persisted workspace layout gains one additive key; missing key hydrates to legacy behavior.
  • Database or driver compatibility: N/A.
  • Network, privacy, or security: N/A.
  • Community / Local / Pro boundary: N/A.
  • Backward compatibility: legacy persisted 0 still means collapsed.

Reviewer map

  • Start here: slices/config/initialState.ts (nextPanelLeftLayout) then action.ts and workspaceTabPersistence.ts.
  • Failure condition: none expected; default 260 only when nothing was ever remembered.
  • Rollback or disable path: revert single commit.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: substantial — fix and tests drafted with AI assistance, verified locally.

togglePanelLeft reset the live width to the 260px default on expand and
getPersistableWorkspaceLayout stored 0 while collapsed, so a user's custom
sidebar width was permanently lost after collapsing (or a reload while
collapsed). The layout now tracks lastPanelLeftWidth alongside the live
width: collapsing remembers the current width, expanding restores it, and
persistence/hydration carry the remembered value (legacy layouts without it
fall back to the previous behavior).
@HandSonic
HandSonic requested review from a team and openai0229 as code owners August 23, 2026 18:55
@openai0229 openai0229 moved this to In Review in Chat2DB Community Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants