Skip to content

fix(desktop): re-apply UI zoom after minimize/restore on Windows - #61245

Closed
HexLab98 wants to merge 2 commits into
NousResearch:mainfrom
HexLab98:fix/desktop-zoom-minimize-restore
Closed

HexLab98 wants to merge 2 commits into
NousResearch:mainfrom
HexLab98:fix/desktop-zoom-minimize-restore

Conversation

@HexLab98

@HexLab98 HexLab98 commented Jul 9, 2026 •

Copy link
Copy Markdown

Summary

  • Re-apply the persisted UI zoom level when a desktop window is shown or restored, fixing Windows minimize/restore snapping back to 100% while Settings still shows 125%/150%.
  • Wire zoom restore through wireCommonWindowHandlers so secondary session windows get the same lifecycle coverage as the main window.

Fixes #61081

Test plan

  • npx tsx --test apps/desktop/electron/zoom.test.ts
  • Windows: set UI Scale to 125%, minimize, restore — scale should stay at 125%

HexLab98 added 2 commits July 9, 2026 08:54
Chromium can drop webContents zoom when a BrowserWindow is minimized and
restored. Re-assert the persisted level on show/restore for every chat
window, not only on the initial did-finish-load.
@HexLab98
HexLab98 force-pushed the fix/desktop-zoom-minimize-restore branch from 0476436 to 437cb08 Compare July 9, 2026 01:55
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have 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 labels Jul 9, 2026
@OutThisLife

Copy link
Copy Markdown

Superseded by #61925.

Same core fix (reassert persisted zoom on show/restore + first load, shared via wireCommonWindowHandlers), plus it resolves the open review question from the report thread: the pet overlay is scoped out of global UI zoom (wireCommonWindowHandlers(win, { zoom: false })).

Letting the pet inherit zoom is a bug, not a nicety — it sizes its own OS window to fit the sprite in unzoomed CSS px (overlayWindowSize → setBounds), so a 125% webContents zoom renders the mascot larger than its window and crops it; it also has its own Alt+wheel scale, and it shares the renderer origin's hermes:desktop:zoomLevel key, so your PR would have newly pulled the main window's zoom into the mascot on spawn.

Your pure-helper tests are kept and you're credited via Co-authored-by. Thanks for the fix + the clean installZoomReassertOnWindowEvents helper.

@OutThisLife

Copy link
Copy Markdown

Closing in favor of #61925 (adds pet-overlay zoom scoping on current main).

OutThisLife added a commit that referenced this pull request Jul 10, 2026
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 added a commit that referenced this pull request Jul 10, 2026
fix(desktop): re-apply UI zoom on show/restore, scoped to chat windows (supersedes #61245)
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
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 NousResearch#61245; keeps its pure-helper tests and adds a scope assertion.

Co-authored-by: HexLab98 <liruixinch@outlook.com>
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)
justemu pushed a commit to justemu/hermes-agent that referenced this pull request Jul 18, 2026
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 NousResearch#61245; keeps its pure-helper tests and adds a scope assertion.

Co-authored-by: HexLab98 <liruixinch@outlook.com>
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
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 NousResearch#61245; keeps its pure-helper tests and adds a scope assertion.

Co-authored-by: HexLab98 <liruixinch@outlook.com>
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
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 NousResearch#61245; keeps its pure-helper tests and adds a scope assertion.

Co-authored-by: HexLab98 <liruixinch@outlook.com>
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
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 NousResearch#61245; keeps its pure-helper tests and adds a scope assertion.

Co-authored-by: HexLab98 <liruixinch@outlook.com>
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
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 NousResearch#61245; keeps its pure-helper tests and adds a scope assertion.

Co-authored-by: HexLab98 <liruixinch@outlook.com>
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.

Windows desktop: UI scaling resets after minimizing and restoring the window

3 participants