Files
buzz/desktop/src
ss-dev-01 52123ee68f Make agent transcript groups honest when collapsed
A collapsed tool-run group used to present only its label, so a group
whose child failed — or was still running — read as ordinary finished
work, and a reader had to expand it to find out otherwise. Expansion
state also lived in the DOM, so it was silently reverted whenever
re-grouping remounted the card: a same-kind run that later absorbs one
differing tool call is rebuilt as a mixed burst with a different summary
id, discarding the reader's deliberate choice to keep it open.

Group presentation now carries three properties:

- Aggregate status leans toward the worst outcome (failed > executing >
  pending > completed) and renders beside the label, outside the
  collapsible body. Only non-clean outcomes show a badge; a badge on
  every finished group would train readers to ignore the badge that
  matters.
- Expansion is mount-aware and sticky, keyed by a durable identity:
  history mounts collapsed, live and failed work mounts open, and an
  untouched group auto-collapses when it finishes cleanly. Once the
  reader touches a group, automatic policy never moves it again.
- Files a group touched render as chips outside the collapsible body, so
  collapsing hides the steps without hiding the outcome.

The durable key is `group:<turnId>:<first leaf item id>` rather than the
summary id. Leaf ids derive from channel plus ACP tool-call id, so they
survive both re-derivation over merged live/archive windows and the
same-kind to mixed transition, while turnId keeps two turns from
colliding.

Low-signal suppression is deliberately conservative: only successful,
finished, shell-flavored scaffolding folds away, and only when the group
has at least four steps, at least two would hide, and at least one
primary step remains. Failures, in-flight steps, file edits, relay ops,
and anything the classifier could not identify always stay visible.

Separately, an empty transcript no longer claims there was no activity
when history was merely unreadable. Archived observer history requires an
owner_p save subscription and a completed hydration pass; without either,
the archive returns nothing, which is shaped exactly like a channel where
the agent never ran. `useLoadArchivedObserverEvents` now reports history
certainty, and the empty state says earlier activity may not be shown
rather than asserting a fact it did not check.

Group rendering moved to TranscriptToolRunGroup so
AgentSessionTranscriptList stays under the 1000-line ceiling; the shared
row timestamp moved alongside it to avoid an import cycle. Timestamp,
animation, source-pill, and raw-feed behavior are unchanged.

Co-authored-by: Bradley Axen <baxen@squareup.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
2026-08-21 18:44:12 -07:00
..
2026-03-09 13:02:11 -07:00