Skip to content

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

feat: remove restrictions on the number of trace/generation rows when viewing input/output (#1704)

Marc Klingen8105d531b229
diff --git a/web/src/components/table/data-table-IOCell.tsx b/web/src/components/table/data-table-IOCell.tsx
index 9f1ba6f42b..ec315c314c 100644
--- a/web/src/components/table/data-table-IOCell.tsx
+++ b/web/src/components/table/data-table-IOCell.tsx
@@ -16,7 +16,7 @@ export const IOCell = ({
return (
<>
{isLoading ? (
- <JsonSkeleton className="h-full w-[400px] px-3 py-1" />
+ <JsonSkeleton className="h-full w-[400px] overflow-hidden px-2 py-1" />
) : (
<JSONView
json={data}
@@ -39,10 +39,10 @@ export const JsonSkeleton = ({
className?: string;
}) => {
const sizingOptions = [
- "h-5 w-full",
- "h-5 w-[400px]",
- "h-5 w-[450px]",
- "h-5 w-[475px]",
+ "h-4 w-full",
+ "h-4 w-[400px]",
+ "h-4 w-[450px]",
+ "h-4 w-[475px]",
];
const generateRandomSize = () =>
@@ -51,6 +51,7 @@ export const JsonSkeleton = ({
return (
<div className={cn("w-[400px] rounded-md border", className)}>
<div className="flex flex-col gap-1">
+ <Skeleton className="h-4 w-full" />
{[...Array<number>(numRows)].map((_, i) => (
<Skeleton className={generateRandomSize()} key={i} />
))}
diff --git a/web/src/components/table/use-cases/generations.tsx b/web/src/components/table/use-cases/generations.tsx
index a3495b85f3..bea20384bc 100644
--- a/web/src/components/table/use-cases/generations.tsx
+++ b/web/src/components/table/use-cases/generations.tsx
@@ -42,7 +42,6 @@ import { useOrderByState } from "@/src/features/orderBy/hooks/useOrderByState";
import type Decimal from "decimal.js";
import { type ScoreSimplified } from "@/src/server/api/routers/generations/getAllQuery";
import { IOCell } from "../data-table-IOCell";
-import { setSmallPaginationIfColumnsVisible } from "../../../features/column-visibility/hooks/setSmallPaginationIfColumnsVisible";
import { useRowHeightLocalStorage } from "@/src/components/table/data-table-row-height-switch";
export type GenerationsTableRow = {
@@ -560,13 +559,6 @@ export default function GenerationsTable({ projectId }: GenerationsTableProps) {
columns,
);
- const smallTableRequired = setSmallPaginationIfColumnsVisible(
- columnVisibility,
- ["input", "output"],
- paginationState,
- setPaginationState,
- );
-
const rows: GenerationsTableRow[] = generations.isSuccess
? generations.data.generations.map((generation) => {
return {
@@ -666,8 +658,6 @@ export default function GenerationsTable({ projectId }: GenerationsTableProps) {
pageCount: Math.ceil(totalCount / paginationState.pageSize),
onChange: setPaginationState,
state: paginationState,
- // enforce a minimum page size of 10 if input or output columns are visible
- options: smallTableRequired ? [10] : undefined,
}}
setOrderBy={setOrderByState}
orderBy={orderByState}
diff --git a/web/src/components/table/use-cases/traces.tsx b/web/src/components/table/use-cases/traces.tsx
index 7d642e6dbf..47afc2e2b5 100644
--- a/web/src/components/table/use-cases/traces.tsx
+++ b/web/src/components/table/use-cases/traces.tsx
@@ -28,7 +28,6 @@ import { DeleteButton } from "@/src/components/deleteButton";
import { LevelColors } from "@/src/components/level-colors";
import { cn } from "@/src/utils/tailwind";
import { IOCell } from "../data-table-IOCell";
-import { setSmallPaginationIfColumnsVisible } from "@/src/features/column-visibility/hooks/setSmallPaginationIfColumnsVisible";
import { useDetailPageLists } from "@/src/features/navigate-detail-pages/context";
import { useOrderByState } from "@/src/features/orderBy/hooks/useOrderByState";
import {
@@ -491,7 +490,7 @@ export default function TracesTable({
header: "Metadata",
cell: ({ row }) => {
const values: string = row.getValue("metadata");
- return <div className="flex flex-wrap gap-x-3 gap-y-1">{values}</div>;
+ return <IOCell data={values} />;
},
enableHiding: true,
},
@@ -574,13 +573,6 @@ export default function TracesTable({
const [columnVisibility, setColumnVisibility] =
useColumnVisibility<TracesTableRow>("tracesColumnVisibility", columns);
- const smallTableRequired = setSmallPaginationIfColumnsVisible(
- columnVisibility,
- ["input", "output"],
- paginationState,
- setPaginationState,
- );
-
return (
<div>
<DataTableToolbar
@@ -635,7 +627,6 @@ export default function TracesTable({
pageCount: Math.ceil(Number(totalCount) / paginationState.pageSize),
onChange: setPaginationState,
state: paginationState,
- options: smallTableRequired ? [10] : undefined,
}}
setOrderBy={setOrderByState}
orderBy={orderByState}
diff --git a/web/src/features/column-visibility/hooks/setSmallPaginationIfColumnsVisible.tsx b/web/src/features/column-visibility/hooks/setSmallPaginationIfColumnsVisible.tsx
deleted file mode 100644
index 2d24a27b28..0000000000
--- a/web/src/features/column-visibility/hooks/setSmallPaginationIfColumnsVisible.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import type React from "react";
-import type { TracesTableRow } from "@/src/components/table/use-cases/traces";
-import type { GenerationsTableRow } from "../../../components/table/use-cases/generations";
-
-export type TableColumn =
- | (keyof GenerationsTableRow)[]
- | (keyof TracesTableRow)[];
-
-export function setSmallPaginationIfColumnsVisible(
- columnVisibility: Record<string, boolean>,
- columnsRequiringSmallTable: TableColumn,
- paginationState: { pageIndex: number; pageSize: number },
- setPaginationState: React.Dispatch<
- React.SetStateAction<{ pageIndex: number; pageSize: number }>
- >,
-) {
- const smallTableRequired = columnsRequiringSmallTable.some(
- (column) => columnVisibility[column] === true,
- );
-
- if (smallTableRequired && paginationState.pageSize !== 10) {
- setPaginationState((prev) => {
- const currentPage = prev.pageIndex;
- const currentPageSize = prev.pageSize;
- const newPageIndex = Math.floor((currentPage * currentPageSize) / 10);
- return { pageIndex: newPageIndex, pageSize: 10 };
- });
- }
- return smallTableRequired;
-}