fix(ui): preserve right panel width across minimize and restore - #850
Conversation
Keep the selected right drawer width separate from transient viewport constraints. Native minimize resize events previously clamped and persisted the preference to the 200px minimum, so restoring the window could not recover the user's layout. Use the existing drawer layout to constrain display without changing the saved width. Divider gestures still update the preference; overlay transitions and responsive center-width limits remain unchanged in the shared Tauri/Electron UI. Add real Solid shell browser regressions for zero and small transient viewport measurements, ordinary shrink/restore, overlay transitions and subsequent user resizing. Both tests fail before the fix. UI typecheck and drawer layout unit tests pass; wider browser and native Tauri checks are recorded in the PR.
pascalandr
left a comment
There was a problem hiding this comment.
Independent gatekeeper review — a0a02fc
I had an independent reviewer inspect the complete three-file diff. Zero actionable findings.
The reviewer checked responsive display constraints, the 390px conversation minimum, overlay transitions, explicit divider resizing, listener cleanup, shared host behavior, and opt-in fixture initialization. Five targeted checks passed: the two new browser regressions, two drawer-layout unit tests, and the existing docked-drawer browser test. Whitespace validation passed.
The review does not claim native desktop validation or native snapshot-storage coverage. Existing mount-time clamping when reloading a narrow window is unchanged and outside this minimize/restore fix. An existing Electron-only fixture could not run because Electron is not installed in this isolated checkout; desktop validation is Tauri-only.
The existing shell file remains oversized at approximately 1,335 lines; this change does not attempt an unrelated refactor.
Summary
I stopped window resize events from overwriting the right panel's saved width. Minimizing can briefly report a tiny viewport and previously persisted the 200px minimum; restoring then retained that reduced width.
The existing drawer layout still constrains the displayed width when space is limited. Explicit divider resizing still updates the saved preference. This is a shared UI change for Tauri and Electron, with no host-specific workaround.
Validation
I added browser regressions using the real Solid shell for transient 0/160/320px viewport measurements, ordinary viewport shrink/restore, overlay transitions, and subsequent divider resizing. Both new tests fail before the fix.
I ran the UI typecheck, two drawer-layout unit tests, and 33 renderer checks across runs. One cold-navigation timeout passed on an isolated rerun. The existing Electron-only fixture was unavailable in this checkout and excluded from the Tauri-only validation.
I built the Windows Tauri release executable (
tauri build --no-bundle), passed packaged-resource checks, and launched/closed it with an isolated config. I did not replace the installed app, restart OpenCode, or repeat the native minimize reproduction after the user's confirmation. Native minimize/restore acceptance on the new binary is therefore not claimed; the regressions cover the real renderer's resize and persistence path.Independent gatekeeper review: zero actionable findings on
a0a02fc3398aaf1de35ac29e408336b909ce1650, published in this PR. The existinginstance-shell2.tsxremains approximately 1,335 lines; no unrelated refactor is included.Closes #849