Agent chat: a mentioned local address is one compact row until Load preview

Closed
TE
16d ago
+76-37

When a turn only mentions a loopback address (say a tool output line naming http://127.0.0.1:5174/), the agent pane drew the full preview card: a 58px head (globe, address, Open in tab, Open in) over a 180px empty box with one centered "Load preview" button. That's a lot of space for an address nobody asked to see.

Before: head row plus a 180px placeholder box around "Load preview".
After: an unloaded card is one 36px row: the page's icon (unboxed), the address, then "Load preview" as a quiet text button beside Open in tab and Open in. The 180px thumbnail appears only after the reader clicks Load preview.

The consent model doesn't change: the frame still loads nothing until that click, and the pane still never requests a loopback page by itself. No new strings (the existing preview.load / preview.loadLabel are reused). The transcript's fallback row estimate for a preview row drops to the compact height; a loaded card is measured as before. The gallery's agent-pane.preview-card story already covers the unloaded and loaded states; its loopback note now describes the compact row.

Verification

  • Red, e04fce86d0e: cd webviews && bun test test/agent-pane-preview-card-compact.test.tsx fails (0 pass, 1 fail; the card's children were the head plus acpmux-turn-preview-unloaded).
  • Green, f41c318c9f7: same command, 1 pass, 0 fail.
  • cd webviews && bun install --frozen-lockfile && bun run check: passes (type scale, focus rings, layers, format, lint, types).
  • bun test test/ src/agent-session: 557 pass, 33 fail on this branch; the base (origin/feat-cmux-next) gives 556 pass, 33 fail, the same failing tests. No new failures.

UNVERIFIED: no live capture in a tagged build yet; the compact row's look is checked only through CSS review and the static render test.

Changelog

  • Changed: In agent chat, a local address a turn only mentions shows as one compact row until you click Load preview, instead of a large empty preview box.

🤖 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

When a turn only mentions a local address, the agent pane now shows one compact 36px row instead of the previous full preview card (a 58px head over a 180px empty box).

  • An unloaded card is one row: icon, address, and "Load preview" as a quiet text button beside Open in tab and Open in; the 180px thumbnail appears only after that click, and a loaded card is measured as before.
  • The consent model is unchanged: nothing loads until the click, and the pane never requests a loopback page by itself.
  • No new strings; the existing preview.load / preview.loadLabel are reused, and the transcript's fallback row estimate drops to the compact height.