From 3a4dde3f4a7a5ddf06048fdac8ce05c84d9882ad Mon Sep 17 00:00:00 2001 From: songoten Date: Mon, 15 Jun 2026 09:50:10 +0700 Subject: [PATCH] fix(desktop): persist zoom level across conversations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a user zooms in (Cmd+=) in one conversation and switches to another via the sidebar, Chromium's per-URL per_host_zoom_levels resets the zoom to 1.0 for the unseen URL. The app already persists the zoom level in localStorage and restores it on mainWindow's did-finish-load, but session windows and hash-route navigations within the same window did not re-apply the persisted zoom. Move restorePersistedZoomLevel from the one-shot mainWindow callback into wireCommonWindowHandlers so it runs on every did-finish-load for every window — cold start, session window open, reload, and hash-route transitions inside the SPA all re-apply the user's chosen zoom level. --- apps/desktop/electron/main.cjs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/desktop/electron/main.cjs b/apps/desktop/electron/main.cjs index c714a46ee467d..37fbaae12d072 100644 --- a/apps/desktop/electron/main.cjs +++ b/apps/desktop/electron/main.cjs @@ -5056,6 +5056,14 @@ function wireCommonWindowHandlers(win) { event.preventDefault() openExternalUrl(url) }) + // Restore persisted zoom level after every full navigation (cold start, + // session window open, reload). Without this, a user who zooms in + // (Cmd+=) on one conversation and switches to another via sidebar loses + // their zoom — the new hash route triggers Chromium's per-URL + // per_host_zoom_levels which resets to 1.0 for the unseen URL. + win.webContents.on('did-finish-load', () => { + restorePersistedZoomLevel(win) + }) } // Secondary "session windows" — one extra OS window per chat so a user can @@ -5256,7 +5264,6 @@ function createWindow() { } mainWindow.webContents.once('did-finish-load', () => { - restorePersistedZoomLevel(mainWindow) broadcastBootProgress() sendWindowStateChanged() startHermes().catch(error => rememberLog(error.stack || error.message))