mirror of
https://github.com/block/buzz.git
synced 2026-11-09 02:41:57 +00:00
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>
27 lines
803 B
TypeScript
27 lines
803 B
TypeScript
import { TranscriptTimestamp } from "./activityRenderClasses/TranscriptTimestamp";
|
|
|
|
/**
|
|
* Opt-in per-row timestamp, anchored bottom-left under the row content and
|
|
* styled to match the chat/transcript timestamps.
|
|
*
|
|
* Extracted from `AgentSessionTranscriptList` so tool-run group chrome can
|
|
* render the same timestamp without importing the list module (which imports
|
|
* the group card, and would form a cycle).
|
|
*/
|
|
export function TranscriptRowTimestamp({
|
|
messageLink = null,
|
|
timestamp,
|
|
}: {
|
|
messageLink?: { channelId: string; messageId: string } | null;
|
|
timestamp: string;
|
|
}) {
|
|
return (
|
|
<div
|
|
className="mt-0.5 flex justify-start"
|
|
data-testid="transcript-row-timestamp"
|
|
>
|
|
<TranscriptTimestamp messageLink={messageLink} timestamp={timestamp} />
|
|
</div>
|
|
);
|
|
}
|