Skip to content

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

fix(traces): Use single-line skeletons for table with small row height (#13138)

Ben Bachem471e150a8754
diff --git a/web/src/components/ui/CodeJsonViewer.tsx b/web/src/components/ui/CodeJsonViewer.tsx
index 5f17319b2f..1798de5b8f 100644
--- a/web/src/components/ui/CodeJsonViewer.tsx
+++ b/web/src/components/ui/CodeJsonViewer.tsx
@@ -340,10 +340,13 @@ export const JsonSkeleton = ({
borderless?: boolean;
className?: string;
}) => {
+ const isSingleLine = numRows === 1;
+
return (
<div
className={cn(
- "w-[400px] rounded-md",
+ isSingleLine ? "w-full" : "w-[400px]",
+ "rounded-md",
borderless ? "" : "border",
className,
)}
@@ -353,7 +356,7 @@ export const JsonSkeleton = ({
<Skeleton
className={cn(
"h-4 w-full",
- i === numRows - 1 ? "w-3/4" : undefined,
+ !isSingleLine && i === numRows - 1 ? "w-3/4" : undefined,
)}
key={i}
/>
diff --git a/web/src/components/ui/IOTableCell.tsx b/web/src/components/ui/IOTableCell.tsx
index 57c6625c79..dab776cd17 100644
--- a/web/src/components/ui/IOTableCell.tsx
+++ b/web/src/components/ui/IOTableCell.tsx
@@ -87,6 +87,7 @@ export const IOTableCell = ({
return (
<JsonSkeleton
borderless
+ numRows={singleLine ? 1 : undefined}
className="h-full w-full overflow-hidden px-2 py-1"
/>
);
diff --git a/web/src/features/events/components/EventsTable.tsx b/web/src/features/events/components/EventsTable.tsx
index dd120bf72b..e43c025fa7 100644
--- a/web/src/features/events/components/EventsTable.tsx
+++ b/web/src/features/events/components/EventsTable.tsx
@@ -582,6 +582,7 @@ export default function ObservationsEventsTable({
if (ioLoading) {
return (
<JsonSkeleton
+ numRows={rowHeight === "s" ? 1 : undefined}
borderless
className="h-full w-full overflow-hidden px-2 py-1"
/>
@@ -607,6 +608,7 @@ export default function ObservationsEventsTable({
if (ioLoading) {
return (
<JsonSkeleton
+ numRows={rowHeight === "s" ? 1 : undefined}
borderless
className="h-full w-full overflow-hidden px-2 py-1"
/>
@@ -636,6 +638,7 @@ export default function ObservationsEventsTable({
if (ioLoading) {
return (
<JsonSkeleton
+ numRows={rowHeight === "s" ? 1 : undefined}
borderless
className="h-full w-full overflow-hidden px-2 py-1"
/>