internal/tray: add profile switching submenu to tray menu#276
Open
alex-poor wants to merge 1 commit intoDeedleFake:masterfrom
Open
internal/tray: add profile switching submenu to tray menu#276alex-poor wants to merge 1 commit intoDeedleFake:masterfrom
alex-poor wants to merge 1 commit intoDeedleFake:masterfrom
Conversation
Owner
|
Thank you for the pull request. Overall I like it, but I'd prefer that the profile list go into a submenu. Could you update it to do that, please? |
Allow switching Tailscale profiles directly from the system tray right-click menu, without needing to open the main window. The active profile is shown with a bullet indicator that updates whether the switch is initiated from the tray submenu or from the main window's profile dropdown. Depends on DeedleFake/tray#2, which fixes three bugs in the tray library that were preventing submenu children from rendering and causing a deadlock when SetProps is called concurrently with the desktop environment's GetLayout requests. The temporary replace directive in go.mod should be removed once that PR is merged and deedles.dev/tray is updated to a new pseudo-version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7186e56 to
cd5bd4a
Compare
Author
|
Force-pushed an updated version of this PR that uses a submenu (per your earlier feedback) and includes the `SetActiveProfile` indicator-sync logic. Getting the submenu to render correctly required three upstream tray library fixes — see DeedleFake/tray#2 — and the trayscale `go.mod` currently has a temporary `replace` directive pointing at my fork while that lands. I've updated the PR description with the full context. |
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 "Switch account" submenu to the system tray right-click menu, allowing the user to switch between Tailscale profiles without opening the main window. The currently active profile is shown with a bullet character (`●`) prefix, and the indicator updates whether the switch is initiated from the tray submenu or from the main window's profile dropdown.
Profiles are fetched once at tray startup via `tsutil.GetProfileStatus` and the submenu is populated in `Tray.Start`. The submenu only appears when there is more than one profile available.
Dependency on tray library fix
This PR depends on DeedleFake/tray#2, which fixes three bugs in `deedles.dev/tray` that were preventing this from working:
While that PR is in flight, the trayscale `go.mod` has a temporary `replace` directive pointing at my fork at the relevant commit:
```
replace deedles.dev/tray => github.com/alex-poor/tray v0.1.11-0.20260407004037-2451d98fc544
```
Once the upstream tray PR is merged, the `replace` directive should be dropped and the regular `deedles.dev/tray` requirement updated to a new pseudo-version.
Implementation notes
Test plan
🤖 Generated with Claude Code