Repository navigation
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: |
DonMecca
left a comment
There was a problem hiding this comment.
Confirming this against a real reproduction on 2.0.18.
I independently reproduced both linked issues on OpenCode Desktop 2.0.18 (macOS 27.0, arm64, Electron 44.4.3 / Chrome 152) and traced the cause to the unconditional win.webContents.setZoomFactor(1) at the top of wireZoom (packages/desktop/src/main/windows.ts), versus the guarded equivalent later in the same function.
Two details from my investigation that this PR appears to handle, in case they're useful for review:
-
Chromium already persists the value.
Preferences→partition.per_host_zoom_levelsholds a real per-origin zoom factor that tracks user gestures. The app restores it and then discards it. So the fix is genuinely a persistence-and-restore problem, not a "nothing is saved" one — consistent with storingzoomFactorinopencode.settings. -
The early window matters. The reset applies to the early/pre-window path too, which is why the shell visibly renders at the restored zoom for a moment at launch before shrinking. Restoring for both early and regular windows (as this PR does) is the right shape.
I also verified the current bundle contains no ZOOM_FACTOR_KEY, so nothing user-side can work around this today — the change needs to ship.
CI is green and the branch reports mergeable. Thanks for writing this up with a two-process Electron relaunch test; happy to re-verify on macOS once there's a build to test.
|
Bumping with an independent verification that this is still needed and that the approach looks right.
Bumping for code-owner review (@Hona, @Brendonovich): this is a daily papercut for anyone on macOS who needs a larger UI, and it is a clear v2 regression from the 1.x behaviour. Small request: can review confirm the persisted key lives in the appearance settings store? #54499 / #44184 add |
|
Heads-up on the current state: as of now this PR reports Everything else still looks good: not a draft, the bot checks (standards / compliance / duplicates) all pass, and this remains the only open PR that fixes the zoom-persistence bug (#50168). #54499 is the font-size/line-height work, not a substitute for this. Ping for a rebase and a code-owner review (@Hona, @Brendonovich) when you have a moment — this is a small, self-contained fix (7 files) that resolves a long-standing v2 regression. |
|
Adding a second data point in case it helps with prioritization.
This has been open since 2026-09-20 and is still not in any release up to 2.0.32. Happy to install a build with this patch applied and report back if a prebuilt artifact or CI build is available. |
|
Consolidating the reports in one place, since this is now confirmed across platforms and versions. Still present on the current release: OpenCode Desktop 2.0.32, freshly installed today (2026-10-17) — Confirmed across: macOS 27.0 arm64 (2.0.18, 2.0.19, 2.0.31, 2.0.32), Linux (2.0.11, 2.0.27), Windows 11 (2.0.27, 2.0.32). This is a clear v2 regression — 1.x restored the last selected zoom. Root cause (unchanged): on window creation the main process runs On the Status of this PR: it is currently I'll try to put together a rebased branch on top of current |
|
Rebased this change onto current
Same fix, replayed on today's
Rebase notes:
Caveat: I rebased on a machine without |
|
Thanks for consolidating all of this — I'm the Windows 11 / 2.0.32 data point in that table, so I can confirm those numbers are current. One thing worth flagging while the reports are fresh, because it's the actual blocker right now: as of 2026-10-18 this PR still reports Two concrete asks:
On testing: I'm happy to be the Windows verification for this. I can't build the desktop app from source on this machine, but if CI publishes an artifact for the branch — or anyone produces a build — I'll install it and report before/after with the exact version string. For context on why this matters to us: the current workaround ( |
|
Opened #56802 from the rebased branch so there is a mergeable target to review: it applies cleanly to So this PR is now effectively superseded by #56802. Options:
Either is fine — the point is just to get the fix into a state a code owner can merge. |
|
Thanks for working on this, and for the cross-platform testing in the thread. Zoom persistence landed in #59277: Settings → Appearance now has a Zoom select (100–200%), and the chosen level is saved and restored on launch. Keyboard and menu zoom step through the same levels. We went with fixed levels instead of saving any zoom factor, so pinch zoom stays temporary. Closing this in favour of that change. |
Issue for this PR
Closes #50168
Closes #49096
Type of change
What does this PR do?
Desktop zoom selected with Ctrl++ / Ctrl+- returns to 100% after quitting and reopening OpenCode. Persist the last selected factor in the existing main-process appearance settings and restore it for both early and regular windows.
Keyboard/renderer, native menu and pinch changes use the same setter. Disabling pinch zoom preserves the selected scale. Missing or invalid stored values fall back to 100%; reset-to-100% is saved too.
How did you verify your code works?
bun run checkpassed (lint and 35 typecheck tasks).Screenshots / recordings
No layout or copy changes. The Electron test verifies the before/after behavior: a selected 140% scale is restored after relaunch instead of returning to 100%.
Checklist