(key: string, fallback: number)
| 29 | |
| 30 | /* Persist panel widths */ |
| 31 | function loadWidth(key: string, fallback: number): number { |
| 32 | try { |
| 33 | const v = localStorage.getItem(key); |
| 34 | if (v) return Math.max(150, Math.min(600, parseInt(v, 10))); |
| 35 | } catch { /* ignore */ } |
| 36 | return fallback; |
| 37 | } |
| 38 | function saveWidth(key: string, value: number) { |
| 39 | try { localStorage.setItem(key, String(Math.round(value))); } catch { /* ignore */ } |
| 40 | } |