cmux NEXT Home: top-right toggles open Memory and the sidebar; nothing opens on the right by default

Merged
TE
13d ago
+1063-13

Chief Home now has quiet toggle buttons at the top right of the conversation header, like Claude desktop's panel buttons: Memory Inspector (a Chief's conversation only) and Right Sidebar. Each button lights while its panel is open and a second click closes it. Nothing opens on the right by default.

What changes for the person

  • Top right of the Home transcript header, on the avatar's line: a brain button and a sidebar button. Glyphs use the theme's secondary text, the accent when on (never the system blue), a hover pill only under the pointer, no border. Tooltips name the panel and show its shortcut (Right Sidebar: ⌥⌘B). VoiceOver reads them as toggles with their state.
  • Memory Inspector: the first click opens this Chief's Memory Inspector as a tab in Home's right column (the same path as Show Memory). A click while one shows closes the Memory Inspector tabs of that window's workspace.
  • Right Sidebar: runs Toggle Right Sidebar. The button follows the window's sidebar model, whichever entry point moved it (palette, ⌥⌘B, View menu).
  • The header's empty space and the gap between the buttons still drag the window, and the name pill still opens the Chief settings. In a pane too narrow to keep the buttons clear of the avatar, they hide.
  • Palette: new Chief: Toggle Memory Inspector (chief.toggleMemoryInspector, same chief/server arguments as Open Memory Inspector; CLI exempt as guiOnly, chief memory still opens).
  • Debug Settings > Home > Home header panel toggles (on by default) hides the cluster.

"Nothing opens by default": audit

I looked for anything that opens a right pane on Home at launch or first run:

  • Right sidebar: rightSidebar.visible defaults to false; a window reopens it only if the person left it open (WindowController.swift:112). That's restoring their choice, kept.
  • Memory Inspector: opens only from Show Memory, the palette, cmux chief memory and now the header button. After relaunch, only a tab the person had open comes back (ChiefMemoryPageService.restore). No auto-open.
  • Home dock: with pinned-dock-alone-v1 the dock stands alone and nothing is left on its right; the one-time placeholder-shell cleanup stays. Only an older daemon without that capability still gets a terminal on the right, because it would otherwise undock the screen (HomeDock.swift:136). The bundled daemon has the capability, so this is a mixed-version fallback, not a default. Left as is.
  • I found no hard-coded default to remove. #22389 (first launch lands on Home) is untouched: no overlap with HomeService or first-run files, and the new tunable lives in its own file so the HomeTunables.all line doesn't conflict.

Mechanism

  • PaneHeaderView (MessagesLabHome, Cmux/, not vendored) gets a trailingAccessory slot, exposed as MessagesLabHomeView.headerTrailingAccessory. Its hitTest hands clicks to the accessory's hit view and otherwise keeps the old behavior (pill, avatar, window drag).
  • HomeHeaderPanelBar (CmuxNextHome) draws HomeHeaderPanelItems with the existing HomeHeaderButton; only the buttons are hits. HomeNativeTranscriptView.setHeaderPanels(_:) / onHeaderPanel.
  • HomeHeaderPanels (CmuxNextApp) is the single list of toggles. Each entry is an id, a glyph, a localized label, the action a click runs, and an observable isOpen read. HomeHostView watches HomeHeaderPanels.items(context) with one ObservationStream while it is in a window, so there's no polling. The stream reads the tree's page tabs, the window's RightSidebarModel, the registry's shortcuts and the tunable.
  • ChiefMemoryPageService.isShown(in:) / closeShown(in:) read and close the window workspace's Memory Inspector tabs (store page tabs and app-only ones). They close through PaneController.close.

Extension point for the Chief views lane

Adding a "Views" toggle is one entry in HomeHeaderPanels.all plus its toggle action:

static let views = HomeHeaderPanel(id: "views", symbol: "square.grid.2x2", label: { … },
                                   action: "chief.toggleViews",
                                   isOpen: { $0.services.pageIsOpen(.chiefViews) })
