Skip to content

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

fix(ui): better trace detail header spacings (#13992)

Nikita Kabardin663230dbba08
diff --git a/web/AGENTS.md b/web/AGENTS.md
index 633c3f43ee..088b318c7a 100644
--- a/web/AGENTS.md
+++ b/web/AGENTS.md
@@ -84,6 +84,9 @@ signoff of user-visible changes.
must be installed, ask the user before doing so.
- Tailwind is the default styling layer; use the shared palette and globals in
`src/styles/globals.css`.
+- In flex layouts, prefer `gap-*` over margin-based `space-x-*`/`space-y-*`.
+- Treat `!` Tailwind classes as a smell. Step back and fix the owning layout,
+ variant, or primitive before overriding with higher specificity.
- When changing shared UI/table patterns, update sibling variants consistently,
including default-visible and hidden columns or states.
- For component style variants, prefer `cva` with `VariantProps` and merge
diff --git a/web/src/components/ItemBadge.tsx b/web/src/components/ItemBadge.tsx
index 30f19d69b2..2e30b434e3 100644
--- a/web/src/components/ItemBadge.tsx
+++ b/web/src/components/ItemBadge.tsx
@@ -116,6 +116,7 @@ export function ItemBadge({
// Modify this line to ensure the icon is properly sized
const iconClass = cn(
+ "shrink-0",
iconVariants({ type }),
isSmall ? "h-3 w-3" : "h-4 w-4",
className,
diff --git a/web/src/components/table/peek.tsx b/web/src/components/table/peek.tsx
index c0c3b10330..a7b855c2c8 100644
--- a/web/src/components/table/peek.tsx
+++ b/web/src/components/table/peek.tsx
@@ -113,7 +113,7 @@ function TablePeekViewComponent(props: TablePeekViewProps) {
className="flex max-h-full min-h-0 min-w-[60vw] flex-col gap-0 overflow-hidden p-0"
>
<SheetHeader className="bg-header flex min-h-11 flex-row flex-nowrap items-center justify-between px-2 py-1">
- <SheetTitle className="mt-0! ml-2 flex min-w-0 flex-row items-center gap-2">
+ <SheetTitle className="flex min-w-0 flex-row items-center gap-2">
<ItemBadge type={peekView.itemType} showLabel />
<span
className="truncate text-sm font-medium focus:outline-hidden"
diff --git a/web/src/components/trace/components/ObservationDetailView/ObservationDetailViewHeader.tsx b/web/src/components/trace/components/ObservationDetailView/ObservationDetailViewHeader.tsx
index d33639873e..8f2e16cd68 100644
--- a/web/src/components/trace/components/ObservationDetailView/ObservationDetailViewHeader.tsx
+++ b/web/src/components/trace/components/ObservationDetailView/ObservationDetailViewHeader.tsx
@@ -102,11 +102,9 @@ export const ObservationDetailViewHeader = memo(
<div className="@container shrink-0 space-y-2 border-b p-2">
{/* Title row with actions */}
<div className="grid w-full grid-cols-1 items-start gap-2 @2xl:grid-cols-[auto_auto] @2xl:justify-between">
- <div className="flex w-full flex-row items-start gap-1">
- <div className="mt-1.5">
- <ItemBadge type={observation.type as ObservationType} isSmall />
- </div>
- <span className="mb-0 ml-1 line-clamp-2 min-w-0 font-medium break-all md:break-normal md:wrap-break-word">
+ <div className="flex w-full flex-row items-center gap-1">
+ <ItemBadge type={observation.type as ObservationType} isSmall />
+ <span className="mb-0 line-clamp-2 min-w-0 font-medium break-all md:break-normal md:wrap-break-word">
{observation.name || observation.id}
</span>
<DetailHeaderActionsMenu
diff --git a/web/src/components/trace/components/SpanContent.tsx b/web/src/components/trace/components/SpanContent.tsx
index 9228ea80a8..b3fe069b3e 100644
--- a/web/src/components/trace/components/SpanContent.tsx
+++ b/web/src/components/trace/components/SpanContent.tsx
@@ -104,7 +104,7 @@ export function SpanContent({
onMouseEnter={onHover}
title={node.name}
className={cn(
- "peer relative flex min-w-0 flex-1 items-start rounded-md py-0.5 pr-2 pl-1 text-left",
+ "peer relative flex min-w-0 flex-1 items-center rounded-md py-0.5 pr-2 pl-1 text-left",
className,
)}
>
diff --git a/web/src/components/trace/components/TraceDetailView/TraceDetailViewHeader.tsx b/web/src/components/trace/components/TraceDetailView/TraceDetailViewHeader.tsx
index 312ffccb97..3c3ef4cd0a 100644
--- a/web/src/components/trace/components/TraceDetailView/TraceDetailViewHeader.tsx
+++ b/web/src/components/trace/components/TraceDetailView/TraceDetailViewHeader.tsx
@@ -88,11 +88,9 @@ export const TraceDetailViewHeader = memo(function TraceDetailViewHeader({
<div className="@container shrink-0 space-y-2 border-b p-2">
{/* Title row with actions */}
<div className="grid w-full grid-cols-1 items-start gap-2 @2xl:grid-cols-[auto_auto] @2xl:justify-between">
- <div className="flex w-full flex-row items-start gap-1">
- <div className="mt-1.5">
- <ItemBadge type="TRACE" isSmall />
- </div>
- <span className="mb-0 ml-1 line-clamp-2 min-w-0 font-medium break-all md:break-normal md:wrap-break-word">
+ <div className="flex w-full flex-row items-center gap-1">
+ <ItemBadge type="TRACE" isSmall />
+ <span className="line-clamp-2 min-w-0 font-medium break-all md:break-normal md:wrap-break-word">
{trace.name || trace.id}
</span>
<CopyIdsPopover idItems={[{ id: trace.id, name: "Trace ID" }]} />
diff --git a/web/src/components/ui/sheet.tsx b/web/src/components/ui/sheet.tsx
index 35ba94ebf9..1bca52f6fe 100644
--- a/web/src/components/ui/sheet.tsx
+++ b/web/src/components/ui/sheet.tsx
@@ -80,10 +80,7 @@ const SheetHeader = ({
...props
}: React.HTMLAttributes<HTMLDivElement>) => (
<div
- className={cn(
- "flex flex-col space-y-2 text-center sm:text-left",
- className,
- )}
+ className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
{...props}
/>
);