Skip to content

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

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

HandSonic wants to merge 2 commits into
OtterMind:mainfrom
HandSonic:fix/workspace-panel-width-restore

Conversation

@HandSonic

@HandSonic HandSonic commented Aug 23, 2026 •

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.

Latest-main revalidation (2026-09-04)

  • Rebased onto upstream 144a04e; current head a9c2f11.
  • Workspace layout/persistence tests and targeted ESLint passed.
  • Playwright resized the left panel from 260px to about 420px, collapsed and restored the exact width, then reloaded and confirmed the persisted width.
  • Included in the green combined Community production build and bundle verification.

@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
@HandSonic
HandSonic force-pushed the fix/workspace-panel-width-restore branch from b5f6311 to 72be1d1 Compare September 3, 2026 08:25
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 force-pushed the fix/workspace-panel-width-restore branch from 72be1d1 to a9c2f11 Compare September 3, 2026 21:08
Align existing OtterMind/Chat2DB PR OtterMind#2745, retaining its focused behavior and current Community contracts.

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

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants