cmux NEXT: Chief view gallery, five experimental views beside the Chief

Merged
TE
16d ago
+15040-415

Summary

Leo asked (10-20): "where is everybody? … add a sort of plausible glossary of views … We can see what we like". This PR adds the Chief view gallery: a page tab beside the Chief in Home's right column. A dots switcher moves between the views that are turned on. Gallery lists every view with its one-line description, an on/off switch, and Open as Pane, Split or Sidebar. Only the first view is on by default; the others are a click away in the gallery.

The five starter views all read live data:

ViewWhat it showsData
Where is everybody (on by default)Every agent grouped by machine: name, folder, state, task line, time since last output, PR. Agents that need you are listed first.acpmux lanes (this Mac and its peers) plus terminal hook agents on every machine, pushed by an Observation stream (no polling)
Agent boardWorking / Needs you / Ready to land / Landed todayagents plus Landing
FleetCI machines: load per core, CPU, free memory, busy/online runners, queue, agents per hostthe CI dashboard's data.json. When it is unset or doesn't answer, the view says "unavailable" and shows a field to enter the address
LandingOpen, ready to land (ready-to-land), CI red, merged today, with chips for the agents working on each PRGitHub search (repo:manaflow-ai/cmux base:feat-cmux-next), cached 90 s
TimelineToday's events, newest first: agents started, waiting, failed or finished; PRs opened or mergedagents plus Landing

Revived from #20363 (the cx-v9k2f lanes view on Agent Activity, with #21422, #21727 and #21794):

  • The rows use that PR's AgentLaneStore feed and lanes.ts order and durations: failed, then waiting, then the longest idle, then working.
  • Tasks use the masked step from #21794, never a raw prompt.
  • AgentActivityLane now also keeps the summary's cwd, updatedAt and createdAt. (The Agent Activity lanes view these fields once fed is gone from the base; the gallery reads them from AgentLaneStore.)
  • A terminal agent's last prompt is left out on purpose, because it is unmasked.

Registry. webviews/src/pages/chief-views/registry.ts is one list of manifests (id, title, description, glyph, component, default placement, defaultOn, which data it needs). It is shaped like the AppPlatform manifest. Adding a view is one entry.

Gating. Debug Settings > Home > Chief view gallery (home.chiefViewGallery) is on by default in DEV and NIGHTLY and never offered in Release or RC. When it is on, the palette offers Chief View Gallery (chief.openViews).

Fleet address. No address is built in: the internal dashboard host stays out of the source. Set one from the Fleet view's field (stored in the app's defaults) or with CMUX_CHIEF_VIEWS_FLEET_URL. It must be https; plain http is accepted only for localhost and tailnet (*.ts.net) names. The field says when an address is refused.

Clicks only. open, open_url and set_fleet_url run only from a person's click:

  • open reveals a chat with the session deep link, or a terminal tab.
  • open_url opens only this repo's github.com pages (dot segments refused), and opens them in Home's right side.

Code layout. The Swift side is its own target, CmuxNextChiefViews (page, provider, feeds, agent rows, native strings), so CmuxNextApp does not grow: the app keeps a 20-line tab glue (Pages/ChiefViewsPageTab.swift). To offset that glue, a generic Pages/WebPageTab.swift (one React page per tab, closed with its tab) replaces the one-off page-tab classes of Stats, Chief Usage, channels and CodeRouter, with no behavior change. App source lines: +0 against the base.

Honest limits.

  • "CI red" comes from the dashboard's last run per PR. It can't tell a PR's own red from a base red.
  • Landing is unauthenticated, so GitHub's search rate limit applies (two searches per read, cached 90 s). When GitHub doesn't answer, the view says so.
  • There is no web Feed card renderer to share (the Feed is native), so Timeline has its own small card.
  • The layout (which views are on, the pane view and the side view) lives in the page's localStorage.
  • A remote terminal groups under its machine's name, and an acpmux peer's chats under the peer name. When those two names differ for one machine, it shows as two groups.

Testing

  • webviews/test/chief-views-page.test.tsx (12 tests, passed locally with bun before the fleet rule stopped local bun runs) covers:

    • the registry (five views, only the first on)
    • machine grouping and the Lanes order
    • the PR an agent works on (branch, #N, pull/N, pr-N)
    • the landing lanes (a red CI wins over the label; merged today only)
    • the board and the timeline (today only, newest first)
    • fleet totals
    • the store's layout (toggle, pane/split/sidebar swap, localStorage round trip and bad values)
    • reads only for shown views, and the Fleet unset state
    • each view rendered over the mock host
    • every string in all 21 locales
  • CmuxNextChiefViewsTests/ChiefViewsPageTests.swift (Swift Testing) covers:

    • lane mapping, including lost → failed, the new summary fields, and a later updatedAt alone comparing equal
    • the agents reply shape
    • data.json trimming
    • dashboard URL validation (https, private http)
    • GitHub search parsing and the URL allowlist
    • click-only ops refuse without a gesture
    • the Landing cache

    They run in this PR's CI (cmux-next swift test); nothing compiles on the laptop.

  • I checked the gallery entry pages.chief-views (10 variants) in the local gallery dev server in light and dark at 420, 760 and 1180 px. That pass caught and fixed:

    • board columns cut off beside a sidebar
    • the Fleet table overflowing in a split
    • an unreachable machine showing stale zeros
    • the empty state not opening the gallery
  • python3 scripts/cmux-next/prepush-gate.py: no new violations.

  • Not run here: a Mac build or a live tagged app. Nothing has been checked in a running app yet.

Changelog

Added: Chief View Gallery (command palette, nightly) opens views beside the Chief: where every agent is, an agent board, the CI fleet, landing PRs and today's timeline

Proof

Before: none (a new page). After: the gallery advisory run's captures of pages.chief-views at head af3ce0cd (run 39524300829), 420 px wide. The page code is unchanged since. These are Linux Chromium story renders with a fallback font, not the macOS system font; nothing has been captured in a running app yet.

Where is everybody (dark)Agent board (dark)Fleet (light)Landing (dark)
Where is everybodyAgent boardFleetLanding
Timeline (dark)Gallery (dark)Split (light)Sidebar (dark)
TimelineGallerySplitSidebar

Checklist

  • Behavior changes have added or updated tests
  • Localization audited:
    • the page catalog has 71 keys in 21 locales
    • the native table ChiefViews.xcstrings has 7 keys in 21 locales
    • action.chief.openViews is in ActionCatalog.xcstrings in 21 locales
    • the Debug Settings label is English, like every other tunable

No capture: the gallery is a React page (webviews/src/pages/chief-views), shown in the Proof stills above from the Linux gallery run; the Swift files are its data provider, the page-tab glue and a no-behavior-change WebPageTab refactor, with no native drawing of their own, and no tour scene opens this nightly-only page yet.

Originally written by the session above (cosmic-gray, e8f63fd9); adopted by orphan-sweep, which merged feat-cmux-next in at 36ee17495c (base had removed the Agent Activity lanes view, so the lane's ranked copy went with it).

Agent session: cosmic-gray