Files
hermes-agent/apps
Brooklyn Nicholson b415d38c25 fix(desktop): suppress the pet overlay pop-in echo on quit so the popped-out state survives restart (#55920)
On quit, main.ts closes the pet overlay window and its 'closed' handler
unconditionally sent { type: 'pop-in' } to the main renderer, which runs
popInPet() and persists $petOverlayActive=false. restorePetOverlay() on
the next boot therefore skipped restoration and the pet silently reverted
to in-window after every clean quit with the pet popped out.

Latch an appQuitting flag (distinct from isQuittingForHandoff, which is
hand-off-specific and resets) at the top of before-quit, and on the
non-macOS primary-window close path where closing the window IS quitting.
The overlay 'closed' handler now suppresses the pop-in echo while
quitting; a user-initiated overlay close (⌘W) still pops the pet back in.

Supersedes #55934 (liuhao1024) and #58112 (tianma-if), which implemented
the same guard against the since-deleted main.cjs.

Co-authored-by: liuhao1024 <sunsky.lau@gmail.com>
Co-authored-by: yoma <yingwaizhiying@gmail.com>

Fixes #55920
2026-09-30 22:49:35 -05:00
..