feat(desktop): add close-to-tray option - #3157
Open
Cvv9 wants to merge 1 commit into
Open
Conversation
This was referenced Jul 27, 2026
Add a "Keep Buzz running in the tray" General setting. When enabled, closing the main window hides it to a system tray icon instead of quitting; left-click or the tray menu reopens it, and "Quit Buzz" exits. The preference is persisted in localStorage and pushed to the backend, which decides at window-close time whether to hide or quit. The tray icon is created lazily only while the feature is enabled, so users who never opt in never see it. Enabling fails closed: if the tray icon cannot be built the setting stays off, so the close button always has a way to quit. A genuine app exit marks the window as quitting so teardown is not trapped by the hide-to-tray handler, the macOS dock icon re-shows a hidden window, and Linux opens the tray menu on left-click where activation events are unreliable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: benthecarman <benthecarman@live.com> Signed-off-by: Cvv9 <Varun.cumbamangalam@oralens.com> Signed-off-by: Cvv <varun.cumbamangalam@oralens.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Keep Buzz running when the window closes setting under General settings.
When enabled, closing the main window hides it instead of quitting. Windows and
Linux users can reopen or quit Buzz from a lazily-created system tray icon;
macOS continues to use the standard Dock reopen and application Quit behavior.
Why
Closing the only Buzz window currently exits the desktop process, which also
stops notifications and locally managed agents. Users who want Buzz to continue
working in the background need an explicit, persistent close-to-tray option
without changing the default quit path when native tray setup fails.
Implementation
localStorageand applies it to theTauri backend on launch and whenever the toggle changes.
closing the window still exits normally.
module rather than adding more community-agnostic state to
AppState.traps an explicit Quit or restart.
Validation
cargo check --manifest-path desktop/src-tauri/Cargo.tomlcargo test --manifest-path desktop/src-tauri/Cargo.toml tray::tests --lib— 4 passed
pnpm -C desktop check:file-sizesgit diff --checkThe branch was refreshed onto current
block/buzzmain.