feat(macos): make close-to-tray behavior configurable
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
## Motivation
On macOS, closing Buzz's main window leaves the process and local agents running but hides the only main window. This is useful for background agent work, but it is currently unconditional and has no user-facing preference.
A user who uses BetterTouchTool's application/window switcher with **Exclude Hidden and Minimized Windows** enabled sees Buzz disappear from the switcher even though Buzz is still running. This makes Buzz feel "windowless": it remains active in the menu bar/process list, but it cannot be returned through the user's normal app-switching workflow.
BetterTouchTool exposes this exclusion as a global switcher option; its documented configuration does not provide a per-app override that can re-include one hidden app.
## Current behavior
The macOS close handler in [`desktop/src-tauri/src/lib.rs`](https://github.com/block/buzz/blob/main/desktop/src-tauri/src/lib.rs#L958-L969) unconditionally:
1. calls `api.prevent_close()`;
2. calls `window.hide()`.
The tray menu's **Open Buzz** path restores the main window with `unminimize()`, `show()`, and `set_focus()` in [`desktop/src-tauri/src/tray_menu.rs`](https://github.com/block/buzz/blob/main/desktop/src-tauri/src/tray_menu.rs).
I searched the current settings/source and found no preference that changes this close-to-tray behavior.
## Proposed behavior
Add a macOS preference for what happens when the main window is closed:
- **Keep Buzz running in the menu bar** — current behavior and recommended default, preserving active agent work.
- **Quit Buzz when the last main window closes** — for users who prefer conventional visible-window app switching and do not want a windowless background process.
If quitting would stop active agent sessions or a huddle, Buzz should warn or require confirmation before exiting.
At minimum, the UI should explain that closing the main window hides Buzz to the menu bar and that **Open Buzz** restores it.
## Reproduction
1. On macOS, open Buzz.
2. Close the main window with the red close button.
3. Confirm Buzz remains running and its menu-bar item remains available.
4. Open BetterTouchTool's switcher with **Exclude Hidden and Minimized Windows** enabled.
5. Buzz is absent because its main window is hidden.
6. Use the Buzz menu-bar item → **Open Buzz**; the main window returns.
## Related
- #2412 requests background/tray mode so closing the window does not kill agent sessions. This request is the complementary macOS preference: keep that capability as the default, but make it optional and explicit.
- BetterTouchTool Window Switcher configuration: https://docs.folivora.ai/docs/actions/action-definitions/#window-switcher
## Environment
- Buzz Desktop for macOS
- BetterTouchTool Window Switcher with **Exclude Hidden and Minimized Windows** enabled
Contributor guide
Assessment
This issue has not been assessed yet.