Skip to content

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

refactor(web): Fix no-null-render: TimelineDense.tsx (#18236)

Ben Bachema5786c4fd7ef
diff --git a/web/src/features/traces/components/TraceTimelineDense/TimelineDense.tsx b/web/src/features/traces/components/TraceTimelineDense/TimelineDense.tsx
index ed6fad95e5..a466a172c8 100644
--- a/web/src/features/traces/components/TraceTimelineDense/TimelineDense.tsx
+++ b/web/src/features/traces/components/TraceTimelineDense/TimelineDense.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable @repo/no-null-render */
/**
* The Timeline. `TraceTimelineCompact` measures a box and renders this inside it,
* and the trace panel's Timeline view IS this — for everyone, on every device,
@@ -1593,14 +1592,17 @@ export function TimelineDense({
onClick={(event) => selectRowOnClick(event, node.id)}
onDoubleClick={() => focusRow(node.index)}
>
- <GutterContent
- node={node}
- width={railWidth}
- rowHeight={rowHeight}
- barHeight={barHeight}
- showName={namesVisible}
- dimmed={isDimmed}
- />
+ {/* Bird's-eye density has no rail; avoid invisible DOM per row. */}
+ {railWidth > 0 && (
+ <GutterContent
+ node={node}
+ width={railWidth}
+ rowHeight={rowHeight}
+ barHeight={barHeight}
+ showName={namesVisible}
+ dimmed={isDimmed}
+ />
+ )}
{/* Dimming sits on the lane, so the bar, the caret and the
label all fade together — a full-strength duration beside a
@@ -1873,10 +1875,6 @@ function GutterContent({
*/
dimmed?: boolean;
}) {
- // Nothing to show, so nothing to build: at bird's-eye density the rail has no
- // width, and a box of invisible squares is one DOM node per row of the trace.
- if (width <= 0) return null;
-
// RAIL_MAX_DEPTH exists to keep a tiny square inside a 15px rail, and applying
// it to the OPEN gutter flattened the tree: every node past depth 4 drew at the
// same indent and the same connector column in a gutter up to 168px wide. The