Commit 4633f15
committed
fix(titlebar): sync window width to panel-hidden state on startup
The titlebar's panel-toggle path physically shrinks the OS window by
320px per hidden panel (var(--w-left/right)) — but Tauri does NOT
persist window size across restarts (no tauri-plugin-window-state),
so a user who closed with panels hidden reopened at the full 1600px
default with a stretched-empty center column. Toggling a panel back
on then grew the window past 1600px because adjustWindowForPanel
works in deltas from the current size — every restart-then-show
cycle ballooned the window by another 320px on the affected axis.
Sync the window width to the persisted leftPanelHidden / rightPanelHidden
flags BEFORE invoke('show_main_window') reveals it. The window starts
with visible: false from tauri.conf.json, so the resize completes
during the same paint cycle that flips visibility — no flash.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e514d28 commit 4633f15
1 file changed
Lines changed: 34 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
46 | 79 | | |
47 | 80 | | |
48 | | - | |
| 81 | + | |
49 | 82 | | |
50 | 83 | | |
51 | 84 | | |
| |||
0 commit comments