(`${scope}.view`,initialView);
const previousFilter=useRef(`${actor}:${section}:${query}`);
useEffect(() => { const filter=`${actor}:${section}:${query}`;if(filter!==previousFilter.current){previousFilter.current=filter;setLimit(60);} }, [actor, section, query]);
- useEffect(() => { if (selection) { setSection('rollout'); setQuery(''); setPin(''); } }, [selection?.itemId, selection?.revision]);
+ useEffect(() => { if (selection) { setSection('events'); setQuery(''); changeActor('all'); } }, [selection?.itemId, selection?.revision]);
const filtered = useMemo(() => items.filter(item => {
const family = eventFamily(item);
const inSection = section === 'events' || (section === 'messages' ? family === 'message' : section === 'evidence' ? family === 'reward' || family === 'annotation' : family !== 'annotation');
@@ -92,11 +92,12 @@ export function AgentTraceInspector({ projection, actorId, onActorChange, cursor
{agents.map(lane => )}
-
+
+ {actor === 'all' ? Select one agent before comparing. : null}
setQuery(e.target.value)}/>
{items.length} recorded items · {projection.state ?? 'Unknown state'}{cursorMs != null ? ` · replay ${time(cursorMs)}` : ''}. History retained while scrubbing.
{projection.losses?.length ? Capture coverage
{projection.losses.map(loss => {loss}
)} : null}
- {laneContent(actor)}
{pin &&
{lanes.find(l => l.actor_id === pin)?.display_name}{laneContent(pin)}
}
+ {laneContent(actor)}
{pin && actor !== 'all' &&
{lanes.find(l => l.actor_id === pin)?.display_name}{laneContent(pin)}
}
;
}
diff --git a/packages/workshop-visuals/components/agent_trace.v1/TraceViews.tsx b/packages/workshop-visuals/components/agent_trace.v1/TraceViews.tsx
index 7aca7b5e..b5f93256 100644
--- a/packages/workshop-visuals/components/agent_trace.v1/TraceViews.tsx
+++ b/packages/workshop-visuals/components/agent_trace.v1/TraceViews.tsx
@@ -116,7 +116,7 @@ export function GeneralTraceView({ projection, items = projection.items ?? [], v
const attached = (item: TraceItem) => notes.filter(note => annotationMatches(note, item, projection));
const active = (item: TraceItem) => attached(item).filter(note => !superseded.has(note.id));
const focused = !full && extension?.filterItems ? extension.filterItems(items) : items;
- const rows = items.filter(item => full || focused.includes(item) || active(item).length > 0 || item.item_id === selectedId).filter(item => item.kind !== 'evidence.annotation' &&
+ const rows = items.filter(item => full || focused.includes(item) || active(item).length > 0 || item.item_id === selectedId).filter(item => (item.kind !== 'evidence.annotation' || item.item_id === selectedId) &&
(full || !/^(eval\.|media\.|policy\.finished)/.test(item.kind) || active(item).length > 0) && (!onlyAnnotated || active(item).length > 0));
const base = extension?.base ?? view;
const groups = base === 'general' || full ? rows.map(item => ({ id: item.item_id, items: [item] })) : extension?.groupItems?.(rows) ?? decisionGroups(rows);
@@ -129,7 +129,7 @@ export function GeneralTraceView({ projection, items = projection.items ?? [], v
if (row) setSelectedId(row.item.item_id);
}, [cursorMs, projection.trace_id]);
useEffect(() => {
- if (selection && items.some(item => item.item_id === selection.itemId)) { setSelectedId(selection.itemId); setFollow(true); }
+ if (selection && items.some(item => item.item_id === selection.itemId)) { setSelectedId(selection.itemId); setFollow(true); setFull(true); setOnlyAnnotated(false); }
}, [selection?.itemId, selection?.revision]);
useEffect(() => {
if (!selectedId || !follow) return;
@@ -156,6 +156,8 @@ export function GeneralTraceView({ projection, items = projection.items ?? [], v
}
function jump(direction: number) { const index = markers.findIndex(item => item.item_id === selectedId); const next = index < 0 ? (direction > 0 ? 0 : markers.length - 1) : index + direction; if (markers[next]) choose(markers[next]); }
const Content = base === 'codex' ? CodexContent : base === 'react' ? ReActContent : GeneralContent;
+ const extensionContext = extension?.renderContext?.(selected);
+ const showNotes = notes.length > 0 || Boolean(context) || Boolean(extensionContext);
return
@@ -168,7 +170,7 @@ export function GeneralTraceView({ projection, items = projection.items ?? [], v
{rows.length} items · {notes.filter(note => !superseded.has(note.id)).length} current annotations
-
+
{!groups.length &&
No matching trace items.
}
{groups.slice(0, limit).map((group, index) =>
@@ -185,16 +187,16 @@ export function GeneralTraceView({ projection, items = projection.items ?? [], v
)}
{groups.length > limit &&
}
-
: null}
;
}