Skip to content

feat(desktop): close to tray instead of exiting - #41520

Open
2031814001yuyue-tech wants to merge 2 commits into
anomalyco:devfrom
2031814001yuyue-tech:desktop-close-to-tray
Open

feat(desktop): close to tray instead of exiting#41520
2031814001yuyue-tech wants to merge 2 commits into
anomalyco:devfrom
2031814001yuyue-tech:desktop-close-to-tray

Conversation

@2031814001yuyue-tech

Copy link
Copy Markdown

Issue for this PR

Closes #18134

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Clicking X on the desktop app used to quit it entirely, which killed any
running agent work. This makes the window hide to the system tray instead
on Windows/Linux. Tray menu has Show/Quit, clicking the tray icon brings
the window back. Quitting still works normally through the tray menu, the app menu, Cmd+Q and system signals.

How did you verify your code works?

  • Wrote unit tests for the close decision logic and the tray module (20 pass)
  • Ran the built app on Windows 11. Closing the window hides it, process
    stays alive. Tray Show restores it, tray Quit exits cleanly.

Screenshots / recordings

None - it's system tray behavior, verified through the runtime checks above.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

- Windows/Linux: closing the last window hides it to the system tray so
  background agent work keeps running; tray menu offers Show/Quit and
  single/double click restores the window.
- macOS: no behavior change (native close-to-Dock preserved).
- Real quits (tray Quit, app menu, Cmd+Q, SIGTERM) close normally.
- Pure resolveCloseAction decision logic with unit tests; tray module
  mocked-tested; window registry exposes isQuitting().

Closes anomalyco#18134 (desktop close-to-tray)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Desktop: Close button should minimize to system tray instead of exiting

1 participant