feat(ui): add right-click tray menu with Settings and Quit - #40
Conversation
The menu bar icon only handled left-click (toggle popover), so there was no way to quit the app or reach settings from the tray. Add a right-click context menu: - Settings… — opens the settings window (shares the same code path as the open_settings command via a new show_settings_window helper). - Quit Microbridge (⌘Q) — exits the app. Left-click still toggles the popover: show_menu_on_left_click(false) keeps the menu on right-click only, so the existing on_tray_icon_event left-click handler is unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
There was a problem hiding this comment.
Pull request overview
Adds a macOS tray right-click context menu to the Tauri UI app so users can open Settings or quit from the menu bar icon, while keeping the existing left-click popover behavior.
Changes:
- Introduces a Rust-side tray context menu (
Settings…,Quit Microbridge) usingtauri::menu. - Adds a
show_settings_windowhelper shared by the tray menu and theopen_settingsTauri command. - Configures the tray to show the menu on right-click only (
show_menu_on_left_click(false)), preserving left-click popover toggling.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #[tauri::command] | ||
| async fn open_settings(app: AppHandle) -> Result<(), String> { | ||
| show_settings_window(&app); | ||
| Ok(()) | ||
| } |
Why
The menu bar icon only handled left-click (toggle popover) — there was no way to quit the app or jump to settings from the tray. This adds the standard macOS right-click context menu.
What
Right-click the Microbridge tray icon → context menu:
open_settingscommand via a newshow_settings_windowhelper). The settings surface itself is still being built out; this just wires the jump.app.exit(0)).Left-click is unchanged — it still toggles the popover.
show_menu_on_left_click(false)scopes the menu to right-click only, so the existingon_tray_icon_eventleft-click handler keeps working.Notes
tauri::menu), so no JS capability/permission changes are needed; thetray-iconfeature is already enabled.cargo buildonapps/microbridge-ui/src-tauricompiles locally.🤖 Generated with Claude Code