Skip to content

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

feat(ui): resizable columns (#2789)

Marc Klingen18122fa33496
diff --git a/web/src/components/grouped-score-badge.tsx b/web/src/components/grouped-score-badge.tsx
index 81d925428a..7abc4db80f 100644
--- a/web/src/components/grouped-score-badge.tsx
+++ b/web/src/components/grouped-score-badge.tsx
@@ -59,7 +59,7 @@ export const GroupedScoreBadges = ({
if (variant === "headings")
return (
- <div className="flex items-center gap-3">
+ <div className="flex items-center gap-3 text-nowrap">
{Object.entries(groupedScores)
.sort(([a], [b]) => (a < b ? -1 : 1))
.map(([name, scores]) => (
diff --git a/web/src/components/table/data-table.tsx b/web/src/components/table/data-table.tsx
index f583955deb..41b20ee11a 100644
--- a/web/src/components/table/data-table.tsx
+++ b/web/src/components/table/data-table.tsx
@@ -1,5 +1,6 @@
"use client";
import { type OrderByState } from "@langfuse/shared";
+import React, { useState, useMemo } from "react";
import DocPopup from "@/src/components/layouts/doc-popup";
import { DataTablePagination } from "@/src/components/table/data-table-pagination";
@@ -30,7 +31,6 @@ import {
type RowSelectionState,
type VisibilityState,
} from "@tanstack/react-table";
-import { useState } from "react";
interface DataTableProps<TData, TValue> {
columns: LangfuseColumnDef<TData, TValue>[];
@@ -106,8 +106,28 @@ export function DataTable<TData extends object, TValue>({
rowSelection,
},
manualFiltering: true,
+ defaultColumn: {
+ minSize: 20,
+ size: 150,
+ maxSize: Number.MAX_SAFE_INTEGER,
+ },
+ columnResizeMode: "onChange",
});
+ // memo column sizes for performance
+ // https://tanstack.com/table/v8/docs/guide/column-sizing#advanced-column-resizing-performance
+ const columnSizeVars = useMemo(() => {
+ const headers = table.getFlatHeaders();
+ const colSizes: { [key: string]: number } = {};
+ for (let i = 0; i < headers.length; i++) {
+ const header = headers[i]!;
+ colSizes[`--header-${header.id}-size`] = header.getSize();
+ colSizes[`--col-${header.column.id}-size`] = header.column.getSize();
+ }
+ return colSizes;
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [table.getState().columnSizingInfo, table.getState().columnSizing]);
+
return (
<>
<div
@@ -121,6 +141,7 @@ export function DataTable<TData extends object, TValue>({
"w-full overflow-auto",
isBorderless ? "" : "rounded-md border",
)}
+ style={{ ...columnSizeVars }}
>
<Table>
<TableHeader>
@@ -134,9 +155,12 @@ export function DataTable<TData extends object, TValue>({
<TableHead
key={header.id}
className={cn(
- sortingEnabled ? "cursor-pointer" : null,
- "whitespace-nowrap p-2",
+ "group p-1 first:pl-2",
+ sortingEnabled && "cursor-pointer",
)}
+ style={{
+ width: `calc(var(--header-${header.id}-size) * 1px)`,
+ }}
title={sortingEnabled ? "Sort by this column" : ""}
onClick={(event) => {
event.preventDefault(); // Add this line
@@ -181,7 +205,6 @@ export function DataTable<TData extends object, TValue>({
header.column.columnDef.header,
header.getContext(),
)}
-
{columnDef.headerTooltip && (
<DocPopup
description={
@@ -190,10 +213,23 @@ export function DataTable<TData extends object, TValue>({
href={columnDef.headerTooltip.href}
/>
)}
-
{orderBy?.column === columnDef.id
? renderOrderingIndicator(orderBy)
: null}
+ <div
+ onClick={(e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ }}
+ onDoubleClick={() => header.column.resetSize()}
+ onMouseDown={header.getResizeHandler()}
+ onTouchStart={header.getResizeHandler()}
+ className={cn(
+ "absolute right-0 top-0 h-full w-1.5 cursor-col-resize touch-none select-none bg-secondary opacity-0 group-hover:opacity-100",
+ header.column.getIsResizing() &&
+ "bg-primary-accent opacity-100",
+ )}
+ />
</div>
</>
)}
@@ -203,53 +239,23 @@ export function DataTable<TData extends object, TValue>({
</TableRow>
))}
</TableHeader>
- <TableBody>
- {data.isLoading || !data.data ? (
- <TableRow className="h-svh">
- <TableCell
- colSpan={columns.length}
- className="content-start border-b text-center"
- >
- Loading...
- </TableCell>
- </TableRow>
- ) : table.getRowModel().rows.length ? (
- table.getRowModel().rows.map((row) => (
- <TableRow key={row.id}>
- {row.getVisibleCells().map((cell) => (
- <TableCell
- key={cell.id}
- className="overflow-hidden whitespace-nowrap border-b px-2 py-1 text-xs first:pl-2"
- >
- <div className={cn("flex items-center", rowheighttw)}>
- {flexRender(
- cell.column.columnDef.cell,
- cell.getContext(),
- )}
- </div>
- </TableCell>
- ))}
- </TableRow>
- ))
- ) : (
- <TableRow>
- <TableCell
- colSpan={columns.length}
- className="h-24 text-center"
- >
- <div>
- No results.{" "}
- {help && (
- <DocPopup
- description={help.description}
- href={help.href}
- />
- )}
- </div>
- </TableCell>
- </TableRow>
- )}
- </TableBody>
+ {table.getState().columnSizingInfo.isResizingColumn ? (
+ <MemoizedTableBody
+ table={table}
+ rowheighttw={rowheighttw}
+ columns={columns}
+ data={data}
+ help={help}
+ />
+ ) : (
+ <TableBodyComponent
+ table={table}
+ rowheighttw={rowheighttw}
+ columns={columns}
+ data={data}
+ help={help}
+ />
+ )}
</Table>
</div>
<div className="grow"></div>
@@ -272,7 +278,76 @@ export function DataTable<TData extends object, TValue>({
}
function renderOrderingIndicator(orderBy?: OrderByState) {
- if (!orderBy) return;
+ if (!orderBy) return null;
if (orderBy.order === "ASC") return <span className="ml-1">â–²</span>;
else return <span className="ml-1">â–¼</span>;
}
+
+interface TableBodyComponentProps<TData> {
+ table: ReturnType<typeof useReactTable<TData>>;
+ rowheighttw?: string;
+ columns: LangfuseColumnDef<TData, any>[];
+ data: AsyncTableData<TData[]>;
+ help?: { description: string; href: string };
+}
+
+function TableBodyComponent<TData>({
+ table,
+ rowheighttw,
+ columns,
+ data,
+ help,
+}: TableBodyComponentProps<TData>) {
+ return (
+ <TableBody>
+ {data.isLoading || !data.data ? (
+ <TableRow className="h-svh">
+ <TableCell
+ colSpan={columns.length}
+ className="content-start border-b text-center"
+ >
+ Loading...
+ </TableCell>
+ </TableRow>
+ ) : table.getRowModel().rows.length ? (
+ table.getRowModel().rows.map((row) => (
+ <TableRow key={row.id}>
+ {row.getVisibleCells().map((cell) => (
+ <TableCell
+ key={cell.id}
+ className={cn(
+ "overflow-hidden border-b p-1 text-xs first:pl-2",
+ rowheighttw === "s" && "whitespace-nowrap",
+ )}
+ style={{
+ width: `calc(var(--col-${cell.column.id}-size) * 1px)`,
+ }}
+ >
+ <div className={cn("flex items-center", rowheighttw)}>
+ {flexRender(cell.column.columnDef.cell, cell.getContext())}
+ </div>
+ </TableCell>
+ ))}
+ </TableRow>
+ ))
+ ) : (
+ <TableRow>
+ <TableCell colSpan={columns.length} className="h-24 text-center">
+ <div>
+ No results.{" "}
+ {help && (
+ <DocPopup description={help.description} href={help.href} />
+ )}
+ </div>
+ </TableCell>
+ </TableRow>
+ )}
+ </TableBody>
+ );
+}
+
+// memo tables for performance, should only re-render when data changes
+// https://tanstack.com/table/v8/docs/guide/column-sizing#advanced-column-resizing-performance
+const MemoizedTableBody = React.memo(TableBodyComponent, (prev, next) => {
+ return prev.table.options.data === next.table.options.data;
+}) as typeof TableBodyComponent;
diff --git a/web/src/components/table/table-link.tsx b/web/src/components/table/table-link.tsx
index 3f233df63e..af84b27da0 100644
--- a/web/src/components/table/table-link.tsx
+++ b/web/src/components/table/table-link.tsx
@@ -1,3 +1,4 @@
+import { cn } from "@/src/utils/tailwind";
import Link from "next/link";
export type TableLinkProps = {
@@ -5,6 +6,7 @@ export type TableLinkProps = {
value: string;
truncateAt?: number;
icon?: React.ReactNode;
+ className?: string;
};
export default function TableLink({
@@ -12,6 +14,7 @@ export default function TableLink({
value,
truncateAt = 7,
icon,
+ className,
}: TableLinkProps) {
const truncatedValue =
value.length - truncateAt > 3
@@ -19,8 +22,10 @@ export default function TableLink({
: value;
return (
<Link
- className="inline-block rounded bg-primary-accent/20 px-2
- py-1 text-xs font-semibold text-accent-dark-blue shadow-sm hover:bg-accent-light-blue/45"
+ className={cn(
+ "inline-block rounded bg-primary-accent/20 px-2 py-1 text-xs font-semibold text-accent-dark-blue shadow-sm hover:bg-accent-light-blue/45",
+ className,
+ )}
href={path}
title={value}
>
diff --git a/web/src/components/table/use-cases/generations.tsx b/web/src/components/table/use-cases/generations.tsx
index b51c71491c..7ffeb381b2 100644
--- a/web/src/components/table/use-cases/generations.tsx
+++ b/web/src/components/table/use-cases/generations.tsx
@@ -244,6 +244,7 @@ export default function GenerationsTable({
accessorKey: "id",
id: "id",
header: "ID",
+ size: 100,
cell: ({ row }) => {
const observationId = row.getValue("id");
const traceId = row.getValue("traceId");
@@ -261,12 +262,14 @@ export default function GenerationsTable({
accessorKey: "name",
id: "name",
header: "Name",
+ size: 150,
enableSorting: true,
},
{
accessorKey: "traceId",
id: "traceId",
header: "Trace ID",
+ size: 100,
cell: ({ row }) => {
const value = row.getValue("traceId");
return typeof value === "string" ? (
@@ -282,6 +285,7 @@ export default function GenerationsTable({
accessorKey: "traceName",
id: "traceName",
header: "Trace Name",
+ size: 150,
enableHiding: true,
enableSorting: true,
},
@@ -289,6 +293,7 @@ export default function GenerationsTable({
accessorKey: "startTime",
id: "startTime",
header: "Start Time",
+ size: 150,
enableHiding: true,
enableSorting: true,
cell: ({ row }) => {
@@ -300,6 +305,7 @@ export default function GenerationsTable({
accessorKey: "endTime",
id: "endTime",
header: "End Time",
+ size: 150,
enableHiding: true,
enableSorting: true,
},
@@ -307,6 +313,7 @@ export default function GenerationsTable({
accessorKey: "timeToFirstToken",
id: "timeToFirstToken",
header: "Time to First Token",
+ size: 150,
enableHiding: true,
enableSorting: true,
cell: ({ row }) => {
@@ -324,6 +331,7 @@ export default function GenerationsTable({
accessorKey: "scores",
id: "scores",
header: "Scores",
+ size: 200,
headerTooltip: {
description:
"Scores are used to evaluate the quality of the trace. They can be automated, based on user feedback, or manually annotated. See docs to learn more.",
@@ -341,6 +349,7 @@ export default function GenerationsTable({
accessorKey: "latency",
id: "latency",
header: "Latency",
+ size: 100,
cell: ({ row }) => {
const latency: number | undefined = row.getValue("latency");
return latency !== undefined ? (
@@ -354,6 +363,7 @@ export default function GenerationsTable({
accessorKey: "timePerOutputToken",
id: "timePerOutputToken",
header: "Time per Output Token",
+ size: 200,
cell: ({ row }) => {
const latency: number | undefined = row.getValue("latency");
const usage: {
@@ -378,6 +388,7 @@ export default function GenerationsTable({
accessorKey: "inputCost",
id: "inputCost",
header: "Input Cost",
+ size: 120,
cell: ({ row }) => {
const value: Decimal | undefined = row.getValue("inputCost");
@@ -393,6 +404,7 @@ export default function GenerationsTable({
accessorKey: "outputCost",
id: "outputCost",
header: "Output Cost",
+ size: 120,
cell: ({ row }) => {
const value: Decimal | undefined = row.getValue("outputCost");
@@ -408,6 +420,7 @@ export default function GenerationsTable({
accessorKey: "totalCost",
header: "Total Cost",
id: "totalCost",
+ size: 120,
cell: ({ row }) => {
const value: Decimal | undefined = row.getValue("totalCost");
@@ -422,6 +435,7 @@ export default function GenerationsTable({
accessorKey: "level",
id: "level",
header: "Level",
+ size: 100,
headerTooltip: {
description:
"Use You can differentiate the importance of observations with the level attribute to control the verbosity of your traces and highlight errors and warnings.",
@@ -448,6 +462,7 @@ export default function GenerationsTable({
accessorKey: "statusMessage",
header: "Status Message",
id: "statusMessage",
+ size: 150,
headerTooltip: {
description:
"Use a statusMessage to e.g. provide additional information on a status such as level=ERROR.",
@@ -460,6 +475,7 @@ export default function GenerationsTable({
accessorKey: "model",
id: "model",
header: "Model",
+ size: 150,
enableHiding: true,
enableSorting: true,
},
@@ -467,6 +483,7 @@ export default function GenerationsTable({
accessorKey: "inputTokens",
id: "inputTokens",
header: "Input Tokens",
+ size: 100,
enableHiding: true,
defaultHidden: true,
enableSorting: true,
@@ -483,6 +500,7 @@ export default function GenerationsTable({
accessorKey: "outputTokens",
id: "outputTokens",
header: "Output Tokens",
+ size: 100,
enableHiding: true,
defaultHidden: true,
enableSorting: true,
@@ -499,6 +517,7 @@ export default function GenerationsTable({
accessorKey: "totalTokens",
id: "totalTokens",
header: "Total Tokens",
+ size: 100,
enableHiding: true,
defaultHidden: true,
enableSorting: true,
@@ -515,6 +534,7 @@ export default function GenerationsTable({
accessorKey: "usage",
header: "Usage",
id: "usage",
+ size: 150,
cell: ({ row }) => {
const value: {
promptTokens: number;
@@ -537,6 +557,7 @@ export default function GenerationsTable({
accessorKey: "input",
header: "Input",
id: "input",
+ size: 300,
cell: ({ row }) => {
const observationId: string = row.getValue("id");
const traceId: string = row.getValue("traceId");
@@ -556,6 +577,7 @@ export default function GenerationsTable({
accessorKey: "output",
id: "output",
header: "Output",
+ size: 300,
cell: ({ row }) => {
const observationId: string = row.getValue("id");
const traceId: string = row.getValue("traceId");
@@ -574,6 +596,7 @@ export default function GenerationsTable({
{
accessorKey: "metadata",
header: "Metadata",
+ size: 300,
headerTooltip: {
description: "Add metadata to traces to track additional information.",
href: "https://langfuse.com/docs/tracing-features/metadata",
@@ -597,6 +620,7 @@ export default function GenerationsTable({
accessorKey: "version",
id: "version",
header: "Version",
+ size: 100,
headerTooltip: {
description: "Track changes via the version tag.",
href: "https://langfuse.com/docs/experimentation",
@@ -612,6 +636,7 @@ export default function GenerationsTable({
description: "Link to prompt version in Langfuse prompt management.",
href: "https://langfuse.com/docs/prompts",
},
+ size: 200,
enableHiding: true,
enableSorting: true,
cell: ({ row }) => {
diff --git a/web/src/components/table/use-cases/models.tsx b/web/src/components/table/use-cases/models.tsx
index 491cd6082a..e7e0ec12f6 100644
--- a/web/src/components/table/use-cases/models.tsx
+++ b/web/src/components/table/use-cases/models.tsx
@@ -17,6 +17,9 @@ import Decimal from "decimal.js";
import { Trash } from "lucide-react";
import { useQueryParams, withDefault, NumberParam } from "use-query-params";
import { cn } from "@/src/utils/tailwind";
+import { IOTableCell } from "@/src/components/ui/CodeJsonViewer";
+import { useRowHeightLocalStorage } from "@/src/components/table/data-table-row-height-switch";
+import { DataTableToolbar } from "@/src/components/table/data-table-toolbar";
export type ModelTableRow = {
modelId: string;
@@ -62,12 +65,15 @@ export default function ModelTable({ projectId }: { projectId: string }) {
});
const totalCount = models.data?.totalCount ?? 0;
+ const [rowHeight, setRowHeight] = useRowHeightLocalStorage("models", "s");
+
const columns: LangfuseColumnDef<ModelTableRow>[] = [
{
accessorKey: "maintainer",
id: "maintainer",
enableColumnFilter: true,
header: "Maintainer",
+ size: 100,
},
{
accessorKey: "modelName",
@@ -76,6 +82,7 @@ export default function ModelTable({ projectId }: { projectId: string }) {
headerTooltip: {
description: modelConfigDescriptions.modelName,
},
+ size: 150,
},
{
accessorKey: "startDate",
@@ -84,6 +91,7 @@ export default function ModelTable({ projectId }: { projectId: string }) {
headerTooltip: {
description: modelConfigDescriptions.startDate,
},
+ size: 100,
cell: ({ row }) => {
const value: Date | undefined = row.getValue("startDate");
@@ -101,14 +109,13 @@ export default function ModelTable({ projectId }: { projectId: string }) {
description: modelConfigDescriptions.matchPattern,
},
header: "Match Pattern",
+ size: 200,
cell: ({ row }) => {
const value: string = row.getValue("matchPattern");
- return (
- <code className="relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-xs ">
- {value}
- </code>
- );
+ return value ? (
+ <IOTableCell data={value} singleLine={rowHeight === "s"} />
+ ) : null;
},
},
{
@@ -125,6 +132,7 @@ export default function ModelTable({ projectId }: { projectId: string }) {
headerTooltip: {
description: modelConfigDescriptions.inputPrice,
},
+ size: 170,
cell: ({ row }) => {
const value: Decimal | undefined = row.getValue("inputPrice");
@@ -136,6 +144,7 @@ export default function ModelTable({ projectId }: { projectId: string }) {
<span className="text-xs">-</span>
);
},
+ enableHiding: true,
},
{
accessorKey: "outputPrice",
@@ -151,6 +160,7 @@ export default function ModelTable({ projectId }: { projectId: string }) {
</>
);
},
+ size: 170,
cell: ({ row }) => {
const value: Decimal | undefined = row.getValue("outputPrice");
@@ -162,6 +172,7 @@ export default function ModelTable({ projectId }: { projectId: string }) {
<span className="text-xs">-</span>
);
},
+ enableHiding: true,
},
{
accessorKey: "totalPrice",
@@ -177,6 +188,7 @@ export default function ModelTable({ projectId }: { projectId: string }) {
headerTooltip: {
description: modelConfigDescriptions.totalPrice,
},
+ size: 170,
cell: ({ row }) => {
const value: Decimal | undefined = row.getValue("totalPrice");
@@ -188,6 +200,7 @@ export default function ModelTable({ projectId }: { projectId: string }) {
<span className="text-xs">-</span>
);
},
+ enableHiding: true,
},
{
accessorKey: "unit",
@@ -197,6 +210,7 @@ export default function ModelTable({ projectId }: { projectId: string }) {
description: modelConfigDescriptions.unit,
},
enableHiding: true,
+ size: 110,
},
{
accessorKey: "tokenizerId",
@@ -206,6 +220,7 @@ export default function ModelTable({ projectId }: { projectId: string }) {
description: modelConfigDescriptions.tokenizerId,
},
enableHiding: true,
+ size: 110,
},
{
accessorKey: "config",
@@ -215,19 +230,19 @@ export default function ModelTable({ projectId }: { projectId: string }) {
description: modelConfigDescriptions.config,
},
enableHiding: true,
+ size: 200,
cell: ({ row }) => {
const value: Prisma.JsonValue | undefined = row.getValue("config");
return value ? (
- <span className="text-xs">{JSON.stringify(value)}</span>
- ) : (
- <span className="text-xs">-</span>
- );
+ <IOTableCell data={value} singleLine={rowHeight === "s"} />
+ ) : null;
},
},
{
accessorKey: "actions",
header: "Actions",
+ size: 70,
cell: ({ row }) => {
return (
<DeleteModelButton
@@ -241,7 +256,7 @@ export default function ModelTable({ projectId }: { projectId: string }) {
];
const [columnVisibility, setColumnVisibility] =
- useColumnVisibility<ModelTableRow>("scoresColumnVisibility", columns);
+ useColumnVisibility<ModelTableRow>("modelsColumnVisibility", columns);
const convertToTableRow = (model: Model): ModelTableRow => {
return {
@@ -262,31 +277,41 @@ export default function ModelTable({ projectId }: { projectId: string }) {
};
return (
- <DataTable
- columns={columns}
- data={
- models.isLoading
- ? { isLoading: true, isError: false }
- : models.isError
- ? {
- isLoading: false,
- isError: true,
- error: models.error.message,
- }
- : {
- isLoading: false,
- isError: false,
- data: models.data.models.map((t) => convertToTableRow(t)),
- }
- }
- pagination={{
- pageCount: Math.ceil(totalCount / paginationState.pageSize),
- onChange: setPaginationState,
- state: paginationState,
- }}
- columnVisibility={columnVisibility}
- onColumnVisibilityChange={setColumnVisibility}
- />
+ <>
+ <DataTableToolbar
+ columns={columns}
+ columnVisibility={columnVisibility}
+ setColumnVisibility={setColumnVisibility}
+ rowHeight={rowHeight}
+ setRowHeight={setRowHeight}
+ />
+ <DataTable
+ columns={columns}
+ data={
+ models.isLoading
+ ? { isLoading: true, isError: false }
+ : models.isError
+ ? {
+ isLoading: false,
+ isError: true,
+ error: models.error.message,
+ }
+ : {
+ isLoading: false,
+ isError: false,
+ data: models.data.models.map((t) => convertToTableRow(t)),
+ }
+ }
+ pagination={{
+ pageCount: Math.ceil(totalCount / paginationState.pageSize),
+ onChange: setPaginationState,
+ state: paginationState,
+ }}
+ columnVisibility={columnVisibility}
+ onColumnVisibilityChange={setColumnVisibility}
+ rowHeight={rowHeight}
+ />
+ </>
);
}
diff --git a/web/src/components/table/use-cases/score-configs.tsx b/web/src/components/table/use-cases/score-configs.tsx
index 58ba36e1bf..8826f727bf 100644
--- a/web/src/components/table/use-cases/score-configs.tsx
+++ b/web/src/components/table/use-cases/score-configs.tsx
@@ -107,6 +107,7 @@ export function ScoreConfigsTable({ projectId }: { projectId: string }) {
accessorKey: "dataType",
id: "dataType",
header: "Data Type",
+ size: 80,
enableHiding: true,
},
{
@@ -114,6 +115,7 @@ export function ScoreConfigsTable({ projectId }: { projectId: string }) {
id: "range",
header: "Range",
enableHiding: true,
+ size: 300,
cell: ({ row }) => {
const range = getConfigRange(row.original);
@@ -153,6 +155,7 @@ export function ScoreConfigsTable({ projectId }: { projectId: string }) {
accessorKey: "isArchived",
id: "isArchived",
header: "Status",
+ size: 80,
enableHiding: true,
cell: ({ row }) => {
const { isArchived } = row.original;
@@ -162,6 +165,7 @@ export function ScoreConfigsTable({ projectId }: { projectId: string }) {
{
accessorKey: "action",
header: "Action",
+ size: 70,
enableHiding: true,
cell: ({ row }) => {
const { id: configId, isArchived, name } = row.original;
diff --git a/web/src/components/table/use-cases/scores.tsx b/web/src/components/table/use-cases/scores.tsx
index 8db45d3ce0..8c8a6ba7b7 100644
--- a/web/src/components/table/use-cases/scores.tsx
+++ b/web/src/components/table/use-cases/scores.tsx
@@ -141,8 +141,9 @@ export default function ScoresTable({
accessorKey: "traceId",
id: "traceId",
enableColumnFilter: true,
- header: "Trace ID",
+ header: "Trace",
enableSorting: true,
+ size: 100,
cell: ({ row }) => {
const value = row.getValue("traceId");
return typeof value === "string" ? (
@@ -158,8 +159,9 @@ export default function ScoresTable({
{
accessorKey: "observationId",
id: "observationId",
- header: "Observation ID",
+ header: "Observation",
enableSorting: true,
+ size: 100,
cell: ({ row }) => {
const observationId = row.getValue(
"observationId",
@@ -179,6 +181,7 @@ export default function ScoresTable({
id: "traceName",
enableHiding: true,
enableSorting: true,
+ size: 150,
cell: ({ row }) => {
const value = row.getValue("traceName") as ScoresTableRow["traceName"];
const filter = encodeURIComponent(
@@ -195,7 +198,7 @@ export default function ScoresTable({
},
{
accessorKey: "userId",
- header: "Trace User ID",
+ header: "User",
id: "userId",
headerTooltip: {
description: "The user ID associated with the trace.",
@@ -203,6 +206,7 @@ export default function ScoresTable({
},
enableHiding: true,
enableSorting: true,
+ size: 100,
cell: ({ row }) => {
const value = row.getValue("userId");
return typeof value === "string" ? (
@@ -222,6 +226,7 @@ export default function ScoresTable({
id: "timestamp",
enableHiding: true,
enableSorting: true,
+ size: 150,
},
{
accessorKey: "source",
@@ -229,6 +234,7 @@ export default function ScoresTable({
id: "source",
enableHiding: true,
enableSorting: true,
+ size: 100,
},
{
accessorKey: "name",
@@ -236,6 +242,7 @@ export default function ScoresTable({
id: "name",
enableHiding: true,
enableSorting: true,
+ size: 150,
},
{
accessorKey: "dataType",
@@ -243,6 +250,7 @@ export default function ScoresTable({
id: "dataType",
enableHiding: true,
enableSorting: true,
+ size: 100,
},
{
accessorKey: "value",
@@ -250,12 +258,27 @@ export default function ScoresTable({
id: "value",
enableHiding: true,
enableSorting: true,
+ size: 100,
+ },
+ {
+ accessorKey: "comment",
+ header: "Comment",
+ id: "comment",
+ enableHiding: true,
+ size: 400,
+ cell: ({ row }) => {
+ const value = row.getValue("comment") as ScoresTableRow["comment"];
+ return (
+ !!value && <IOTableCell data={value} singleLine={rowHeight === "s"} />
+ );
+ },
},
{
accessorKey: "author",
id: "author",
header: "Author",
enableHiding: true,
+ size: 150,
cell: ({ row }) => {
const { name, image } = row.getValue(
"author",
@@ -283,6 +306,7 @@ export default function ScoresTable({
},
enableHiding: true,
enableSorting: true,
+ size: 150,
cell: ({ row }) => {
const value = row.getValue("jobConfigurationId");
return typeof value === "string" ? (
@@ -296,18 +320,6 @@ export default function ScoresTable({
) : undefined;
},
},
- {
- accessorKey: "comment",
- header: "Comment",
- id: "comment",
- enableHiding: true,
- cell: ({ row }) => {
- const value = row.getValue("comment") as ScoresTableRow["comment"];
- return (
- !!value && <IOTableCell data={value} singleLine={rowHeight === "s"} />
- );
- },
- },
];
const columns = rawColumns.filter(
diff --git a/web/src/components/table/use-cases/sessions.tsx b/web/src/components/table/use-cases/sessions.tsx
index 5e61a8fce1..37523b7799 100644
--- a/web/src/components/table/use-cases/sessions.tsx
+++ b/web/src/components/table/use-cases/sessions.tsx
@@ -14,9 +14,7 @@ import {
import { useDetailPageLists } from "@/src/features/navigate-detail-pages/context";
import { useOrderByState } from "@/src/features/orderBy/hooks/useOrderByState";
import { api } from "@/src/utils/api";
-import {
- formatIntervalSeconds,
-} from "@/src/utils/dates";
+import { formatIntervalSeconds } from "@/src/utils/dates";
import { numberFormatter, usdFormatter } from "@/src/utils/numbers";
import { type RouterOutput } from "@/src/utils/types";
import type Decimal from "decimal.js";
@@ -150,6 +148,7 @@ export default function SessionsTable({
accessorKey: "bookmarked",
id: "bookmarked",
header: undefined,
+ size: 50,
cell: ({ row }) => {
const bookmarked = row.getValue("bookmarked");
const sessionId = row.getValue("id");
@@ -170,6 +169,7 @@ export default function SessionsTable({
accessorKey: "id",
id: "id",
header: "ID",
+ size: 200,
cell: ({ row }) => {
const value = row.getValue("id");
return value && typeof value === "string" ? (
@@ -186,6 +186,7 @@ export default function SessionsTable({
accessorKey: "createdAt",
id: "createdAt",
header: "Created At",
+ size: 150,
enableHiding: true,
enableSorting: true,
},
@@ -193,6 +194,7 @@ export default function SessionsTable({
accessorKey: "sessionDuration",
id: "sessionDuration",
header: "Duration",
+ size: 130,
enableHiding: true,
cell: ({ row }) => {
const value = row.getValue("sessionDuration");
@@ -207,6 +209,7 @@ export default function SessionsTable({
enableColumnFilter: !omittedFilter.find((f) => f === "userIds"),
id: "userIds",
header: "User IDs",
+ size: 200,
enableHiding: true,
cell: ({ row }) => {
const value = row.getValue("userIds");
@@ -218,6 +221,7 @@ export default function SessionsTable({
path={`/project/${projectId}/users/${encodeURIComponent(user)}`}
value={user}
truncateAt={40}
+ className="text-nowrap"
/>
))}
</div>
@@ -227,7 +231,11 @@ export default function SessionsTable({
{
accessorKey: "countTraces",
id: "countTraces",
- header: "Traces Count",
+ header: "Traces",
+ size: 100,
+ headerTooltip: {
+ description: "The number of traces in the session.",
+ },
enableHiding: true,
enableSorting: true,
},
@@ -235,6 +243,7 @@ export default function SessionsTable({
accessorKey: "inputCost",
id: "inputCost",
header: "Input Cost",
+ size: 110,
enableHiding: true,
defaultHidden: true,
enableSorting: true,
@@ -249,6 +258,7 @@ export default function SessionsTable({
accessorKey: "outputCost",
id: "outputCost",
header: "Output Cost",
+ size: 110,
enableHiding: true,
enableSorting: true,
defaultHidden: true,
@@ -264,6 +274,7 @@ export default function SessionsTable({
accessorKey: "totalCost",
id: "totalCost",
header: "Total Cost",
+ size: 110,
enableHiding: true,
enableSorting: true,
cell: ({ row }) => {
@@ -278,6 +289,7 @@ export default function SessionsTable({
accessorKey: "inputTokens",
id: "inputTokens",
header: "Input Tokens",
+ size: 110,
enableHiding: true,
defaultHidden: true,
enableSorting: true,
@@ -293,6 +305,7 @@ export default function SessionsTable({
accessorKey: "outputTokens",
id: "outputTokens",
header: "Output Tokens",
+ size: 110,
enableHiding: true,
defaultHidden: true,
enableSorting: true,
@@ -308,6 +321,7 @@ export default function SessionsTable({
accessorKey: "totalTokens",
id: "totalTokens",
header: "Total Tokens",
+ size: 110,
enableHiding: true,
defaultHidden: true,
enableSorting: true,
@@ -322,6 +336,7 @@ export default function SessionsTable({
accessorKey: "usage",
id: "usage",
header: "Usage",
+ size: 220,
enableHiding: true,
enableSorting: true,
cell: ({ row }) => {
diff --git a/web/src/components/table/use-cases/traces.tsx b/web/src/components/table/use-cases/traces.tsx
index c454eafab0..23cd543b5d 100644
--- a/web/src/components/table/use-cases/traces.tsx
+++ b/web/src/components/table/use-cases/traces.tsx
@@ -210,6 +210,7 @@ export default function TracesTable({
{
id: "select",
accessorKey: "select",
+ size: 30,
header: ({ table }) => (
<Checkbox
checked={
@@ -242,6 +243,7 @@ export default function TracesTable({
accessorKey: "bookmarked",
header: undefined,
id: "bookmarked",
+ size: 30,
cell: ({ row }) => {
const bookmarked: TracesTableRow["bookmarked"] =
row.getValue("bookmarked");
@@ -263,6 +265,7 @@ export default function TracesTable({
accessorKey: "id",
header: "ID",
id: "id",
+ size: 90,
cell: ({ row }) => {
const value: TracesTableRow["id"] = row.getValue("id");
return value && typeof value === "string" ? (
@@ -278,6 +281,7 @@ export default function TracesTable({
accessorKey: "timestamp",
header: "Timestamp",
id: "timestamp",
+ size: 150,
enableHiding: true,
enableSorting: true,
},
@@ -285,6 +289,7 @@ export default function TracesTable({
accessorKey: "name",
header: "Name",
id: "name",
+ size: 150,
enableHiding: true,
enableSorting: true,
},
@@ -292,6 +297,7 @@ export default function TracesTable({
accessorKey: "userId",
header: "User",
id: "userId",
+ size: 150,
headerTooltip: {
description: "Add `userId` to traces to track users.",
href: "https://langfuse.com/docs/tracing-features/users",
@@ -314,6 +320,7 @@ export default function TracesTable({
enableColumnFilter: !omittedFilter.find((f) => f === "sessionId"),
id: "sessionId",
header: "Session",
+ size: 150,
headerTooltip: {
description: "Add `sessionId` to traces to track sessions.",
href: "https://langfuse.com/docs/tracing-features/sessions",
@@ -335,6 +342,7 @@ export default function TracesTable({
accessorKey: "latency",
id: "latency",
header: "Latency",
+ size: 70,
// add seconds to the end of the latency
cell: ({ row }) => {
const value: TracesTableRow["latency"] = row.getValue("latency");
@@ -347,6 +355,7 @@ export default function TracesTable({
accessorKey: "inputTokens",
id: "inputTokens",
header: "Input Tokens",
+ size: 110,
cell: ({ row }) => {
const value: TracesTableRow["usage"] = row.getValue("usage");
return <span>{numberFormatter(value.promptTokens, 0)}</span>;
@@ -359,6 +368,7 @@ export default function TracesTable({
accessorKey: "outputTokens",
id: "outputTokens",
header: "Output Tokens",
+ size: 110,
cell: ({ row }) => {
const value: TracesTableRow["usage"] = row.getValue("usage");
return <span>{numberFormatter(value.completionTokens, 0)}</span>;
@@ -371,6 +381,7 @@ export default function TracesTable({
accessorKey: "totalTokens",
id: "totalTokens",
header: "Total Tokens",
+ size: 110,
cell: ({ row }) => {
const value: TracesTableRow["usage"] = row.getValue("usage");
return <span>{numberFormatter(value.totalTokens, 0)}</span>;
@@ -380,10 +391,10 @@ export default function TracesTable({
enableSorting: true,
},
{
- // TODO: Enable Ordering By Usage (not covered by API yet)
accessorKey: "usage",
header: "Usage",
id: "usage",
+ size: 220,
cell: ({ row }) => {
const value: TracesTableRow["usage"] = row.getValue("usage");
return (
@@ -402,6 +413,7 @@ export default function TracesTable({
accessorKey: "inputCost",
id: "inputCost",
header: "Input Cost",
+ size: 100,
cell: ({ row }) => {
const cost: TracesTableRow["inputCost"] = row.getValue("inputCost");
return (
@@ -422,6 +434,7 @@ export default function TracesTable({
accessorKey: "outputCost",
id: "outputCost",
header: "Output Cost",
+ size: 100,
cell: ({ row }) => {
const cost: TracesTableRow["outputCost"] = row.getValue("outputCost");
return (
@@ -442,6 +455,7 @@ export default function TracesTable({
accessorKey: "totalCost",
id: "totalCost",
header: "Total Cost",
+ size: 100,
cell: ({ row }) => {
const cost: TracesTableRow["totalCost"] = row.getValue("totalCost");
return (
@@ -461,6 +475,7 @@ export default function TracesTable({
accessorKey: "scores",
id: "scores",
header: "Scores",
+ size: 500,
headerTooltip: {
description:
"Scores are used to evaluate the quality of the trace. They can be automated, based on user feedback, or manually annotated. See docs to learn more.",
@@ -477,6 +492,7 @@ export default function TracesTable({
accessorKey: "input",
header: "Input",
id: "input",
+ size: 400,
cell: ({ row }) => {
const traceId: TracesTableRow["id"] = row.getValue("id");
return (
@@ -494,6 +510,7 @@ export default function TracesTable({
accessorKey: "output",
header: "Output",
id: "output",
+ size: 400,
cell: ({ row }) => {
const traceId: TracesTableRow["id"] = row.getValue("id");
return (
@@ -510,6 +527,7 @@ export default function TracesTable({
{
accessorKey: "metadata",
header: "Metadata",
+ size: 400,
headerTooltip: {
description: "Add metadata to traces to track additional information.",
href: "https://langfuse.com/docs/tracing-features/metadata",
@@ -531,6 +549,7 @@ export default function TracesTable({
accessorKey: "level",
id: "level",
header: "Level",
+ size: 75,
cell: ({ row }) => {
const value: TracesTableRow["level"] = row.getValue("level");
return (
@@ -552,7 +571,11 @@ export default function TracesTable({
{
accessorKey: "observationCount",
id: "observationCount",
- header: "Observation Count",
+ header: "Observations",
+ size: 120,
+ headerTooltip: {
+ description: "The number of observations in the trace.",
+ },
enableHiding: true,
defaultHidden: true,
},
@@ -560,6 +583,7 @@ export default function TracesTable({
accessorKey: "version",
id: "version",
header: "Version",
+ size: 100,
headerTooltip: {
description: "Track changes via the version tag.",
href: "https://langfuse.com/docs/experimentation",
@@ -572,6 +596,7 @@ export default function TracesTable({
accessorKey: "release",
id: "release",
header: "Release",
+ size: 100,
headerTooltip: {
description: "Track changes to your application via the release tag.",
href: "https://langfuse.com/docs/experimentation",
@@ -584,6 +609,7 @@ export default function TracesTable({
accessorKey: "tags",
id: "tags",
header: "Tags",
+ size: 150,
headerTooltip: {
description: "Group traces with tags.",
href: "https://langfuse.com/docs/tracing-features/tags",
@@ -600,6 +626,7 @@ export default function TracesTable({
projectId={projectId}
traceId={traceId}
tracesFilter={tracesAllQueryFilter}
+ className={cn(rowHeight !== "s" && "flex-wrap")}
/>
);
},
@@ -608,6 +635,7 @@ export default function TracesTable({
{
accessorKey: "action",
header: "Action",
+ size: 70,
cell: ({ row }) => {
const traceId: TracesTableRow["id"] = row.getValue("id");
return traceId && typeof traceId === "string" ? (
diff --git a/web/src/components/ui/CodeJsonViewer.tsx b/web/src/components/ui/CodeJsonViewer.tsx
index dc33ea8d9d..0301d4ba28 100644
--- a/web/src/components/ui/CodeJsonViewer.tsx
+++ b/web/src/components/ui/CodeJsonViewer.tsx
@@ -191,11 +191,11 @@ export const IOTableCell = ({
return (
<>
{isLoading ? (
- <JsonSkeleton className="h-full w-[400px] overflow-hidden px-2 py-1" />
+ <JsonSkeleton className="h-full w-full overflow-hidden px-2 py-1" />
) : singleLine ? (
<div
className={cn(
- "h-full w-[400px] self-stretch overflow-hidden overflow-y-auto truncate rounded-sm border px-2 py-0.5",
+ "h-full w-full self-stretch overflow-hidden overflow-y-auto truncate rounded-sm border px-2 py-0.5",
className,
)}
>
@@ -205,7 +205,7 @@ export const IOTableCell = ({
<JSONView
json={stringifyJsonNode(data)}
className={cn(
- "h-full w-[400px] self-stretch overflow-y-auto rounded-sm ",
+ "h-full w-full self-stretch overflow-y-auto rounded-sm ",
className,
)}
codeClassName="py-1 px-2"
diff --git a/web/src/components/ui/table.tsx b/web/src/components/ui/table.tsx
index 323a891a20..c11f437b89 100644
--- a/web/src/components/ui/table.tsx
+++ b/web/src/components/ui/table.tsx
@@ -9,7 +9,7 @@ const Table = React.forwardRef<
<table
ref={ref}
className={cn(
- "w-full table-auto caption-bottom border-separate border-spacing-0 space-y-4 overflow-auto text-sm",
+ "w-full table-fixed caption-bottom border-separate border-spacing-0 space-y-4 overflow-auto text-sm",
className,
)}
{...props}
@@ -88,10 +88,7 @@ const TableCell = React.forwardRef<
>(({ className, ...props }, ref) => (
<td
ref={ref}
- className={cn(
- "whitespace-nowrap p-4 align-middle [&:has([role=checkbox])]:pr-0",
- className,
- )}
+ className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
{...props}
/>
));
diff --git a/web/src/ee/features/evals/components/eval-config-table.tsx b/web/src/ee/features/evals/components/eval-config-table.tsx
index ff92796daa..6c7777a1b4 100644
--- a/web/src/ee/features/evals/components/eval-config-table.tsx
+++ b/web/src/ee/features/evals/components/eval-config-table.tsx
@@ -37,6 +37,7 @@ export default function EvalConfigTable({ projectId }: { projectId: string }) {
columnHelper.accessor("id", {
header: "Id",
id: "id",
+ size: 100,
cell: (row) => {
const id = row.getValue();
return id ? (
@@ -51,6 +52,7 @@ export default function EvalConfigTable({ projectId }: { projectId: string }) {
columnHelper.accessor("status", {
header: "Status",
id: "status",
+ size: 80,
cell: (row) => {
const status = row.getValue();
return <StatusBadge type={status.toLowerCase()} />;
@@ -59,18 +61,22 @@ export default function EvalConfigTable({ projectId }: { projectId: string }) {
columnHelper.accessor("createdAt", {
id: "createdAt",
header: "Created At",
+ size: 150,
}),
columnHelper.accessor("template", {
id: "template",
header: "Template",
+ size: 200,
}),
columnHelper.accessor("scoreName", {
id: "scoreName",
header: "Score Name",
+ size: 150,
}),
columnHelper.accessor("filter", {
id: "filter",
header: "Filter",
+ size: 200,
cell: (row) => {
const node = row.getValue();
return <InlineFilterState filterState={node} />;
diff --git a/web/src/features/datasets/components/DatasetItemsTable.tsx b/web/src/features/datasets/components/DatasetItemsTable.tsx
index b63c0e582d..e78aea9820 100644
--- a/web/src/features/datasets/components/DatasetItemsTable.tsx
+++ b/web/src/features/datasets/components/DatasetItemsTable.tsx
@@ -85,6 +85,7 @@ export function DatasetItemsTable({
accessorKey: "id",
header: "Item id",
id: "id",
+ size: 90,
cell: ({ row }) => {
const id: string = row.getValue("id");
return (
@@ -104,6 +105,7 @@ export function DatasetItemsTable({
"Link to the source trace based on which this item was added",
},
id: "source",
+ size: 90,
cell: ({ row }) => {
const source: RowData["source"] = row.getValue("source");
if (!source) return null;
@@ -126,6 +128,7 @@ export function DatasetItemsTable({
accessorKey: "status",
header: "Status",
id: "status",
+ size: 80,
cell: ({ row }) => {
const status: DatasetStatus = row.getValue("status");
return (
@@ -147,12 +150,14 @@ export function DatasetItemsTable({
accessorKey: "createdAt",
header: "Created At",
id: "createdAt",
+ size: 150,
enableHiding: true,
},
{
accessorKey: "input",
header: "Input",
id: "input",
+ size: 200,
enableHiding: true,
cell: ({ row }) => {
const input = row.getValue("input") as RowData["input"];
@@ -165,6 +170,7 @@ export function DatasetItemsTable({
accessorKey: "expectedOutput",
header: "Expected Output",
id: "expectedOutput",
+ size: 200,
enableHiding: true,
cell: ({ row }) => {
const expectedOutput = row.getValue(
@@ -183,6 +189,7 @@ export function DatasetItemsTable({
accessorKey: "metadata",
header: "Metadata",
id: "metadata",
+ size: 200,
enableHiding: true,
cell: ({ row }) => {
const metadata = row.getValue("metadata") as RowData["metadata"];
@@ -195,6 +202,7 @@ export function DatasetItemsTable({
id: "actions",
accessorKey: "actions",
header: "Actions",
+ size: 70,
cell: ({ row }) => {
const id: string = row.getValue("id");
const status: DatasetStatus = row.getValue("status");
diff --git a/web/src/features/datasets/components/DatasetRunItemsTable.tsx b/web/src/features/datasets/components/DatasetRunItemsTable.tsx
index 9a1a1de9dc..dd66b46120 100644
--- a/web/src/features/datasets/components/DatasetRunItemsTable.tsx
+++ b/web/src/features/datasets/components/DatasetRunItemsTable.tsx
@@ -82,11 +82,13 @@ export function DatasetRunItemsTable(
accessorKey: "runAt",
header: "Run At",
id: "runAt",
+ size: 150,
},
{
accessorKey: "datasetItemId",
header: "Dataset Item",
id: "datasetItemId",
+ size: 110,
cell: ({ row }) => {
const datasetItemId: string = row.getValue("datasetItemId");
return (
@@ -102,6 +104,7 @@ export function DatasetRunItemsTable(
accessorKey: "trace",
header: "Trace",
id: "trace",
+ size: 60,
cell: ({ row }) => {
const trace: RowData["trace"] = row.getValue("trace");
if (!trace) return null;
@@ -124,6 +127,7 @@ export function DatasetRunItemsTable(
accessorKey: "latency",
header: "Latency",
id: "latency",
+ size: 70,
enableHiding: true,
cell: ({ row }) => {
const latency: RowData["latency"] = row.getValue("latency");
@@ -132,8 +136,9 @@ export function DatasetRunItemsTable(
},
{
accessorKey: "totalCost",
- header: "Total Cost",
+ header: "Cost",
id: "totalCost",
+ size: 60,
enableHiding: true,
cell: ({ row }) => {
const totalCost: RowData["totalCost"] = row.getValue("totalCost");
@@ -144,6 +149,7 @@ export function DatasetRunItemsTable(
accessorKey: "scores",
header: "Scores",
id: "scores",
+ size: 150,
enableHiding: true,
cell: ({ row }) => {
const scores: RowData["scores"] = row.getValue("scores");
@@ -154,6 +160,7 @@ export function DatasetRunItemsTable(
accessorKey: "input",
header: "Input",
id: "input",
+ size: 200,
enableHiding: true,
cell: ({ row }) => {
const trace: RowData["trace"] = row.getValue("trace");
@@ -171,6 +178,7 @@ export function DatasetRunItemsTable(
accessorKey: "output",
header: "Output",
id: "output",
+ size: 200,
enableHiding: true,
cell: ({ row }) => {
const trace: RowData["trace"] = row.getValue("trace");
@@ -188,6 +196,7 @@ export function DatasetRunItemsTable(
accessorKey: "expectedOutput",
header: "Expected Output",
id: "expectedOutput",
+ size: 200,
enableHiding: true,
cell: ({ row }) => {
const datasetItemId: string = row.getValue("datasetItemId");
@@ -209,7 +218,7 @@ export function DatasetRunItemsTable(
): RowData => {
return {
id: item.id,
- runAt: item.createdAt.toISOString(),
+ runAt: item.createdAt.toLocaleString(),
datasetItemId: item.datasetItemId,
trace: !!item.trace?.id
? {
diff --git a/web/src/features/datasets/components/DatasetRunsTable.tsx b/web/src/features/datasets/components/DatasetRunsTable.tsx
index 8bffdf2256..d86ec3ac15 100644
--- a/web/src/features/datasets/components/DatasetRunsTable.tsx
+++ b/web/src/features/datasets/components/DatasetRunsTable.tsx
@@ -64,6 +64,7 @@ export function DatasetRunsTable(props: {
accessorKey: "key",
header: "Name",
id: "key",
+ size: 150,
cell: ({ row }) => {
const key: RowData["key"] = row.getValue("key");
return (
@@ -79,18 +80,21 @@ export function DatasetRunsTable(props: {
accessorKey: "description",
header: "Description",
id: "description",
+ size: 300,
enableHiding: true,
},
{
accessorKey: "countRunItems",
header: "Run Items",
id: "countRunItems",
+ size: 90,
enableHiding: true,
},
{
accessorKey: "avgLatency",
header: "Latency (avg)",
id: "avgLatency",
+ size: 120,
enableHiding: true,
cell: ({ row }) => {
const avgLatency: RowData["avgLatency"] = row.getValue("avgLatency");
@@ -101,6 +105,7 @@ export function DatasetRunsTable(props: {
accessorKey: "avgTotalCost",
header: "Total Cost (avg)",
id: "avgTotalCost",
+ size: 130,
enableHiding: true,
cell: ({ row }) => {
const avgTotalCost: RowData["avgTotalCost"] =
@@ -112,6 +117,7 @@ export function DatasetRunsTable(props: {
accessorKey: "scores",
header: "Scores (avg)",
id: "scores",
+ size: 400,
enableHiding: true,
cell: ({ row }) => {
const scores: RowData["scores"] = row.getValue("scores");
@@ -131,12 +137,14 @@ export function DatasetRunsTable(props: {
accessorKey: "createdAt",
header: "Created",
id: "createdAt",
+ size: 150,
enableHiding: true,
},
{
accessorKey: "metadata",
header: "Metadata",
id: "metadata",
+ size: 200,
enableHiding: true,
cell: ({ row }) => {
const metadata: RowData["metadata"] = row.getValue("metadata");
diff --git a/web/src/features/datasets/components/DatasetsTable.tsx b/web/src/features/datasets/components/DatasetsTable.tsx
index f57ea73d51..9838da3cb6 100644
--- a/web/src/features/datasets/components/DatasetsTable.tsx
+++ b/web/src/features/datasets/components/DatasetsTable.tsx
@@ -26,7 +26,7 @@ type RowData = {
id: string;
name: string;
};
- description: string;
+ description?: string;
createdAt: string;
lastRunAt?: string;
countItems: number;
@@ -65,6 +65,7 @@ export function DatasetsTable(props: { projectId: string }) {
accessorKey: "key",
header: "Name",
id: "key",
+ size: 150,
cell: ({ row }) => {
const key: RowData["key"] = row.getValue("key");
return (
@@ -81,36 +82,42 @@ export function DatasetsTable(props: { projectId: string }) {
header: "Description",
id: "description",
enableHiding: true,
+ size: 200,
},
{
accessorKey: "countItems",
header: "Items",
id: "countItems",
enableHiding: true,
+ size: 60,
},
{
accessorKey: "countRuns",
header: "Runs",
id: "countRuns",
enableHiding: true,
+ size: 60,
},
{
accessorKey: "createdAt",
header: "Created",
id: "createdAt",
enableHiding: true,
+ size: 150,
},
{
accessorKey: "lastRunAt",
header: "Last Run",
id: "lastRunAt",
enableHiding: true,
+ size: 150,
},
{
accessorKey: "metadata",
header: "Metadata",
id: "metadata",
enableHiding: true,
+ size: 300,
cell: ({ row }) => {
const metadata: RowData["metadata"] = row.getValue("metadata");
return !!metadata ? (
@@ -122,6 +129,7 @@ export function DatasetsTable(props: { projectId: string }) {
id: "actions",
accessorKey: "actions",
header: "Actions",
+ size: 70,
cell: ({ row }) => {
const key: RowData["key"] = row.getValue("key");
return (
diff --git a/web/src/features/prompts/components/prompts-table.tsx b/web/src/features/prompts/components/prompts-table.tsx
index 889fb39222..e5a8dfad78 100644
--- a/web/src/features/prompts/components/prompts-table.tsx
+++ b/web/src/features/prompts/components/prompts-table.tsx
@@ -152,6 +152,7 @@ export function PromptTable() {
header: "Name",
id: "name",
enableSorting: true,
+ size: 250,
cell: (row) => {
const name = row.getValue();
return name ? (
@@ -164,9 +165,10 @@ export function PromptTable() {
},
}),
columnHelper.accessor("version", {
- header: "Latest Version",
+ header: "Versions",
id: "version",
enableSorting: true,
+ size: 70,
cell: (row) => {
return row.getValue();
},
@@ -175,6 +177,7 @@ export function PromptTable() {
header: "Type",
id: "type",
enableSorting: true,
+ size: 60,
cell: (row) => {
return row.getValue();
},
@@ -183,6 +186,7 @@ export function PromptTable() {
header: "Latest Version Created At",
id: "createdAt",
enableSorting: true,
+ size: 200,
cell: (row) => {
const createdAt = row.getValue();
return createdAt.toLocaleString();
@@ -190,6 +194,7 @@ export function PromptTable() {
}),
columnHelper.accessor("numberOfObservations", {
header: "Number of Generations",
+ size: 170,
cell: (row) => {
const numberOfObservations = row.getValue();
const name = row.row.original.name;
@@ -211,6 +216,7 @@ export function PromptTable() {
header: "Tags",
id: "tags",
enableSorting: true,
+ size: 120,
cell: (row) => {
const tags = row.getValue();
const promptName: string = row.row.original.name;
@@ -234,6 +240,7 @@ export function PromptTable() {
columnHelper.display({
id: "actions",
header: "Actions",
+ size: 70,
cell: (row) => {
const name = row.row.original.name;
return <DeletePrompt promptName={name} />;
diff --git a/web/src/pages/project/[projectId]/prompts/[promptName]/metrics.tsx b/web/src/pages/project/[projectId]/prompts/[promptName]/metrics.tsx
index eeb946aaa1..5d536c825e 100644
--- a/web/src/pages/project/[projectId]/prompts/[promptName]/metrics.tsx
+++ b/web/src/pages/project/[projectId]/prompts/[promptName]/metrics.tsx
@@ -122,6 +122,7 @@ export default function PromptVersionTable() {
accessorKey: "version",
id: "version",
header: "Version",
+ size: 80,
cell: ({ row }) => {
const version = row.getValue("version");
return typeof version === "number" ? (
@@ -136,6 +137,7 @@ export default function PromptVersionTable() {
accessorKey: "labels",
id: "labels",
header: "Labels",
+ size: 160,
cell: ({ row }) => {
const values: string[] = row.getValue("labels");
return (
@@ -159,6 +161,7 @@ export default function PromptVersionTable() {
accessorKey: "medianLatency",
id: "medianLatency",
header: "Median latency",
+ size: 140,
cell: ({ row }) => {
const latency: number | undefined | null =
row.getValue("medianLatency");
@@ -176,6 +179,7 @@ export default function PromptVersionTable() {
accessorKey: "medianInputTokens",
id: "medianInputTokens",
header: "Median input tokens",
+ size: 160,
enableHiding: true,
cell: ({ row }) => {
const value: number | undefined | null =
@@ -191,6 +195,7 @@ export default function PromptVersionTable() {
accessorKey: "medianOutputTokens",
id: "medianOutputTokens",
header: "Median output tokens",
+ size: 170,
enableHiding: true,
cell: ({ row }) => {
const value: number | undefined | null =
@@ -205,6 +210,7 @@ export default function PromptVersionTable() {
accessorKey: "medianCost",
id: "medianCost",
header: "Median cost",
+ size: 120,
cell: ({ row }) => {
const value: number | undefined | null = row.getValue("medianCost");
if (!promptMetrics.isSuccess) {
@@ -219,6 +225,7 @@ export default function PromptVersionTable() {
accessorKey: "generationCount",
id: "generationCount",
header: "Generations count",
+ size: 150,
enableHiding: true,
cell: ({ row }) => {
const value: number | undefined | null =
@@ -235,6 +242,7 @@ export default function PromptVersionTable() {
accessorKey: "averageObservationScores",
id: "averageObservationScores",
header: "Average observation scores",
+ size: 250,
cell: ({ row }) => {
const scores: PromptVersionTableRow["averageObservationScores"] =
row.getValue("averageObservationScores");
@@ -262,6 +270,7 @@ export default function PromptVersionTable() {
accessorKey: "averageTraceScores",
id: "averageTraceScores",
header: "Average trace scores",
+ size: 250,
cell: ({ row }) => {
const scores: PromptVersionTableRow["averageTraceScores"] =
row.getValue("averageTraceScores");
@@ -290,6 +299,7 @@ export default function PromptVersionTable() {
id: "lastUsed",
header: "Last used",
enableHiding: true,
+ size: 150,
headerTooltip: {
description:
"The last time this prompt version was used in a generation. See docs for details on how to link generations/traces to prompt versions.",
@@ -307,6 +317,7 @@ export default function PromptVersionTable() {
accessorKey: "firstUsed",
id: "firstUsed",
header: "First used",
+ size: 150,
enableHiding: true,
headerTooltip: {
description:
diff --git a/web/src/pages/project/[projectId]/users.tsx b/web/src/pages/project/[projectId]/users.tsx
index 75dfd81405..7c7b90cb65 100644
--- a/web/src/pages/project/[projectId]/users.tsx
+++ b/web/src/pages/project/[projectId]/users.tsx
@@ -121,6 +121,7 @@ export default function UsersPage() {
accessorKey: "userId",
enableColumnFilter: true,
header: "User ID",
+ size: 150,
cell: ({ row }) => {
const value: RowData["userId"] = row.getValue("userId");
return typeof value === "string" ? (
@@ -137,6 +138,7 @@ export default function UsersPage() {
{
accessorKey: "firstEvent",
header: "First Event",
+ size: 150,
cell: ({ row }) => {
const value: RowData["firstEvent"] = row.getValue("firstEvent");
if (!userMetrics.isSuccess) {
@@ -150,6 +152,7 @@ export default function UsersPage() {
{
accessorKey: "lastEvent",
header: "Last Event",
+ size: 150,
cell: ({ row }) => {
const value: RowData["lastEvent"] = row.getValue("lastEvent");
if (!userMetrics.isSuccess) {
@@ -163,6 +166,7 @@ export default function UsersPage() {
{
accessorKey: "totalEvents",
header: "Total Events",
+ size: 120,
cell: ({ row }) => {
const value: RowData["totalEvents"] = row.getValue("totalEvents");
if (!userMetrics.isSuccess) {
@@ -176,6 +180,7 @@ export default function UsersPage() {
{
accessorKey: "totalTokens",
header: "Total Tokens",
+ size: 120,
cell: ({ row }) => {
const value: RowData["totalTokens"] = row.getValue("totalTokens");
if (!userMetrics.isSuccess) {
@@ -189,6 +194,7 @@ export default function UsersPage() {
{
accessorKey: "totalCost",
header: "Total Cost",
+ size: 120,
cell: ({ row }) => {
const value: RowData["totalCost"] = row.getValue("totalCost");
if (!userMetrics.isSuccess) {
@@ -202,6 +208,7 @@ export default function UsersPage() {
{
accessorKey: "lastScore",
header: "Last Score",
+ size: 200,
cell: ({ row }) => {
const value: RowData["lastScore"] = row.getValue("lastScore");
if (!userMetrics.isSuccess) {