// Per-machine window state (not a synced preference, so kept out of settings.json). import { app } from 'electron' import fs from 'node:fs' import path from 'node:path' interface UiState { zoom?: number } const file = (): string => path.join(app.getPath('userData'), 'ui-state.json') function load(): UiState { try { return JSON.parse(fs.readFileSync(file(), 'utf8')) as UiState } catch { return {} } } export function loadZoom(): number { return load().zoom ?? 0 } export function saveZoom(zoom: number): void { fs.mkdirSync(path.dirname(file()), { recursive: true }) fs.writeFileSync(file(), JSON.stringify({ ...load(), zoom }, null, 2)) }