Agent chat: fold completed dialogue above the final answer

Closed
TE
5d ago
+583-320

Completed turns leave intermediate replies and received reports spread through the transcript. They now fold under one Worked for line above the final answer. One click reopens the original content, and the open state survives virtual row remounts and fresh snapshots. Running turns keep their current intermediate dialogue and tool visibility.

Leo: “after your turn ends, I feel like collapsing it may be reasonable because you can still expand it afterwards.”

The fold is keyed by the original prompt in the connected turn. Received messages join it only through existing steer/continues metadata; an unrelated incoming prompt remains a separate turn. Completed plan, workflow, and other pre-answer rows remain available inside the disclosure. Edited-file and rendered artifacts and the failure/footer actions remain visible.

Takes back #24300: completed turns now keep the final answer in sight and fold earlier takeaways into one disclosure, following Leo's new request.

Takes back #23771: the completed connected steer chain shares one disclosure; expanding it preserves each steer and call in order.

Testing

cd webviews && bun test ./test/transcript-completed-fold.test.ts fails on regression commit c821427bab845b (1 expected failure, 3 passes) and passes on 403ada42f5ef67f0da6557cc57f566531011ae26 (4 passes).

Observed / Not run

  • 121 focused lifecycle, Find, stop/continue, fold-motion, and row-estimate tests pass (499 assertions). The related plan/workflow repair run passes 17 tests; other related suites passed 84 tests with one unrelated browser-lane skip.
  • Real Chromium lifecycle check passes 10 assertions: completion keeps the final answer's DOM node, closed work mounts no received reports, one click opens it, the header moves at most 1 px, and open state survives virtual unmount/remount and a fresh snapshot.
  • Full bun run check, scripts/web-lint.sh, prepush-gate.py, and clip-spec validation pass. No live rendering path or per-token scan was added.
  • Localization audit found zero new catalog keys and zero changed web messages. The global localization validator remains red on existing repository translation debt (45,327 parity errors); this PR changes no catalogs.
  • Native build, native capture, WebKit, and release clip recording were not run. A base browser false-control attempt was terminated before a verdict, so it is not red evidence. The gallery stage hit a dev-server module-load failure; the captures use the same public-safe fixture through the production VirtualTranscript browser harness.

Proof

No capture: the changes are limited to transcript web rows, covered by the real Chromium captures below.

Public-safe fixture: agent-pane.completed-turn, with 24 received worker reports, intermediate prose, tool summaries, and collapsed/expanded/running/stopped variants. Chromium captures use the same fixture on base and head at 900 × 720, scale 2. The private supplied reference images are not published.

Matched reference: the supplied ChatGPT collapsed/expanded completed-turn pair (private), plus the design-reference repository's Claude transcript-tool-rows-and-task-list.png for quiet tool summaries. Inline before/after evidence is attached below.

Changelog

Changed: Completed chat turns keep the final answer in view and fold earlier dialogue, tools, and received reports into one expandable line.

Before: completed turnAfter: completed turn
Before completed turnAfter completed turn

One click reopens the original intermediate dialogue and received reports:

Expanded completed turn

Agent session: agent session