cmux-next: machine identity: each machine's color on rows, tabs, chip and palette

Merged
TE
13d ago
+1834-1139

Summary

Machine identity: machines look alike today. The composer's machine chip says "cmux's MacBook Pro (3)", every machine gets the same icon, and the session list shows no machine at all. Leo: show which machine runs each session, everywhere.

  • One color per machine. It comes from a stable hash of the machine's name (trimmed, lowercased), using the FNV-1a hash and accent order from AgentPresenceColor, drawn from the theme's terminal palette. Webview: machineColor.ts. Native: MachineColor (CmuxNextDesign). Both make the same pick, and tests pin the same names on both sides.
  • Agent pane: the composer's computer chip, the environment-picker rows and the chat Inspector's Environment row draw the machine icon in its color.
  • Sidebar: while the sidebar lists more than one machine, every workspace row draws its machine's glyph in the machine's color in the trailing cluster: the machine's own SF Symbol icon, else Mac, Cloud or other computer. The row's VoiceOver label names the machine. This Mac's rows are marked too, by this Mac's own name (SidebarMachine.identityName), so a Mac gets the color other Macs draw it in. With one machine, no row is marked.
  • Tabs: a remote tab's machine badge draws in its machine's color, keyed by the machine's sidebar name.
  • Palette: while workspaces span more than one machine, a workspace row's subtitle leads with its machine, and typing a machine's name finds its workspaces.
  • MacName.displayName() returns the computer name, unless it is macOS's default ("Owner's MacBook Pro (3)", "Owners-Mac-mini-2") and the host name is not; then it returns the host name. Used for the name the agent pane, other Macs and the phone show.
  • Gallery: agent-pane.composer-context โ†’ machine-colors.

Not in this PR (follow-ups):

  • A per-machine color override. With 8 hues, two machines can share one (cosmic-gray and huge-blue are both orange).
  • Group-by-machine in the switcher.
  • Machine marks on the native hover card: #22739 (sidebar-cleanup) will tint its machine glyph with MachineColor.
  • Agent chat rows in the palette: AcpmuxChat has no host, and all of them are this Mac's.

Defaults

This adds one new setting, setting.sidebar.showLocalMachine, and it defaults to false. That is Leo's ruling from 2026-10-20: this Mac shows no machine badge unless the person turns it on in Settings, and only other machines get the icon and color. No existing default changes.

Changelog

Changed: Each machine has its own color, on sidebar workspace rows (when more than one machine is listed), remote tab badges, the composer's computer chip and the chat Inspector's Environment row. The palette names a workspace's machine, and a Mac that kept macOS's default name shows its host name.

Testing

Observed / Not run

  • Ran bun test src/agent-session/acpmux/machineColor.test.ts (3 pass), the ComposerContext and summary tests (5 pass), and bun run check in webviews/ (pass). prepush-gate.py reports no new violations.
  • cmux-ci compile-check --app passed on 862bd3fdd697 (fleet).
  • Not run locally: Swift build and tests (MacNameTests, MachineColorTests, SidebarMachineMarkTests, PaletteNavigationTests.workspaceRowsNameTheirMachine). They run in CI; no Mac builds on cosmic-gray.

No capture: the native changes are a small colored icon on remote machines' sidebar rows and tab badges, which needs a second real machine connected on a capture mini; the webview side is shown in the gallery state above.

Agent session: cosmic-gray

๐Ÿค– Generated with Claude Code