Tailscale Fast User Switching #

Account switching is one of the less fun parts of modern computing -- for a while I had registered giveupandusemultiplebrowsers.com. Even when software tries to accomodate these scenarios, the heuristics for when to switch can be tricky, and in some cases require the user to maintain a complex mental model of what state they're in and where they're trying to get to.

Tailscale did not distinguish itself in this regard -- fast user switching was one of our most requested features for the last couple of years. Besides being generally a good thing to do, user switching also plays into the business model – if enthusisast users bring Tailscale to work, they're going to want to be able to quickly switch between their personal and work accounts.

Tailscale fast user switching UI in the Mac app menu barWith version 1.34 (released today), we now have the first step: fast-user switching support. Maisem did most of the hard parts (making the Tailscale backend profile-aware, data migration, and untangling what should be global vs. per-account state). I worked mostly on the Mac side, implementing Alessandro's designs but also modernizing our use of the Keychain (where account data is persisted).

I spent a lot of quality time with WWDC sessions from 2010, trying to make custom NSMenuItem views behave just like the real thing, even when using keyboard navigation or VoiceOver. The ironic thing is that Apple itself appears to have given up on this. On modern macOS versions the Wi-Fi and related "menu" controls are actually custom (SwiftUI?) views that don't behave quite like real menus (e.g. they don't highlight items with menu color).

While I was in this part of the codebase, I also cleaned up how the Mac app handles custom coordination servers. Though not officially supported, it's now possible to have profiles on different servers by using the debug menu (finding out how to trigger that is left as an exercise for the reader).

Post a Comment