Repository navigation
cmux NEXT tabs: remote SSH and remote-localhost tab badges wear the machine's sidebar color - #24159
Conversation
…bar name's color An SSH host named "lab" at leo@huge-blue badges its remote terminal and remote-localhost browser tabs "huge-blue"; the badge hashed that text and wore another MachineColor than the machine's "lab" sidebar rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fddf-7670-8279-1a511ab46d6f&host=cosmic-gray
… color Remote SSH terminal tabs and remote-localhost browser tabs set only the badge text (an SSH host's destination, "huge-blue"), so TabCell hashed that text and the tab wore another MachineColor than the machine's sidebar rows and composer chip (its label, "lab"). MachineRegistry.tabColorName gives the sidebar name when the badge is the machine's own short name; PaneController sets it as TabItem.machineName for both kinds. Other badges (a "this Mac" chip) and machines not known here keep the badge text's color. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fddf-7670-8279-1a511ab46d6f&host=cosmic-gray
|
Owned by orphan-sweep on air-blue · session |
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
red: cmux-next checks (god files, concurrency, crash safety, l10n); NEW: |
|
Found 9 test failures on Blacksmith runners: Failures
|
|
Bead |
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15cfc-663f-7650-b9f7-64d198c6b88b&host=Air-Blue Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review (Codex GPT-6 at xhigh via acpmux on cmux16, correctness first): SHIP at ea3f65b
|
Conflicts: - MachineRegistry: keep this branch's remoteDaemon(named:)/machine(named:among:) and base's tabColorName(_:badge:) (#24159); both are additive. - AgentSessionWorkspace: base's #24162 group join (any same-named group that can hold the row) and predecessor-row reuse for the local open. The remote adopt now joins its group through base's AgentSessionWorkspace.join, so this branch's duplicate SidebarEdits.group(named:accepting:in:) and joinGroup are removed; AgentBypassBadgeTests checks AgentSessionWorkspace.group instead. - agent_update.rs: keep the shared agent_session_start::is_chief; it now reads tags through base's panic-free JsonFields::field, as base's copy did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16040-fd0b-7dd0-9487-1a3a198d9f5c&host=cosmic-gray
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
What was wrong
Machine identity (#22763) colors a tab's machine badge with
MachineColor(name: item.machineName ?? badge). Plain terminal tabs on a remote tree setmachineNameto the machine's sidebar name, but two kinds of tab set only the badge text:RemoteTerminalService.badge)RemoteLocalhostService.badge)Both badges show
MachineRegistry.machineBadge, which for an SSH host is its destination (leo@huge-blue.tail1.ts.netgives "huge-blue"). The sidebar name isMachineRegistry.machineName, which for an SSH host is its label (for example "lab"). These tabs therefore hashed "huge-blue" and showed a different color from the machine's sidebar rows and composer chip, which hash "lab".The fix
MachineRegistry.tabColorName(_:badge:): when the badge is that machine's own short name, it returns the machine's sidebar name. It returns nil for any other badge (a "this Mac" chip) and for a machine not known here.RemoteTerminalService.badge(for:)now returns the badge text together with that color name.PaneControllersetsTabItem.machineNamefrom it for remote terminals and remote-localhost browser tabs. TabCell is unchanged, and its?? badgefallback still covers tabs with no known machine.Evidence
cmux-ci compile-check --appat the head: passed (job 5231ff6c1a133534f5c7f7bc, 44 s).Test:
CmuxNextAppTests/TabMachineColorTests.swiftadds an SSH host named "lab" at leo@huge-blue. It checks that the terminal badge and the remote-localhost badge both take their color from "lab", and that other badges and unknown machines keep the badge text.No capture: the badge's color changes only for a remote SSH terminal or remote-localhost browser tab whose SSH host has a label different from its destination. No capture scene or showcase fixture has an SSH machine or a remote-terminal tab (
CaptureSceneRegistry*,DebugShowcase), so a fleet capture would show the same stills before and after.TabMachineColorTestschecks the color name instead. Badge text and layout do not change.Agent session: cosmic-gray
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Fixes remote SSH terminal and remote-localhost browser tab badges so they take the machine's sidebar color instead of hashing the badge text (an SSH host's destination, e.g. "huge-blue", rather than its label "lab"). Adds
MachineRegistry.tabColorName(_:badge:)to return the sidebar name when the badge is the machine's own short name, and hasRemoteTerminalServiceandPaneControllerfeed it toTabItem.machineName. Other badges (a "this Mac" chip) and machines not known here keep the badge text's color.RemoteTerminalService.badge(for:)now returns the badge text and its color name.PaneControlleruses the color name for remote terminals and remote-localhost browser tabs;TabCell's?? badgefallback still covers tabs with no known machine.TabMachineColorTests.swiftcovering SSH-host terminal and remote-localhost badges, plus "this Mac" and unknown-machine fallbacks.Written for commit ea3f65b. Summary will update on new commits.