diff --git a/canvas/src/components/tabs/TracesTab.tsx b/canvas/src/components/tabs/TracesTab.tsx index 17668566..aa6bd650 100644 --- a/canvas/src/components/tabs/TracesTab.tsx +++ b/canvas/src/components/tabs/TracesTab.tsx @@ -55,7 +55,13 @@ export function TracesTab({ workspaceId }: Props) {
{traces.length} traces -
@@ -79,66 +85,79 @@ export function TracesTab({ workspaceId }: Props) {
) : (
- {traces.map((trace) => ( -
- - - {expanded === trace.id && ( -
- {trace.input && ( -
-
Input
-
-                        {String(typeof trace.input === "string" ? trace.input : JSON.stringify(trace.input, null, 2))}
-                      
-
- )} - {trace.output && ( -
-
Output
-
-                        {String(typeof trace.output === "string" ? trace.output : JSON.stringify(trace.output, null, 2))}
-                      
-
- )} - {trace.totalCost != null && ( -
- Cost: ${trace.totalCost.toFixed(6)} -
- )} -
- {trace.id} + {traces.map((trace) => { + const isOpen = expanded === trace.id; + const panelId = `trace-detail-${trace.id}`; + return ( +
+
- ))} +
+ {trace.latency != null && ( + + {trace.latency > 1000 ? `${(trace.latency / 1000).toFixed(1)}s` : `${trace.latency}ms`} + + )} + {trace.usage?.total != null && ( + + {trace.usage.total} tok + + )} + +
+ + + {isOpen && ( +
+ {trace.input && ( +
+
Input
+
+                          {String(typeof trace.input === "string" ? trace.input : JSON.stringify(trace.input, null, 2))}
+                        
+
+ )} + {trace.output && ( +
+
Output
+
+                          {String(typeof trace.output === "string" ? trace.output : JSON.stringify(trace.output, null, 2))}
+                        
+
+ )} + {trace.totalCost != null && ( +
+ Cost: ${trace.totalCost.toFixed(6)} +
+ )} +
+ {trace.id} +
+
+ )} +
+ ); + })}
)}