cmux NEXT Inspector: Environment lists every folder the chat worked in; each row opens something
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).
- a folder opens in the Files tree beside the chat (
- 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
remoteControlprop 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) andscripts/cmux-next/prepush-gate.py(no new violations). Fleetcmux-ci compile-check --appon 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](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
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.