forked from molecule-ai/molecule-core
Width was initialized to 480px on every render, so clicking a different workspace node (which re-mounts SidePanel) discarded any resize the user had done. Fix: - localStorage-backed useState initializer (SSR-safe typeof window guard) - Validates the stored value: must be a finite integer ≥ 320px - Persists the width in the mouseUp handler via a widthRef that stays in sync with the live drag value — avoids spamming localStorage on every pixel during the drag - Extra guard: onMouseUp bails early if not actually dragging (prevents spurious saves on unrelated window mouseup events) - Named constants replace magic numbers 480 / 320 Tests: 5 new cases in SidePanel.tabs.test.tsx — default fallback, valid saved value, too-small saved value, NaN saved value, drag-persist roundtrip. Closes #425 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| e2e | ||
| public | ||
| src | ||
| .env.example | ||
| .gitignore | ||
| Dockerfile | ||
| next.config.ts | ||
| package-lock.json | ||
| package.json | ||
| playwright.config.ts | ||
| postcss.config.js | ||
| tailwind.config.ts | ||
| tsconfig.json | ||
| vitest.config.ts | ||