static let all: [HomeHeaderPanel] = [views, memory, rightSidebar]

Changelog

Added: Home's conversation header has top-right toggles that open and close the Memory Inspector and the right sidebar.

Test

New suites: HomeHeaderTrailingAccessoryTests (MessagesLabHome) checks the accessory's placement, that each button takes its own clicks, that the gap and empty header still drag the window, that the pill still gets its clicks, and that a narrow pane hides the accessory. HomeHeaderPanelsTests (CmuxNextApp) checks:

  • the toggle action is in the palette and refuses with no window;
  • a fresh window shows every toggle off, a DM gets no Memory toggle, and the Debug toggle hides the cluster;
  • the sidebar button follows the model and toggles it;
  • the tooltip shows the shortcut;
  • the Memory read finds only a chief-memory tab beside Home;
  • the bar draws its items, keeps buttons across state changes, reports clicks and leaves the gaps as non-hits.

This is a feature, so there is no bug to reproduce on the base. The new tests don't compile there because the API is new.

Observed / Not run

  • python3 scripts/cmux-next/prepush-gate.py: no new violations. check-no-godfiles.sh gives warning tier only: HomeHostView.swift 426 to 433 lines, HomeNativeTranscriptView.swift 436 to 440, AgentActionCatalog.swift 412 to 422. All three were already over 400 on the base.
  • Fleet cmux-ci compile-check --package CmuxNext --package CmuxMessagesLab failed with no such module 'Testing' in unrelated test targets (CmuxNextFilesTests, MessagesLabSidebarTests) on jobs d220c4bef61084a4e5fcb156 and c082bf89ea110a6c16fa622d. The same check at base 2cd6ae166f6 fails the same way (job 87577bfa9991b7441a1fb139). That's a fleet toolchain fault, not this change, and it gave no compile verdict on my code.
  • Fleet test runs and PR CI results: see the comments below.
  • Not run: no local build, per policy. No native screenshots yet: the cmux-next media tours haven't run for this PR.
  • Localization: the 3 new keys (action title, two labels) have all 21 locales in their catalogs. en and ja are marked translated; the others are machine translations marked needs_review, as the neighbouring keys are.
  • Generated exports (action-surfaces.json, actions.md) are left to the PR autofix, which regenerates them for catalog changes.

risk: normal (UI and a new palette action; the repo has no risk:* labels to apply).

No capture: the fleet capture command (cmux-ci capture) is not in the installed cmux-ci and the cmux-next media tours have no Home header scene yet; the toggles are covered by HomeHeaderTrailingAccessoryTests and HomeHeaderPanelsTests.

Adopted by orphan-sweep (2026-10-21): merged feat-cmux-next in at 6290fc5d089 (conflicts in PaneHeaderView.layout and HomeHostView, kept base's pillGlass frame and Chief pet rows).

Agent session: cosmic-gray
Agent session: cosmic-gray

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Adds quiet toggle buttons to the top-right of the Home conversation header that open and close the Memory Inspector (Chief conversations only) and the right sidebar, so no right-side panel opens by default.

  • Each button lights while its panel is open, takes its own clicks, and runs the panel's toggle action; the buttons follow the window's sidebar and Memory Inspector state through one observation, no polling.
  • Adds the chief.toggleMemoryInspector palette action, which closes an open Memory Inspector, else opens one as Show Memory does.
  • HomeHeaderPanels is the single list of toggles, so adding a panel is one entry plus its toggle action.
  • Header drag, the name pill, and Chief settings are unchanged; the buttons hide in panes too narrow to fit. Debug Settings > Home > Home header panel toggles (on by default) hides the cluster.
  • Merged feat-cmux-next several times, keeping the base's pillGlass frame, Chief pet rows, TitlebarHistoryTunables, and the HomeTunables.headerPanels registration; the header-panel watch starts from HomeHostView's viewDidMoveToWindow. Action exports were regenerated against the merged base.