Skip to content

feat(tray): list hosts entries in the Linux tray menu for quick switching - #1069

Open
omerfarukkykc wants to merge 2 commits into
oldj:developfrom
omerfarukkykc:feat/linux-tray-quick-switch
Open

omerfarukkykc wants to merge 2 commits into
oldj:developfrom
omerfarukkykc:feat/linux-tray-quick-switch

Conversation

@omerfarukkykc

@omerfarukkykc omerfarukkykc commented Nov 10, 2026 •

Copy link
Copy Markdown

Proposed changes

On Linux, the tray menu now lists every hosts entry as a check item above the existing items, so a configuration can be switched straight from the top bar. Nothing changes on macOS or Windows.

Why

I understand from #1053 that switching is meant to live in the tray mini window. On Linux that window is never reachable: GTK status icons only expose a menu, so the tray currently offers just "Show Main Window" and "Quit". This PR is limited to that gap rather than adding a second interface where the mini window already works.

  • Reuses the backend toggle path behind GET /api/toggle (extracted as toggle_by_id), so it works with no main window and respects choice mode and folder rules.
  • The menu is rebuilt from stored state after every attempt, so a cancelled auth prompt does not leave a stale check mark.
  • No entries are listed while the data directory is in recovery.
  • Moving entries to or from the trashcan now refreshes the tray (this also fixes a stale tray title after deleting an enabled entry).

Testing

cargo test --locked --manifest-path src-tauri/Cargo.toml passes. Manually tested on Ubuntu (GNOME): toggling, adding and deleting entries. Not tested on macOS/Windows; the new menu items are gated to Linux.

After Changes

Image

🤖 Generated with Claude Code

omerfarukkykc and others added 2 commits November 10, 2026 11:21
…hing

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The local show_main_window wrapper in tray.rs is compiled only on
non-macOS targets, but toggle_hosts_from_menu is built everywhere,
which broke cargo test on the macOS runner (E0425).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant