Skip to content

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

feat(web): pin evaluator actions during table scrolling (#18163)

Tobias Wochingerb2f89f1e9906
diff --git a/web/src/components/table/DataTable.stories.tsx b/web/src/components/table/DataTable.stories.tsx
index 560b4632b0..7114ffe95e 100644
--- a/web/src/components/table/DataTable.stories.tsx
+++ b/web/src/components/table/DataTable.stories.tsx
@@ -505,6 +505,10 @@ const pinnedColumns: LangfuseColumnDef<TraceRow>[] = plainColumns.map((col) =>
col.id === "id" ? { ...col, isPinnedLeft: true } : col,
);
+const rightPinnedColumns: LangfuseColumnDef<TraceRow>[] = plainColumns.map(
+ (col) => (col.id === "latency" ? { ...col, isPinnedRight: true } : col),
+);
+
// -----------------------------------------------------------------------------
// Stateful async wrapper (emulates server pagination without a backend)
// -----------------------------------------------------------------------------
@@ -696,6 +700,13 @@ export const WithPinnedColumn = meta.story({
},
});
+export const WithRightPinnedColumn = meta.story({
+ args: {
+ tableName: "story-right-pinned-column",
+ columns: rightPinnedColumns,
+ },
+});
+
// -----------------------------------------------------------------------------
// 3. Row selection (authored checkbox column + stateful selection)
// -----------------------------------------------------------------------------
diff --git a/web/src/components/table/data-table.tsx b/web/src/components/table/data-table.tsx
index 38746e126c..f69878bd6f 100644
--- a/web/src/components/table/data-table.tsx
+++ b/web/src/components/table/data-table.tsx
@@ -174,6 +174,8 @@ const getCommonPinningStyles = <TData,>(
column: Column<TData>,
): CSSProperties => {
const isPinned = column.getIsPinned();
+ const coversRightScrollbarGutter =
+ isPinned === "right" && column.getIsLastColumn("right");
return {
left: isPinned === "left" ? `${column.getStart("left")}px` : undefined,
@@ -182,6 +184,16 @@ const getCommonPinningStyles = <TData,>(
width: column.getSize(),
zIndex: isPinned ? 10 : 0,
backgroundColor: isPinned ? "hsl(var(--background))" : undefined,
+ // Repeated outer shadows paint through the stable scrollbar gutter even
+ // when a table cell clips its contents. Only the outermost right-pinned
+ // column owns them, so adjacent pinned columns retain their normal offsets.
+ boxShadow: coversRightScrollbarGutter
+ ? [
+ "16px 0 0 hsl(var(--background))",
+ "32px 0 0 hsl(var(--background))",
+ "48px 0 0 hsl(var(--background))",
+ ].join(", ")
+ : undefined,
};
};
@@ -190,13 +202,8 @@ const getPinningClasses = <TData,>(column: Column<TData>): string => {
const isPinned = column.getIsPinned();
const isLastLeftPinnedColumn =
isPinned === "left" && column.getIsLastColumn("left");
- const isFirstRightPinnedColumn =
- isPinned === "right" && column.getIsFirstColumn("right");
- return cn(
- isLastLeftPinnedColumn && "border-r border-border",
- isFirstRightPinnedColumn && "border-l border-border",
- );
+ return cn(isLastLeftPinnedColumn && "border-r border-border");
};
const getCellPaddingClassName = (padding: DataTableCellPadding) => {
@@ -313,7 +320,9 @@ export function DataTable<TData extends object, TValue>({
left: columns
.filter((col) => col.isPinnedLeft)
.map((col) => col.id || col.accessorKey),
- right: [],
+ right: columns
+ .filter((col) => col.isPinnedRight)
+ .map((col) => col.id || col.accessorKey),
}),
[columns],
);
diff --git a/web/src/components/table/types.ts b/web/src/components/table/types.ts
index 4a4f8d3026..8a4822c598 100644
--- a/web/src/components/table/types.ts
+++ b/web/src/components/table/types.ts
@@ -26,6 +26,7 @@ declare module "@tanstack/react-table" {
headerLabel?: string;
isFixedPosition?: boolean; // if true, column cannot be reordered
isPinnedLeft?: boolean; // if true, column will be pinned to left side
+ isPinnedRight?: boolean; // if true, column will be pinned to right side
isFlexWidth?: boolean; // if true, column absorbs leftover space (one per table)
loadingCell?: React.ReactNode | (() => React.ReactNode);
cellPadding?: DataTableCellPadding;
diff --git a/web/src/features/evals/v2/components/Rules/RulesTable/RulesTable.tsx b/web/src/features/evals/v2/components/Rules/RulesTable/RulesTable.tsx
index f258f3d3a4..4086e35b67 100644
--- a/web/src/features/evals/v2/components/Rules/RulesTable/RulesTable.tsx
+++ b/web/src/features/evals/v2/components/Rules/RulesTable/RulesTable.tsx
@@ -245,7 +245,7 @@ export function RulesTable({
accessorKey: "name",
id: "name",
header: "Name",
- size: 260,
+ size: 220,
isFixedPosition: true,
enableSorting: true,
cell: ({ row }) => {
@@ -298,8 +298,8 @@ export function RulesTable({
createNumberTableColumn<RuleTableRow>({
accessorFn: (row) => costs.data?.[row.id],
id: "totalCost",
- header: "Total cost (7d)",
- size: 140,
+ header: "Cost (7d)",
+ size: 110,
enableHiding: true,
formatter: (value) => usdFormatter(value, 2, 4),
getValue: (value) => {
diff --git a/web/src/features/evals/v2/pages/EvaluatorsPage.tsx b/web/src/features/evals/v2/pages/EvaluatorsPage.tsx
index e9aaf41ca4..a4b7512f02 100644
--- a/web/src/features/evals/v2/pages/EvaluatorsPage.tsx
+++ b/web/src/features/evals/v2/pages/EvaluatorsPage.tsx
@@ -368,7 +368,7 @@ export default function EvaluatorsPage() {
accessorKey: "name",
id: "name",
header: "Name",
- size: 320,
+ size: 240,
isFixedPosition: true,
enableSorting: true,
cell: ({ row }) => (
@@ -381,7 +381,7 @@ export default function EvaluatorsPage() {
accessorKey: "status",
id: "status",
header: "Status",
- size: 130,
+ size: 100,
enableHiding: true,
cell: ({ row }) => {
if (
@@ -416,7 +416,7 @@ export default function EvaluatorsPage() {
accessorKey: "type",
id: "type",
header: "Type",
- size: 160,
+ size: 130,
enableHiding: true,
enableSorting: true,
cell: ({ row }) => <EvaluatorTypeBadge type={row.original.type} />,
@@ -424,8 +424,8 @@ export default function EvaluatorsPage() {
createNumberTableColumn<EvaluatorRow>({
accessorFn: (row) => costs.data?.[row.id],
id: "totalCost",
- header: "Total cost (7d)",
- size: 140,
+ header: "Cost (7d)",
+ size: 110,
enableHiding: true,
formatter: (value) => usdFormatter(value, 2, 4),
getValue: (value) => {
@@ -457,7 +457,7 @@ export default function EvaluatorsPage() {
createUserTableColumn<EvaluatorRow>({
accessorKey: "createdByUser",
header: "Created by",
- size: 180,
+ size: 90,
enableHiding: true,
variant: "text",
emptyValue: "API",
@@ -485,8 +485,9 @@ export default function EvaluatorsPage() {
accessorKey: "actions",
id: "actions",
header: "Actions",
- size: 170,
+ size: 130,
isFixedPosition: true,
+ isPinnedRight: true,
enableSorting: false,
enableResizing: false,
cell: ({ row }) => (
diff --git a/web/src/features/models/components/UpsertModelFormDialog/UpsertModelFormDialogController.clienttest.tsx b/web/src/features/models/components/UpsertModelFormDialog/UpsertModelFormDialogController.clienttest.tsx
index caf73959e9..e279f150d2 100644
--- a/web/src/features/models/components/UpsertModelFormDialog/UpsertModelFormDialogController.clienttest.tsx
+++ b/web/src/features/models/components/UpsertModelFormDialog/UpsertModelFormDialogController.clienttest.tsx
@@ -150,6 +150,11 @@ const submit = () =>
fireEvent.click(screen.getByRole("button", { name: /^(Save|Submit)$/ }));
describe("UpsertModelFormDialogController price editor", () => {
+ afterEach(async () => {
+ cleanup();
+ await new Promise((resolve) => setTimeout(resolve, 0));
+ });
+
beforeAll(() => {
vi.stubGlobal(
"ResizeObserver",