cmux NEXT Inspector: Environment lists every folder the chat worked in; each row opens something

Merged
TE
15d ago
+485-36

In progress (gallery before/after to follow).

Second session-panel piece (Claude Code desktop's right panel parity; first was #23789). Leo: every item must do something on click.

What changes

  • Environment lists every folder the chat worked in, like Claude's Projects · ~, cmux, cmux-app-screenshots, cmuxterm-hq, leo-workspace, glaeda: the chat's own folder with its parent, then each project folder its tool calls touched, in first-touched order (inspector/chatFolders.ts). Paths come from edits' diffs, reads' locations, and commands' cd DIR / git -C DIR. A path counts as its project: inside a repository chat folder it is that folder; inside a plain folder, the child folder; elsewhere in home, the folder beside the chat folder's line; temp and hidden folders (scratch, ~/.claude) are left out.
  • Each row does something:
    • a folder opens in the Files tree beside the chat (pane.action {id: "files", cwd}, only for a chat on this Mac);
    • the repository opens on GitHub beside the chat, the branch opens its tree/<branch> page;
    • Save is now wired: it keeps the machine and folder as a New Tab saved environment (environment.save, the same host method the New Tab page uses), then says Saved. A Cloud chat has no Save (saved environments are this Mac or an SSH machine).
  • Remote Control: nothing in the app toggles it today (no webview method, no Swift handler for Claude's remote control in the agent pane; only the separate Mobile Pairing page). The row stays behind its remoteControl prop and is not drawn; wiring it needs a new agent-pane host method, left for a follow-up.

Tests

test/chat-inspector-environment.test.tsx (new): folder detection for a plain-folder chat and a repository chat, project mapping (deep files, home files, scratch, relative), the Save draft for local / SSH / Cloud, and every row's click (folders call onOpenFolder with the full path, the repository and branch open their GitHub URLs, Save calls once then shows Saved and disables), and that rows are plain text without the App's actions.

Observed / Not run

  • Ran scripts/web-lint.sh (pass) and scripts/cmux-next/prepush-gate.py (no new violations). Fleet cmux-ci compile-check --app on the head: running.
  • Not run locally: bun test (this Mac's guard sends test runs to CI).

No capture: webview-only change; gallery before/after (new environment-folders state) to follow.

Changelog

Changed: The Inspector's Environment lists every folder the chat worked in; a folder opens in Files, the repository and branch open on GitHub, and Save keeps the environment for new chats

🤖 Generated with Claude Code

Agent session: cosmic-gray


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


Summary by cubic

Makes the Inspector's Environment list every folder a chat worked in, with each row opening something, matching Claude Code desktop's right panel.

  • Lists the chat's own folder with its parent, then each project folder its tool calls touched, in first-touched order (chatFolders.ts); paths come from edits' diffs, reads' locations, and commands' cd DIR / git -C DIR.
  • A folder opens in the Files tree beside the chat (local chats only); the repository and branch are links the pane opens on GitHub in the browser.
  • Save keeps the machine and folder as a New Tab saved environment (environment.save) and then shows Saved; Cloud chats have no Save.
  • Remote Control stays hidden behind its prop; wiring it needs a new agent-pane host method, left for a follow-up.

Tests

Adds test/chat-inspector-environment.test.tsx covering folder detection and project mapping, Save drafts for local/SSH/Cloud, and every row's click.