-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal/tray: support displaying connection status #68
Conversation
Looks good to me, especially with that TODO which I completely agree with. I've taken a stab a few times at building a system to manage the tray menu but haven't gotten too far yet. The |
My one concern is whether or not this is actually necessary. The tray icon itself already changes to indicate connection status, so having an indicator in the menu as well doesn't really seem necessary to me. Are there environments in which the menu is accessible but the icon isn't necessarily visible? I'm mostly using this in GNOME (with an extension) and KDE, so the icon is always visible at a glance unless something's fullscreen or something. |
No, this doesn't seem to be needed all that much. And current design of the official clients has moved to just having the quick toggle in this place: And that makes sense, since there's already the status icon (Tailscale and Trayscale) and status toggle in GUI (Trayscale). I agree that it's extraneous. For me it was a good start though to start the development around things in the tray. It's the most common data the app has and updates regularly.
I'm also using both of the above. And I also can't think of a scenario where the tray icon is not visible but the tray menu is still (somehow) accessible. Even GNOME without the tray extension only shows the actual window (if present). To sum up, I've already added new functionality in my local dev:
Which proves that we definitely have most of the data we would need to provide more insight at a glance or even quick toggles without going to the actual UI. Kind of against GNOME philosophy, but in line with Tailscale itself. |
cmd/trayscale/app.go
Outdated
@@ -222,6 +225,7 @@ func (a *App) update(s tsutil.Status) { | |||
a.online = online | |||
a.notify(online) // TODO: Notify on startup if not connected? | |||
systray.SetIcon(statusIcon(online)) | |||
a.connectionStatusMenuItem.SetTitle(connectionStatusText(online)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user has the tray icon disabled, a.connectionStatusMenuItem
could be nil
at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, didn't cross my mind to disable tray icon for... TRAYscale 😄 I will work on ensuring we do no-ops for unitialised items sooner then 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, didn't cross my mind to disable tray icon for... TRAYscale
Ha ha, yeah. Trayscale actually didn't have a tray icon at all for a while because most implementations used Gtk3 behind the scenes, which didn't work when used with a Gtk4 app, and the Fyne fork, which was created to get rid of the Gtk3 requirement, had a number of bugs at the time that made it infeasible, including one that made changing the icon to display the status not work.
What's the status on this? It would be a very useful addition to the menu :) |
Updated to reflect current tray setup. |
It's been a little while. I'll take another look at this on Sunday and see. |
I took another look at this and am again unsure of the purpose considering the icon change to indicate the status. What I'm currently thinking is that I'll merge this and then change it to be a toggle that can be clicked to start/stop Tailscale without having to open the window for it, i.e. an item that is not disabled and is labeled "Disconnect" or "Connect" where appropriate. Thoughts? |
Sounds good to me :) |
This adds a simple tray menu section that changes according to connection status and resembles the behaviour of the original client tray (macOS).
I found the current tray menu pretty lacklustre, at least compared to the official client (however, this is old design). In order to familiarise myself with the project, I decided to go with this simple info first.
Let me know if this is the direction you'd like to see to project go towards.