Skip to content

fix(desktop): re-apply UI zoom on show/restore, scoped to chat windows (supersedes #61245) - #61925

Merged
OutThisLife merged 1 commit into
mainfrom
bb/salvage-61245-ui-zoom
Jul 10, 2026
Merged

OutThisLife merged 1 commit into
mainfrom
bb/salvage-61245-ui-zoom

Conversation

@OutThisLife

Copy link
Copy Markdown

Summary

Supersedes #61245.

On Windows, Chromium drops webContents zoom on minimize→restore, so the UI snapped back to 100% while Settings still read 125% (#61081). Zoom was only reasserted on the main window's did-finish-load — never on show/restore, and never for secondary session windows.

This reasserts the persisted zoom on show + restore + first load, wired once in wireCommonWindowHandlers so the main window and session windows share the fix.

What this changes vs #61245

#61245 wired the reassert through wireCommonWindowHandlers, which is also used by the pet overlay — the open question Gille raised in the report thread. Letting the pet inherit global UI zoom is a bug, not a nicety:

  • The overlay sizes its own OS window to fit the sprite in unzoomed CSS px (overlayWindowSize → setBounds). setZoomLevel scales rendered content but not window bounds, so at 125% the sprite renders larger than the window that contains it and gets cropped at the edges (breaking that helper's own "never cropped by the window edge" invariant; the right:0/top:0 mail button can clip off too).
  • The pet already has its own scale system (Alt+wheel gesture + settings slider); global zoom double-scales it and desyncs the fit math.
  • The overlay shares the renderer origin (…/index.html?win=overlay), so it reads the same hermes:desktop:zoomLevel key — fix(desktop): re-apply UI zoom after minimize/restore on Windows #61245 would newly pull the main window's 125% into the mascot on spawn.

So zoom is now opt-out: wireCommonWindowHandlers(win, { zoom: false }) for the pet overlay; chat windows keep it on. (Click-through alpha hit-testing itself stays correct — it's all one CSS-px space — but window-fit + the screen/CSS coordinate mixing in drag/pop-out is where zoom bites.)

Files

Test plan

  • npx tsx --test electron/zoom.test.ts → 10 passed
  • tsc -p apps/desktop --noEmit → no errors in changed files
  • Windows: set UI Scale 125%, minimize→restore → stays 125%; open a session window → inherits 125%; pop out the pet → renders 1× and uncropped

Credit: @HexLab98 (original fix + helper tests), preserved via Co-authored-by. Closes the pet-scope review question from the report thread.

Windows drops webContents zoom on minimize/restore, so the UI snapped back
to 100% while Settings still read 125%. Zoom was only reasserted on the main
window's did-finish-load, never on show/restore and never for session windows.

Reassert the persisted level on show/restore + first load, wired once in
wireCommonWindowHandlers so the main window and secondary session windows
share it. The pet overlay opts out (zoom:false): it sizes its own OS window
to fit the sprite in unzoomed CSS px and has its own Alt+wheel scale, so
inheriting the global zoom would render the mascot larger than its window and
crop it (and it shares the renderer origin's zoom localStorage key).

Salvages #61245; keeps its pure-helper tests and adds a scope assertion.

Co-authored-by: HexLab98 <liruixinch@outlook.com>
@OutThisLife
OutThisLife enabled auto-merge July 10, 2026 07:14
@OutThisLife
OutThisLife merged commit 1318cd9 into main Jul 10, 2026
20 checks passed
@OutThisLife
OutThisLife deleted the bb/salvage-61245-ui-zoom branch July 10, 2026 07:14
@alt-glitch alt-glitch added type/bug Something isn't working comp/desktop Electron desktop app (apps/desktop/*) platform/windows Native Windows-specific behavior or breakage sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows P3 Low — cosmetic, nice to have labels Jul 10, 2026
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
…245-ui-zoom

fix(desktop): re-apply UI zoom on show/restore, scoped to chat windows (supersedes NousResearch#61245)
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
…245-ui-zoom

fix(desktop): re-apply UI zoom on show/restore, scoped to chat windows (supersedes NousResearch#61245)
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
…245-ui-zoom

fix(desktop): re-apply UI zoom on show/restore, scoped to chat windows (supersedes NousResearch#61245)
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…245-ui-zoom

fix(desktop): re-apply UI zoom on show/restore, scoped to chat windows (supersedes NousResearch#61245)
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 2026
…245-ui-zoom

fix(desktop): re-apply UI zoom on show/restore, scoped to chat windows (supersedes NousResearch#61245)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have platform/windows Native Windows-specific behavior or breakage sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants