cmux-next sidebar: signed-in user on the profile control

Merged
TE
7d ago
+217-9

Summary

Reworked on top of base's sidebar profile control (SIDEBAR-FOOTER-AND-SPACE-MENU). This PR now adds two things to it:

  • The signed-in user on the control. Signed in, the control draws your cmux profile picture, clipped to the avatar circle, or your initials ("Leo Li" shows "LL") while there is no picture. Signed out, it keeps the current browser profile's initial and color. The picture is fetched once per URL, over HTTPS only, at most 2 MB.
  • Account rows in the profile menu. Signed in, the menu starts with your name and email (not commands) and ends with Sign Out. Signed out, it ends with Sign In. Base's Profiles section, submenus, Settings and creation rows are unchanged between them.

sidebar.minimalMode is left alone; this PR no longer changes its default.

Testing

  • Failing tests first (73a809421fc): SidebarAccountAvatarTests (initials, the account avatar, the decoded picture) and SidebarAccountMenuTests (the control's avatar signed in and out, the menu rows). The red fleet step stopped at a compile error instead of failing assertions: the stub made SidebarAvatar.imageData public without a public Foundation import. 06cdada8e9c fixes that.
  • Fix: 366eb1b94e4, plus 06cdada8e9c. Fleet step c3b9328a720e5f16e808b007 and hosted cmux-next swift test on 165f15fdd76 (Xcode 26.6): SidebarAccountAvatarTests and SidebarAccountMenuTests pass. The only red there is base's ProgramStatusSeenTests.
  • Signed-in state on a real build: UNVERIFIED. Capture machines have no cmux test account, and personal credentials never go on a VM (bead cx-x3gg). The unit tests cover it.
  • Local: god files and l10n checks pass. There are no new strings: Sign In and Sign Out come from the action catalog.

What visibly changes

Native UI, no capture: signed in, the sidebar's profile control shows your picture or initials instead of the browser profile's initial, and its menu gains your name and email at the top and Sign Out at the end. Signed out, the menu ends with Sign In.

Changelog

  • Added: The sidebar's profile control shows your cmux picture or initials when you're signed in, and its menu shows your name and email with Sign Out.

🤖 Generated with Claude Code


[!NOTE]
Low Risk
Native sidebar UI and menu wiring only; profile images use bounded HTTPS fetches and Sign In/Out reuse the existing action catalog without changing auth logic.

Overview
When you're signed into cmux, the sidebar footer profile control now shows your account instead of the active browser profile: a round profile photo (once loaded) or up to two initials, with the existing profile initial/color when signed out.

SidebarProfileControl prefers the signed-in account avatar and appends auth rows to the profile menu—name and email as non-action headers plus Sign Out when signed in, or Sign In when signed out—via existing palette.auth.* actions. AccountAvatarImages fetches each HTTPS profile image URL once (2 MB cap, validates as an image) and updates the control through Observation.

SidebarAvatar gains optional imageData and account-specific initials; SidebarAvatarView clips and draws the image in the circle and scales two-letter initials. Unit tests cover initials, picture decoding, menu layout, and avatar precedence.

Reviewed by Cursor Bugbot for commit c6202e7e54e733d23052473a4b96e6ed63872470. Bugbot is set up for automated code reviews on this repo. Configure here.