Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(web): trace tree rows: larger name, rounded connectors, 14px icons (#18270)

Trang Nguyen94f79291e0bd
diff --git a/web/src/features/traces/components/SpanContent.tsx b/web/src/features/traces/components/SpanContent.tsx
index 407915b784..90178df58c 100644
--- a/web/src/features/traces/components/SpanContent.tsx
+++ b/web/src/features/traces/components/SpanContent.tsx
@@ -101,14 +101,14 @@ export function SpanContent({
// row — stacking on the score chips' own titles and the ScoreTag level
// tooltip. The truncating name span below carries its own title.
className={cn(
- "peer relative flex min-w-0 flex-1 items-center rounded-md py-0.5 pr-2 pl-1 text-left",
+ "peer relative flex min-w-0 flex-1 items-start gap-2 rounded-md py-1 pr-2 pl-1 text-left",
className,
)}
>
- <div className="flex min-w-0 flex-col">
+ <div className="flex min-w-0 flex-1 flex-col gap-0.5">
{/* Name and badges row */}
<div className="flex min-w-0 items-center gap-2 overflow-hidden">
- <span className="shrink truncate text-xs" title={nodeDisplayName}>
+ <span className="shrink truncate text-sm" title={nodeDisplayName}>
{nodeDisplayName}
</span>
diff --git a/web/src/features/traces/components/TraceSearchListItem.tsx b/web/src/features/traces/components/TraceSearchListItem.tsx
index bcdfca1f02..6756faf4a9 100644
--- a/web/src/features/traces/components/TraceSearchListItem.tsx
+++ b/web/src/features/traces/components/TraceSearchListItem.tsx
@@ -1,13 +1,13 @@
/**
* SearchListItem - Individual search result row
*
- * Renders a single search result using ItemBadge + SpanContent.
+ * Renders a single search result using ItemTypeIcon + SpanContent.
* Reuses SpanContent from tree view for consistency.
* Displays relative timestamps to show temporal context within the trace.
*/
import type { TraceSearchListItem as TraceSearchListItemData } from "@/src/features/traces/types/traceSearchListItem";
-import { ItemBadge } from "@/src/components/ItemBadge";
+import { ItemTypeIcon } from "@/src/components/ItemBadge";
import { SpanContent } from "./SpanContent";
import { cn } from "@/src/utils/tailwind";
import { useTraceData } from "@/src/features/traces/contexts/TraceDataContext";
@@ -43,11 +43,15 @@ export function TraceSearchListItem({
onClick={onSelect}
onMouseEnter={onHover}
className={cn(
- "hover:bg-muted/50 flex cursor-pointer items-start gap-2 px-2 py-1.5 transition-colors",
+ "hover:bg-muted/50 flex cursor-pointer items-start px-2 py-1.5 transition-colors",
isSelected && "bg-muted",
)}
>
- <ItemBadge type={node.type} />
+ <div className="flex w-6 shrink-0 justify-center py-1.5">
+ <div className="flex h-4 items-center">
+ <ItemTypeIcon type={node.type} className="size-3.5" />
+ </div>
+ </div>
<div className="min-w-0 flex-1 space-y-0.5">
<SpanContent
node={node}
@@ -57,7 +61,7 @@ export function TraceSearchListItem({
/>
{/* Temporal and depth context - only show for observations (not TRACE root) */}
{node.type !== "TRACE" && (
- <div className="text-muted-foreground/70 text-xs">
+ <div className="text-muted-foreground/70 pl-1 text-xs">
depth {node.depth} • +{traceRelativeTime}
{parentRelativeTime !== null &&
` • +${parentRelativeTime} from parent`}
diff --git a/web/src/features/traces/components/VirtualizedTree.tsx b/web/src/features/traces/components/VirtualizedTree.tsx
index 5fd5de9d09..050836df56 100644
--- a/web/src/features/traces/components/VirtualizedTree.tsx
+++ b/web/src/features/traces/components/VirtualizedTree.tsx
@@ -100,6 +100,7 @@ export function VirtualizedTree<T extends { id: string; children: T[] }>({
// overlap (LFE-10591, worst right after "Collapse all"). Keying by id makes
// each measurement travel with its node, so offsets stay correct.
getItemKey: (index) => flattenedItems[index]!.node.id,
+ paddingStart: 8,
overscan,
measureElement:
typeof window !== "undefined"
diff --git a/web/src/features/traces/components/VirtualizedTreeNodeWrapper.tsx b/web/src/features/traces/components/VirtualizedTreeNodeWrapper.tsx
index 912032a015..370b13bdac 100644
--- a/web/src/features/traces/components/VirtualizedTreeNodeWrapper.tsx
+++ b/web/src/features/traces/components/VirtualizedTreeNodeWrapper.tsx
@@ -115,51 +115,40 @@ export function VirtualizedTreeNodeWrapper({
{visualDepth > 0 && (
<div className="relative w-5 shrink-0">
<>
- {/* Vertical bar connecting upwards */}
- <div
- className={cn(
- "bg-border-contrast absolute top-0 left-3 w-px",
- isLastSibling ? "h-3" : "bottom-3",
- )}
- />
- {/* Vertical bar connecting downwards if not last sibling */}
+ {/* Spine continuing to the next sibling */}
{!isLastSibling && (
- <div className="bg-border-contrast absolute top-3 bottom-0 left-3 w-px" />
+ <div className="bg-border-contrast absolute top-0 bottom-0 left-3 w-px" />
)}
- {/* Horizontal bar connecting to icon */}
- <div className="bg-border-contrast absolute top-3 left-3 h-px w-2" />
+ {/* Rounded elbow into the icon */}
+ <div className="border-border-contrast absolute top-0 left-3 z-20 h-3.5 w-3 rounded-bl-md border-b border-l mask-r-from-40%" />
</>
</div>
)}
{/* 3. Icon + child connector: fixed width container */}
<div className="relative flex w-6 shrink-0 flex-col py-1.5">
- <div
- className={cn(
- "relative z-10 flex h-4 items-center justify-center",
- isSelected ? "bg-muted" : "bg-background group-hover:bg-accent",
- )}
- >
- <ItemTypeIcon type={nodeType} className="size-3" />
+ <div className="relative z-10 flex h-4 items-center justify-center">
+ <ItemTypeIcon type={nodeType} className="size-3.5" />
</div>
{/* Vertical bar downwards if there are expanded children (skipped
when children render capped at this same indent — the spine
would point at nothing) */}
{hasChildren && !isCollapsed && !childrenAreCapped && (
- <div className="bg-border-contrast absolute top-3 bottom-0 left-1/2 w-px" />
+ <div className="bg-border-contrast absolute top-5.5 bottom-0 left-1/2 w-px mask-t-from-[calc(100%-var(--spacing)*2)]" />
)}
{/* Root node downward connector */}
{depth === 0 && hasChildren && !isCollapsed && !childrenAreCapped && (
- <div className="bg-border-contrast absolute top-3 bottom-0 left-1/2 w-px" />
+ <div className="bg-border-contrast absolute top-5.5 bottom-0 left-1/2 w-px mask-t-from-[calc(100%-var(--spacing)*2)]" />
)}
</div>
{/* 4. Content area (passed as children - completely decoupled) */}
<div className="flex min-w-0 flex-1">{children}</div>
- {/* 5. Expand/Collapse button */}
- {hasChildren && (
- <div className="flex items-center justify-end py-1 pr-1">
+ {/* 5. Expand/Collapse button. Leaf rows keep the slot so right-aligned
+ content lines up across rows. */}
+ <div className="flex w-7 shrink-0 items-start justify-end py-0.5 pr-1">
+ {hasChildren && (
<Button
aria-expanded={!isCollapsed}
data-expand-button
@@ -169,7 +158,7 @@ export function VirtualizedTreeNodeWrapper({
ev.stopPropagation();
onToggleCollapse();
}}
- className="hover:bg-primary/10 h-6 w-6 shrink-0"
+ className="text-muted-foreground hover:text-foreground hover:bg-primary/10 h-6 w-6 shrink-0"
>
<span
className={cn(
@@ -180,8 +169,8 @@ export function VirtualizedTreeNodeWrapper({
<ChevronRight className="h-4 w-4" />
</span>
</Button>
- </div>
- )}
+ )}
+ </div>
</div>
</div>
);