Skip to content

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

feat: add sticky headings to table component (#2053)

marliessophie03d00c405cde
diff --git a/web/src/components/table/data-table-pagination.tsx b/web/src/components/table/data-table-pagination.tsx
index 97d610f54c..1c2687abc8 100644
--- a/web/src/components/table/data-table-pagination.tsx
+++ b/web/src/components/table/data-table-pagination.tsx
@@ -27,12 +27,12 @@ export function DataTablePagination<TData>({
}: DataTablePaginationProps<TData>) {
const capture = usePostHogClientCapture();
return (
- <div className="mt-3 flex items-center justify-between overflow-x-auto px-2">
+ <div className="flex items-center justify-between">
<div className="flex-1 text-sm text-muted-foreground">
{/* {table.getFilteredSelectedRowModel().rows.length} of{" "}
{table.getFilteredRowModel().rows.length} row(s) selected. */}
</div>
- <div className="flex items-center space-x-6 lg:space-x-8">
+ <div className="flex flex-wrap items-center space-x-6 lg:space-x-8">
<div className="flex items-center space-x-2">
<p className="whitespace-nowrap text-sm font-medium">Rows per page</p>
<Select
diff --git a/web/src/components/table/data-table-toolbar.tsx b/web/src/components/table/data-table-toolbar.tsx
index c14c11c39b..5c30e49b25 100644
--- a/web/src/components/table/data-table-toolbar.tsx
+++ b/web/src/components/table/data-table-toolbar.tsx
@@ -51,7 +51,7 @@ export function DataTableToolbar<TData, TValue>({
const capture = usePostHogClientCapture();
return (
- <div className="my-2 flex flex-1 flex-wrap items-center gap-2 @container">
+ <div className="my-2 flex flex-wrap items-center gap-2 @container">
{searchConfig && (
<div className="flex max-w-md items-center">
<Input
@@ -86,7 +86,7 @@ export function DataTableToolbar<TData, TValue>({
onChange={setFilterState}
/>
)}
- <div className="flex flex-row flex-wrap gap-2 @6xl:ml-auto">
+ <div className="flex flex-row flex-wrap gap-2 pr-0.5 @6xl:ml-auto">
{!!columnVisibility && !!setColumnVisibility && (
<DataTableColumnVisibilityFilter
columns={columns}
diff --git a/web/src/components/table/data-table.tsx b/web/src/components/table/data-table.tsx
index ff453a1558..6eea1c4d00 100644
--- a/web/src/components/table/data-table.tsx
+++ b/web/src/components/table/data-table.tsx
@@ -12,6 +12,7 @@ import {
Table,
TableBody,
TableCell,
+ TableFooter,
TableHead,
TableHeader,
TableRow,
@@ -49,6 +50,7 @@ interface DataTableProps<TData, TValue> {
setOrderBy?: (s: OrderByState) => void;
help?: { description: string; href: string };
rowHeight?: RowHeight;
+ className?: string;
}
export interface AsyncTableData<T> {
@@ -104,8 +106,8 @@ export function DataTable<TData extends object, TValue>({
return (
<>
- <div className="space-y-4">
- <div className="rounded-md border">
+ <div className="flex w-full max-w-full flex-1 flex-col gap-1 overflow-auto">
+ <div className="w-full overflow-auto rounded-md border">
<Table>
<TableHeader>
{table.getHeaderGroups().map((headerGroup) => (
@@ -190,10 +192,10 @@ export function DataTable<TData extends object, TValue>({
</TableHeader>
<TableBody>
{data.isLoading || !data.data ? (
- <TableRow>
+ <TableRow className="h-svh">
<TableCell
colSpan={columns.length}
- className="h-24 text-center"
+ className="content-start border-b text-center"
>
Loading...
</TableCell>
@@ -204,7 +206,7 @@ export function DataTable<TData extends object, TValue>({
{row.getVisibleCells().map((cell) => (
<TableCell
key={cell.id}
- className="overflow-hidden whitespace-nowrap px-2 py-1 text-xs first:pl-2"
+ className="overflow-hidden whitespace-nowrap border-b px-2 py-1 text-xs first:pl-2"
>
<div className={cn("flex items-center", rowheighttw)}>
{flexRender(
@@ -238,12 +240,15 @@ export function DataTable<TData extends object, TValue>({
</TableBody>
</Table>
</div>
+ <div className="grow"></div>
</div>
{pagination !== undefined ? (
- <DataTablePagination
- table={table}
- paginationOptions={pagination.options}
- />
+ <div className="sticky bottom-0 z-10 flex w-full justify-end bg-white font-medium">
+ <DataTablePagination
+ table={table}
+ paginationOptions={pagination.options}
+ />
+ </div>
) : null}
</>
);
diff --git a/web/src/components/table/use-cases/generations.tsx b/web/src/components/table/use-cases/generations.tsx
index e75cebf053..56e18f8533 100644
--- a/web/src/components/table/use-cases/generations.tsx
+++ b/web/src/components/table/use-cases/generations.tsx
@@ -648,7 +648,7 @@ export default function GenerationsTable({
: [];
return (
- <div>
+ <>
<DataTableToolbar
columns={columns}
filterColumnDefinition={transformFilterOptions(filterOptions.data)}
@@ -722,7 +722,7 @@ export default function GenerationsTable({
onColumnVisibilityChange={setColumnVisibilityState}
rowHeight={rowHeight}
/>
- </div>
+ </>
);
}
diff --git a/web/src/components/table/use-cases/models.tsx b/web/src/components/table/use-cases/models.tsx
index 56c16eb437..490b1d733c 100644
--- a/web/src/components/table/use-cases/models.tsx
+++ b/web/src/components/table/use-cases/models.tsx
@@ -256,33 +256,31 @@ export default function ModelTable({ projectId }: { projectId: string }) {
};
return (
- <div>
- <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}
- />
- </div>
+ <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}
+ />
);
}
diff --git a/web/src/components/table/use-cases/scores.tsx b/web/src/components/table/use-cases/scores.tsx
index a796f66ac0..7f34132857 100644
--- a/web/src/components/table/use-cases/scores.tsx
+++ b/web/src/components/table/use-cases/scores.tsx
@@ -255,7 +255,7 @@ export default function ScoresTable({
};
return (
- <div>
+ <>
<DataTableToolbar
columns={columns}
filterColumnDefinition={transformFilterOptions(filterOptions.data)}
@@ -294,6 +294,6 @@ export default function ScoresTable({
onColumnVisibilityChange={setColumnVisibility}
rowHeight={rowHeight}
/>
- </div>
+ </>
);
}
diff --git a/web/src/components/table/use-cases/sessions.tsx b/web/src/components/table/use-cases/sessions.tsx
index 746f2d6010..75fa08c60f 100644
--- a/web/src/components/table/use-cases/sessions.tsx
+++ b/web/src/components/table/use-cases/sessions.tsx
@@ -335,7 +335,7 @@ export default function SessionsTable({
useColumnVisibility<SessionTableRow>("sessionsColumnVisibility", columns);
return (
- <div>
+ <>
<DataTableToolbar
filterColumnDefinition={transformFilterOptions()}
filterState={userFilterState}
@@ -376,6 +376,6 @@ export default function SessionsTable({
href: "https://langfuse.com/docs/tracing-features/sessions",
}}
/>
- </div>
+ </>
);
}
diff --git a/web/src/components/table/use-cases/traces.tsx b/web/src/components/table/use-cases/traces.tsx
index fbaafac7b6..f0eb48c3e6 100644
--- a/web/src/components/table/use-cases/traces.tsx
+++ b/web/src/components/table/use-cases/traces.tsx
@@ -599,7 +599,7 @@ export default function TracesTable({
useColumnVisibility<TracesTableRow>("tracesColumnVisibility", columns);
return (
- <div>
+ <>
<DataTableToolbar
columns={columns}
filterColumnDefinition={transformFilterOptions(traceFilterOptions.data)}
@@ -661,7 +661,7 @@ export default function TracesTable({
onColumnVisibilityChange={setColumnVisibility}
rowHeight={rowHeight}
/>
- </div>
+ </>
);
}
diff --git a/web/src/components/ui/table.tsx b/web/src/components/ui/table.tsx
index 79d099a3c4..2a79992858 100644
--- a/web/src/components/ui/table.tsx
+++ b/web/src/components/ui/table.tsx
@@ -6,13 +6,14 @@ const Table = React.forwardRef<
HTMLTableElement,
React.HTMLAttributes<HTMLTableElement>
>(({ className, ...props }, ref) => (
- <div className="relative w-full overflow-auto">
- <table
- ref={ref}
- className={cn("w-full caption-bottom text-sm", className)}
- {...props}
- />
- </div>
+ <table
+ ref={ref}
+ className={cn(
+ "w-full table-auto caption-bottom border-separate border-spacing-0 space-y-4 overflow-auto text-sm",
+ className,
+ )}
+ {...props}
+ />
));
Table.displayName = "Table";
@@ -73,7 +74,7 @@ const TableHead = React.forwardRef<
<th
ref={ref}
className={cn(
- "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
+ "sticky top-0 z-10 border-b bg-white px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
className,
)}
{...props}
@@ -87,7 +88,10 @@ const TableCell = React.forwardRef<
>(({ className, ...props }, ref) => (
<td
ref={ref}
- className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
+ className={cn(
+ "whitespace-nowrap 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 a71103463a..af09b5d05a 100644
--- a/web/src/ee/features/evals/components/eval-config-table.tsx
+++ b/web/src/ee/features/evals/components/eval-config-table.tsx
@@ -92,32 +92,30 @@ export default function EvalConfigTable({ projectId }: { projectId: string }) {
};
return (
- <div>
- <DataTable
- columns={columns}
- data={
- templates.isLoading
- ? { isLoading: true, isError: false }
- : templates.isError
- ? {
- isLoading: false,
- isError: true,
- error: templates.error.message,
- }
- : {
- isLoading: false,
- isError: false,
- data: templates.data.configs.map((t) => convertToTableRow(t)),
- }
- }
- pagination={{
- pageCount: Math.ceil(totalCount / paginationState.pageSize),
- onChange: setPaginationState,
- state: paginationState,
- }}
- columnVisibility={columnVisibility}
- onColumnVisibilityChange={setColumnVisibility}
- />
- </div>
+ <DataTable
+ columns={columns}
+ data={
+ templates.isLoading
+ ? { isLoading: true, isError: false }
+ : templates.isError
+ ? {
+ isLoading: false,
+ isError: true,
+ error: templates.error.message,
+ }
+ : {
+ isLoading: false,
+ isError: false,
+ data: templates.data.configs.map((t) => convertToTableRow(t)),
+ }
+ }
+ pagination={{
+ pageCount: Math.ceil(totalCount / paginationState.pageSize),
+ onChange: setPaginationState,
+ state: paginationState,
+ }}
+ columnVisibility={columnVisibility}
+ onColumnVisibilityChange={setColumnVisibility}
+ />
);
}
diff --git a/web/src/ee/features/evals/components/eval-templates-table.tsx b/web/src/ee/features/evals/components/eval-templates-table.tsx
index 17136d6b5d..f078cbe7bc 100644
--- a/web/src/ee/features/evals/components/eval-templates-table.tsx
+++ b/web/src/ee/features/evals/components/eval-templates-table.tsx
@@ -87,34 +87,30 @@ export default function EvalsTemplateTable({
};
return (
- <div>
- <DataTable
- columns={columns}
- data={
- templates.isLoading
- ? { isLoading: true, isError: false }
- : templates.isError
- ? {
- isLoading: false,
- isError: true,
- error: templates.error.message,
- }
- : {
- isLoading: false,
- isError: false,
- data: templates.data.templates.map((t) =>
- convertToTableRow(t),
- ),
- }
- }
- pagination={{
- pageCount: Math.ceil(totalCount / paginationState.pageSize),
- onChange: setPaginationState,
- state: paginationState,
- }}
- columnVisibility={columnVisibility}
- onColumnVisibilityChange={setColumnVisibility}
- />
- </div>
+ <DataTable
+ columns={columns}
+ data={
+ templates.isLoading
+ ? { isLoading: true, isError: false }
+ : templates.isError
+ ? {
+ isLoading: false,
+ isError: true,
+ error: templates.error.message,
+ }
+ : {
+ isLoading: false,
+ isError: false,
+ data: templates.data.templates.map((t) => convertToTableRow(t)),
+ }
+ }
+ pagination={{
+ pageCount: Math.ceil(totalCount / paginationState.pageSize),
+ onChange: setPaginationState,
+ state: paginationState,
+ }}
+ columnVisibility={columnVisibility}
+ onColumnVisibilityChange={setColumnVisibility}
+ />
);
}
diff --git a/web/src/ee/features/evals/pages/configs.tsx b/web/src/ee/features/evals/pages/configs.tsx
index 9da707cda8..ac62a15dd9 100644
--- a/web/src/ee/features/evals/pages/configs.tsx
+++ b/web/src/ee/features/evals/pages/configs.tsx
@@ -17,7 +17,7 @@ export default function ConfigsPage() {
});
return (
- <div>
+ <div className="flex h-[calc(100vh-6rem)] flex-col overflow-hidden md:h-[calc(100vh-2rem)]">
<Header
title="Eval configs"
help={{
diff --git a/web/src/ee/features/evals/pages/templates.tsx b/web/src/ee/features/evals/pages/templates.tsx
index 7b4c93ffd8..2707fe3f14 100644
--- a/web/src/ee/features/evals/pages/templates.tsx
+++ b/web/src/ee/features/evals/pages/templates.tsx
@@ -17,7 +17,7 @@ export default function TemplatesPage() {
});
return (
- <div>
+ <div className="flex h-[calc(100vh-6rem)] flex-col overflow-hidden md:h-[calc(100vh-2rem)]">
<Header
title="Eval Templates"
help={{
diff --git a/web/src/features/datasets/components/DatasetItemsTable.tsx b/web/src/features/datasets/components/DatasetItemsTable.tsx
index 424f135ce3..0ef09d99c1 100644
--- a/web/src/features/datasets/components/DatasetItemsTable.tsx
+++ b/web/src/features/datasets/components/DatasetItemsTable.tsx
@@ -202,7 +202,7 @@ export function DatasetItemsTable({
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" className="h-8 w-8 p-0">
- <span className="sr-only">Open menu</span>
+ <span className="sr-only [position:relative]">Open menu</span>
<MoreVertical className="h-4 w-4" />
</Button>
</DropdownMenuTrigger>
@@ -262,7 +262,7 @@ export function DatasetItemsTable({
);
return (
- <div>
+ <>
<DataTableToolbar
columns={columns}
columnVisibility={columnVisibility}
@@ -301,6 +301,6 @@ export function DatasetItemsTable({
onColumnVisibilityChange={setColumnVisibility}
rowHeight={rowHeight}
/>
- </div>
+ </>
);
}
diff --git a/web/src/features/datasets/components/DatasetRunItemsTable.tsx b/web/src/features/datasets/components/DatasetRunItemsTable.tsx
index 74bc90bc6f..729ef47db0 100644
--- a/web/src/features/datasets/components/DatasetRunItemsTable.tsx
+++ b/web/src/features/datasets/components/DatasetRunItemsTable.tsx
@@ -230,7 +230,7 @@ export function DatasetRunItemsTable(
);
return (
- <div>
+ <>
<DataTableToolbar
columns={columns}
columnVisibility={columnVisibility}
@@ -266,7 +266,7 @@ export function DatasetRunItemsTable(
onColumnVisibilityChange={setColumnVisibility}
rowHeight={rowHeight}
/>
- </div>
+ </>
);
}
diff --git a/web/src/features/datasets/components/DatasetRunsTable.tsx b/web/src/features/datasets/components/DatasetRunsTable.tsx
index f452e70c81..bb3aa0e310 100644
--- a/web/src/features/datasets/components/DatasetRunsTable.tsx
+++ b/web/src/features/datasets/components/DatasetRunsTable.tsx
@@ -167,7 +167,7 @@ export function DatasetRunsTable(props: {
);
return (
- <div>
+ <>
<DataTableToolbar
columns={columns}
columnVisibility={columnVisibility}
@@ -204,6 +204,6 @@ export function DatasetRunsTable(props: {
onColumnVisibilityChange={setColumnVisibility}
rowHeight={rowHeight}
/>
- </div>
+ </>
);
}
diff --git a/web/src/features/datasets/components/DatasetsTable.tsx b/web/src/features/datasets/components/DatasetsTable.tsx
index 7bd3bc7df5..f57ea73d51 100644
--- a/web/src/features/datasets/components/DatasetsTable.tsx
+++ b/web/src/features/datasets/components/DatasetsTable.tsx
@@ -173,7 +173,7 @@ export function DatasetsTable(props: { projectId: string }) {
);
return (
- <div>
+ <>
<DataTableToolbar
columns={columns}
columnVisibility={columnVisibility}
@@ -212,6 +212,6 @@ export function DatasetsTable(props: { projectId: string }) {
onColumnVisibilityChange={setColumnVisibility}
rowHeight={rowHeight}
/>
- </div>
+ </>
);
}
diff --git a/web/src/features/prompts/components/prompt-detail.tsx b/web/src/features/prompts/components/prompt-detail.tsx
index 1e819b0419..e9bb9b3ca2 100644
--- a/web/src/features/prompts/components/prompt-detail.tsx
+++ b/web/src/features/prompts/components/prompt-detail.tsx
@@ -228,12 +228,14 @@ export const PromptDetail = () => {
Generations using this prompt version
</AccordionTrigger>
<AccordionContent>
- <Generations
- projectId={prompt.projectId}
- promptName={prompt.name}
- promptVersion={prompt.version}
- omittedFilter={["Prompt Name", "Prompt Version"]}
- />
+ <div className="flex max-h-[calc(100vh-20rem)] flex-col">
+ <Generations
+ projectId={prompt.projectId}
+ promptName={prompt.name}
+ promptVersion={prompt.version}
+ omittedFilter={["Prompt Name", "Prompt Version"]}
+ />
+ </div>
</AccordionContent>
</AccordionItem>
</Accordion>
diff --git a/web/src/pages/project/[projectId]/datasets.tsx b/web/src/pages/project/[projectId]/datasets.tsx
index b84e2fdc67..9fa9cec276 100644
--- a/web/src/pages/project/[projectId]/datasets.tsx
+++ b/web/src/pages/project/[projectId]/datasets.tsx
@@ -7,7 +7,7 @@ export default function Traces() {
const projectId = router.query.projectId as string;
return (
- <div>
+ <div className="flex h-[calc(100vh-6rem)] flex-col overflow-hidden md:h-[calc(100vh-2rem)]">
<Header
title="Datasets"
help={{
diff --git a/web/src/pages/project/[projectId]/datasets/[datasetId]/index.tsx b/web/src/pages/project/[projectId]/datasets/[datasetId]/index.tsx
index 5ed27687bc..038c0b8a29 100644
--- a/web/src/pages/project/[projectId]/datasets/[datasetId]/index.tsx
+++ b/web/src/pages/project/[projectId]/datasets/[datasetId]/index.tsx
@@ -21,7 +21,7 @@ export default function Dataset() {
});
return (
- <div>
+ <div className="flex h-[calc(100vh-6rem)] flex-col overflow-hidden lg:h-[calc(100vh-2rem)]">
<Header
title={dataset.data?.name ?? ""}
breadcrumb={[
diff --git a/web/src/pages/project/[projectId]/datasets/[datasetId]/items.tsx b/web/src/pages/project/[projectId]/datasets/[datasetId]/items.tsx
index 6f3ded1afe..01140cbc52 100644
--- a/web/src/pages/project/[projectId]/datasets/[datasetId]/items.tsx
+++ b/web/src/pages/project/[projectId]/datasets/[datasetId]/items.tsx
@@ -22,7 +22,7 @@ export default function DatasetItems() {
});
return (
- <div>
+ <div className="flex h-[calc(100vh-6rem)] flex-col overflow-hidden lg:h-[calc(100vh-2rem)]">
<Header
title={dataset.data?.name ?? ""}
help={
diff --git a/web/src/pages/project/[projectId]/datasets/[datasetId]/items/[itemId].tsx b/web/src/pages/project/[projectId]/datasets/[datasetId]/items/[itemId].tsx
index ed186e4df1..fe4de6402f 100644
--- a/web/src/pages/project/[projectId]/datasets/[datasetId]/items/[itemId].tsx
+++ b/web/src/pages/project/[projectId]/datasets/[datasetId]/items/[itemId].tsx
@@ -30,7 +30,7 @@ export default function Dataset() {
);
return (
- <div>
+ <div className="flex h-[calc(100vh-6rem)] flex-col overflow-hidden lg:h-[calc(100vh-2rem)]">
<Header
title={`Dataset Item`}
breadcrumb={[
diff --git a/web/src/pages/project/[projectId]/datasets/[datasetId]/runs/[runId].tsx b/web/src/pages/project/[projectId]/datasets/[datasetId]/runs/[runId].tsx
index 5935fb40cd..2f0ac03e5a 100644
--- a/web/src/pages/project/[projectId]/datasets/[datasetId]/runs/[runId].tsx
+++ b/web/src/pages/project/[projectId]/datasets/[datasetId]/runs/[runId].tsx
@@ -22,7 +22,7 @@ export default function Dataset() {
});
return (
- <div>
+ <div className="flex h-[calc(100vh-6rem)] flex-col overflow-hidden lg:h-[calc(100vh-2rem)]">
<Header
title={`Dataset Run`}
breadcrumb={[
diff --git a/web/src/pages/project/[projectId]/evals/log.tsx b/web/src/pages/project/[projectId]/evals/log.tsx
index f7d215a440..3e23ba866e 100644
--- a/web/src/pages/project/[projectId]/evals/log.tsx
+++ b/web/src/pages/project/[projectId]/evals/log.tsx
@@ -12,7 +12,7 @@ export default function TemplatesPage() {
const projectId = router.query.projectId as string;
return (
- <div>
+ <div className="h-[calc(100vh-6rem)] overflow-hidden lg:h-[calc(100vh-2rem)]">
<Header
title="Eval Log"
help={{
diff --git a/web/src/pages/project/[projectId]/generations.tsx b/web/src/pages/project/[projectId]/generations.tsx
index 2b79fb734f..cdca8d1144 100644
--- a/web/src/pages/project/[projectId]/generations.tsx
+++ b/web/src/pages/project/[projectId]/generations.tsx
@@ -7,7 +7,7 @@ export default function Generations() {
const projectId = router.query.projectId as string;
return (
- <div>
+ <div className="flex h-[calc(100vh-6rem)] flex-col overflow-hidden md:h-[calc(100vh-2rem)]">
<Header
title="Generations"
help={{
diff --git a/web/src/pages/project/[projectId]/models.tsx b/web/src/pages/project/[projectId]/models.tsx
index 3adb10341b..23c65dd1f4 100644
--- a/web/src/pages/project/[projectId]/models.tsx
+++ b/web/src/pages/project/[projectId]/models.tsx
@@ -14,7 +14,7 @@ export default function ModelsPage() {
const hasWriteAccess = useHasAccess({ projectId, scope: "models:CUD" });
const capture = usePostHogClientCapture();
return (
- <div>
+ <div className="flex h-[calc(100vh-6rem)] flex-col overflow-hidden lg:h-[calc(100vh-2rem)]">
<Header
title="Models"
help={{
diff --git a/web/src/pages/project/[projectId]/prompts/[promptName]/metrics.tsx b/web/src/pages/project/[projectId]/prompts/[promptName]/metrics.tsx
index e91132b77d..a6be6ae97a 100644
--- a/web/src/pages/project/[projectId]/prompts/[promptName]/metrics.tsx
+++ b/web/src/pages/project/[projectId]/prompts/[promptName]/metrics.tsx
@@ -357,83 +357,79 @@ export default function PromptVersionTable() {
: [];
return (
- <div className="flex flex-col xl:container md:h-[calc(100vh-2rem)]">
- <div className="grid grid-cols-3 gap-4">
- <div className="col-span-3">
- <Header
- title={promptName}
- help={{
- description:
- "You can use this prompt within your application through the Langfuse SDKs and integrations. Refer to the documentation for more information.",
- href: "https://langfuse.com/docs/prompts",
- }}
- breadcrumb={[
- {
- name: "Prompts",
- href: `/project/${projectId}/prompts/`,
- },
- {
- name: promptName ?? router.query.promptName,
- href: `/project/${projectId}/prompts/${encodeURIComponent(promptName)}`,
- },
- { name: `Metrics` },
- ]}
- actionButtons={
- <>
- <Tabs value="metrics">
- <TabsList>
- <TabsTrigger value="editor" asChild>
- <Link
- href={`/project/${projectId}/prompts/${encodeURIComponent(promptName)}`}
- >
- Editor
- </Link>
- </TabsTrigger>
- <TabsTrigger value="metrics">Metrics</TabsTrigger>
- </TabsList>
- </Tabs>
- </>
- }
- />
- <div className="gap-3 p-2">
- <DataTableToolbar
- columns={columns}
- rowHeight={rowHeight}
- setRowHeight={setRowHeight}
- columnVisibility={columnVisibility}
- setColumnVisibility={setColumnVisibilityState}
- />
- </div>
- <DataTable
- columns={columns}
- data={
- promptVersions.isLoading
- ? { isLoading: true, isError: false }
- : promptVersions.error
- ? {
- isLoading: false,
- isError: true,
- error: promptVersions.error.message,
- }
- : {
- isLoading: false,
- isError: false,
- data: rows,
- }
- }
- pagination={{
- pageCount: Math.ceil(totalCount / paginationState.pageSize),
- onChange: setPaginationState,
- state: paginationState,
- }}
- setOrderBy={setOrderByState}
- orderBy={orderByState}
- columnVisibility={columnVisibility}
- onColumnVisibilityChange={setColumnVisibilityState}
- rowHeight={rowHeight}
- />
- </div>
+ <div className="flex h-[calc(100vh-6rem)] flex-col overflow-hidden xl:container lg:h-[calc(100vh-2rem)]">
+ <Header
+ title={promptName}
+ help={{
+ description:
+ "You can use this prompt within your application through the Langfuse SDKs and integrations. Refer to the documentation for more information.",
+ href: "https://langfuse.com/docs/prompts",
+ }}
+ breadcrumb={[
+ {
+ name: "Prompts",
+ href: `/project/${projectId}/prompts/`,
+ },
+ {
+ name: promptName ?? router.query.promptName,
+ href: `/project/${projectId}/prompts/${encodeURIComponent(promptName)}`,
+ },
+ { name: `Metrics` },
+ ]}
+ actionButtons={
+ <>
+ <Tabs value="metrics">
+ <TabsList>
+ <TabsTrigger value="editor" asChild>
+ <Link
+ href={`/project/${projectId}/prompts/${encodeURIComponent(promptName)}`}
+ >
+ Editor
+ </Link>
+ </TabsTrigger>
+ <TabsTrigger value="metrics">Metrics</TabsTrigger>
+ </TabsList>
+ </Tabs>
+ </>
+ }
+ />
+ <div className="gap-3">
+ <DataTableToolbar
+ columns={columns}
+ rowHeight={rowHeight}
+ setRowHeight={setRowHeight}
+ columnVisibility={columnVisibility}
+ setColumnVisibility={setColumnVisibilityState}
+ />
</div>
+ <DataTable
+ columns={columns}
+ data={
+ promptVersions.isLoading
+ ? { isLoading: true, isError: false }
+ : promptVersions.error
+ ? {
+ isLoading: false,
+ isError: true,
+ error: promptVersions.error.message,
+ }
+ : {
+ isLoading: false,
+ isError: false,
+ data: rows,
+ }
+ }
+ pagination={{
+ pageCount: Math.ceil(totalCount / paginationState.pageSize),
+ onChange: setPaginationState,
+ state: paginationState,
+ }}
+ setOrderBy={setOrderByState}
+ orderBy={orderByState}
+ columnVisibility={columnVisibility}
+ onColumnVisibilityChange={setColumnVisibilityState}
+ rowHeight={rowHeight}
+ />
</div>
);
}
diff --git a/web/src/pages/project/[projectId]/scores.tsx b/web/src/pages/project/[projectId]/scores.tsx
index c2393d0d11..ea3f42ffd5 100644
--- a/web/src/pages/project/[projectId]/scores.tsx
+++ b/web/src/pages/project/[projectId]/scores.tsx
@@ -8,7 +8,7 @@ export default function ScoresPage() {
const projectId = router.query.projectId as string;
return (
- <div>
+ <div className="flex h-[calc(100vh-6rem)] flex-col overflow-hidden lg:h-[calc(100vh-2rem)]">
<Header
title="Scores"
help={{
diff --git a/web/src/pages/project/[projectId]/sessions.tsx b/web/src/pages/project/[projectId]/sessions.tsx
index 4eddbb3397..d6e6a827c8 100644
--- a/web/src/pages/project/[projectId]/sessions.tsx
+++ b/web/src/pages/project/[projectId]/sessions.tsx
@@ -7,7 +7,7 @@ export default function Sessions() {
const projectId = router.query.projectId as string;
return (
- <div>
+ <div className="flex h-[calc(100vh-6rem)] flex-col overflow-hidden lg:h-[calc(100vh-2rem)]">
<Header
title="Sessions"
help={{
diff --git a/web/src/pages/project/[projectId]/traces.tsx b/web/src/pages/project/[projectId]/traces.tsx
index 089d8949dc..8611a56fd4 100644
--- a/web/src/pages/project/[projectId]/traces.tsx
+++ b/web/src/pages/project/[projectId]/traces.tsx
@@ -7,7 +7,7 @@ export default function Traces() {
const projectId = router.query.projectId as string;
return (
- <div>
+ <div className="flex h-[calc(100vh-6rem)] flex-col overflow-hidden lg:h-[calc(100vh-2rem)]">
<Header
title="Traces"
help={{
diff --git a/web/src/pages/project/[projectId]/users.tsx b/web/src/pages/project/[projectId]/users.tsx
index 01e0428842..8c95b41dcd 100644
--- a/web/src/pages/project/[projectId]/users.tsx
+++ b/web/src/pages/project/[projectId]/users.tsx
@@ -202,7 +202,7 @@ export default function UsersPage() {
];
return (
- <div>
+ <div className="flex h-[calc(100vh-6rem)] flex-col overflow-hidden lg:h-[calc(100vh-2rem)]">
<Header
title="Users"
help={{