Agent chat: the header says where the chat runs (machine · folder · branch)
A started agent chat now says where it runs at the start of its header: the machine, the folder and the branch. Only a new chat's composer names its folder and machine; that location strip goes with the first send. So until now a running chat showed this nowhere unless you opened the Inspector. (Leo's brief for this lane: "surface the same Environment line (machine · folder · branch) at the top of the chat so it's visible without opening the panel.")
header/EnvironmentLine.tsx(new) reads the same snapshot as the Inspector's Environment section and uses itsmachineOf, so the two never disagree. That's also where the machine-identity lane's colors and icons will plug in. While the Inspector is on, clicking the line opens the Inspector at Environment; otherwise the line is a plain note. The tooltip is the folder's full path.- Placement:
- In a header with its own row, the line sits in the status slot. It never sizes the slot: each name ends in an ellipsis, so the tools stay put.
- In a header that shares the pane's tab row (on by default), the slot is under the tabs, so a compact version capped at 220px leads the tools, the way the connection warning already does there.
- I didn't add a new bar above the chat, because the tab row exists to remove the top bar.
- A connection problem's label takes the line's place in both placements (
ChatHeaderStatus,ChatHeaderInlineStatus). - No new strings: the label reuses
rail.environment.
Tests
webviews/test/chat-environment-line.test.tsxcovers the slot line and its click, a warning replacing the line and the line coming back, the compact tab-row line, an SSH chat naming its host, the note without the Inspector, and no line before the session says where it runs.- The gallery's
agent-pane.headerentry has newlong-branchandtab-rowstates, and coversEnvironmentLine.
Observed / Not run
- Observed: the TypeScript check is clean for every touched file (the only errors were from the checkout's stale ignored
generated/strings). The pre-push gate is clean. - Not run: bun tests, the gallery and a live pane, because this host (cosmic-gray) runs no tests. CI's webview shards and the gallery advisory run cover them.
Changelog
Added: An agent chat's header names the machine, folder and branch the chat runs in.
🤖 Generated with Claude Code
Agent session: cosmic-gray
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
A started agent chat's header now names where it runs (machine · folder · branch), so you can tell chats apart without opening the Inspector.
- The new
EnvironmentLinereads the same snapshot as the Inspector's Environment section, so the two never disagree. - It sits in the header's status slot (or leads the tools in a tab-row header), with long names ellipsized so the tools stay put.
- Clicking it opens the Inspector at Environment; a connection problem's label replaces it in both placements.
- The line only renders once the session reports where it runs.