Skip to content

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

feat(ui): add new langfuse header (#5451)

marliessophie56e4b92fd76b
diff --git a/web/src/components/ItemBadge.tsx b/web/src/components/ItemBadge.tsx
new file mode 100644
index 0000000000..1ec230602b
--- /dev/null
+++ b/web/src/components/ItemBadge.tsx
@@ -0,0 +1,99 @@
+import { Badge } from "@/src/components/ui/badge";
+import {
+ CircleDot,
+ ClipboardPen,
+ Database,
+ Fan,
+ ListTree,
+ MoveHorizontal,
+ User,
+ FileText,
+ FlaskConical,
+ ListTodo,
+ WandSparkles,
+ Cog,
+ TestTubeDiagonal,
+ Clock,
+} from "lucide-react";
+import { cva } from "class-variance-authority";
+import { ObservationType } from "@langfuse/shared";
+import { cn } from "@/src/utils/tailwind";
+
+export type LangfuseItemType =
+ | ObservationType
+ | "TRACE"
+ | "SESSION"
+ | "USER"
+ | "QUEUE_ITEM"
+ | "DATASET"
+ | "DATASET_RUN"
+ | "DATASET_ITEM"
+ | "ANNOTATION_QUEUE"
+ | "PROMPT"
+ | "EVALUATOR"
+ | "EVAL_TEMPLATE";
+
+const iconMap: Record<LangfuseItemType, React.ElementType> = {
+ TRACE: ListTree,
+ [ObservationType.GENERATION]: Fan,
+ [ObservationType.EVENT]: CircleDot,
+ [ObservationType.SPAN]: MoveHorizontal,
+ SESSION: Clock,
+ USER: User,
+ QUEUE_ITEM: ClipboardPen,
+ DATASET: Database,
+ DATASET_RUN: FlaskConical,
+ DATASET_ITEM: TestTubeDiagonal,
+ ANNOTATION_QUEUE: ListTodo,
+ PROMPT: FileText,
+ EVALUATOR: WandSparkles,
+ EVAL_TEMPLATE: Cog,
+} as const;
+
+const iconVariants = cva(cn("h-4 w-4"), {
+ variants: {
+ type: {
+ TRACE: "text-dark-green",
+ [ObservationType.GENERATION]: "text-muted-magenta",
+ [ObservationType.EVENT]: "text-muted-green",
+ [ObservationType.SPAN]: "text-muted-blue",
+ SESSION: "text-primary-accent",
+ USER: "text-primary-accent",
+ QUEUE_ITEM: "text-primary-accent",
+ DATASET: "text-primary-accent",
+ DATASET_RUN: "text-primary-accent",
+ DATASET_ITEM: "text-primary-accent",
+ ANNOTATION_QUEUE: "text-primary-accent",
+ PROMPT: "text-primary-accent",
+ EVALUATOR: "text-primary-accent",
+ EVAL_TEMPLATE: "text-primary-accent",
+ },
+ },
+});
+
+export function ItemBadge({
+ type,
+ showLabel = false,
+ isSmall = false,
+}: {
+ type: LangfuseItemType;
+ showLabel?: boolean;
+ isSmall?: boolean;
+}) {
+ const Icon = iconMap[type] || ListTree; // Default to ListTree if unknown type
+ const iconClass = cn(iconVariants({ type }), isSmall ? "h-3 w-3" : "h-4 w-4");
+ const label = type.charAt(0).toUpperCase() + type.slice(1).toLowerCase();
+
+ return (
+ <Badge
+ variant="outline"
+ className={cn(
+ "flex max-w-fit items-center gap-1 bg-background",
+ isSmall && "h-4",
+ )}
+ >
+ <Icon className={iconClass} />
+ {showLabel && <span>{label.replace(/_/g, " ")}</span>}
+ </Badge>
+ );
+}
diff --git a/web/src/components/SettingsDangerZone.tsx b/web/src/components/SettingsDangerZone.tsx
index 2acf81c1b8..b10baa4c07 100644
--- a/web/src/components/SettingsDangerZone.tsx
+++ b/web/src/components/SettingsDangerZone.tsx
@@ -10,7 +10,7 @@ export const SettingsDangerZone: React.FC<{
}> = ({ items }) => {
return (
<div className="space-y-3">
- <Header title="Danger Zone" level="h3" />
+ <Header title="Danger Zone" />
<div className="rounded-lg border">
{items.map((item, index) => (
<div
diff --git a/web/src/components/layouts/README.md b/web/src/components/layouts/README.md
new file mode 100644
index 0000000000..aa2aedd16c
--- /dev/null
+++ b/web/src/components/layouts/README.md
@@ -0,0 +1,45 @@
+# 📦 Langfuse Layout Components
+
+## 📌 Overview: Page - Standard Page Wrapper
+
+`Page` is the required wrapper for all pages in our app. It ensures a **consistent layout**, a **sticky header**, and proper **scroll behavior** across different screens.
+For any Langfuse single item pages, you should pass the itemType to the `Page` as a prop. Also, ideally the title should follow the format of `{itemName}: {itemId}`. If only either is reasonable, just pass it as the title. For tables, you should not pass the itemType, unless the table is part of a single item page.
+
+**⚠️ Every page must be wrapped inside `<Page>`—do not use `<main>` directly!**
+
+Please note that whenever content will not scale nicely to the width of the page, you should use the `ContainerPage` component instead, for example when in settings pages or set up pages.
+
+---
+
+## ✨ Features
+
+✅ **Encapsulated Sticky Header** → Prevents inconsistent layouts
+✅ **Manages Scrolling** → Supports both `"content-scroll"` and `"page-scroll"`
+✅ **Standardized Padding & Layout** → Avoids manual style fixes
+✅ **Breadcrumb Support** → Enables easy navigation
+✅ **Custom Header Actions** → Pass buttons, links, or other elements
+
+---
+
+## 🚀 Usage
+
+### **Basic Example**
+
+```tsx
+import Page from "@/src/components/layouts/Page";
+
+export default function MyPage() {
+ return (
+ <Page
+ title="My Page"
+ scrollable
+ headerProps={{
+ breadcrumb: [{ name: "Home", href: "/" }, { name: "My Page" }],
+ actionButtons: <button className="btn-primary">Save</button>,
+ }}
+ >
+ <div>My page content here...</div>
+ </Page>
+ );
+}
+```
diff --git a/web/src/components/layouts/breadcrumb.tsx b/web/src/components/layouts/breadcrumb.tsx
new file mode 100644
index 0000000000..8e50b2d888
--- /dev/null
+++ b/web/src/components/layouts/breadcrumb.tsx
@@ -0,0 +1,306 @@
+import {
+ Breadcrumb,
+ BreadcrumbItem,
+ BreadcrumbLink,
+ BreadcrumbList,
+ BreadcrumbSeparator,
+} from "@/src/components/ui/breadcrumb";
+import { Fragment } from "react";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuSeparator,
+ DropdownMenuTrigger,
+} from "@/src/components/ui/dropdown-menu";
+import {
+ ChevronDownIcon,
+ LoaderCircle,
+ PlusIcon,
+ Settings,
+ Slash,
+} from "lucide-react";
+import { Button } from "@/src/components/ui/button";
+import { env } from "@/src/env.mjs";
+import { useQueryProjectOrOrganization } from "@/src/features/projects/hooks";
+import { useRouter } from "next/router";
+import { useSession } from "next-auth/react";
+import { useHasOrganizationAccess } from "@/src/features/rbac/utils/checkOrganizationAccess";
+import {
+ createOrganizationRoute,
+ createProjectRoute,
+} from "@/src/features/setup/setupRoutes";
+import { isCloudPlan, planLabels } from "@langfuse/shared";
+import Link from "next/link";
+import { Badge } from "@/src/components/ui/badge";
+
+const LoadingMenuItem = () => (
+ <DropdownMenuItem>
+ <LoaderCircle className="mr-1.5 h-4 w-4 animate-spin" /> Loading...
+ </DropdownMenuItem>
+);
+
+const BreadcrumbComponent = ({
+ items,
+ className,
+}: {
+ items?: { name: string; href?: string }[];
+ className?: string;
+}) => {
+ const router = useRouter();
+ const session = useSession();
+ const { organization, project } = useQueryProjectOrOrganization();
+
+ const organizations = session.data?.user?.organizations;
+
+ const canCreateOrganizations = session.data?.user?.canCreateOrganizations;
+ const canCreateProjects = useHasOrganizationAccess({
+ organizationId: organization?.id,
+ scope: "projects:create",
+ });
+
+ /**
+ * Truncate the path before the first dynamic segment that is not allowlisted.
+ * e.g. /project/[projectId]/traces/[traceId] -> /project/[projectId]/traces
+ */
+ const truncatePathBeforeDynamicSegments = (path: string) => {
+ const allowlistedIds = ["[projectId]", "[organizationId]", "[page]"];
+ const segments = router.route.split("/");
+ const idSegments = segments.filter(
+ (segment) => segment.startsWith("[") && segment.endsWith("]"),
+ );
+ const stopSegment = idSegments.filter((id) => !allowlistedIds.includes(id));
+ if (stopSegment.length === 0) return path;
+ const stopIndex = segments.indexOf(stopSegment[0]);
+ const truncatedPath = path.split("/").slice(0, stopIndex).join("/");
+ return truncatedPath;
+ };
+
+ const getProjectPath = (projectId: string) =>
+ router.query.projectId
+ ? truncatePathBeforeDynamicSegments(router.asPath).replace(
+ router.query.projectId as string,
+ projectId,
+ )
+ : `/project/${projectId}`;
+
+ const getOrgPath = (orgId: string) =>
+ router.query.organizationId
+ ? truncatePathBeforeDynamicSegments(router.asPath).replace(
+ router.query.organizationId as string,
+ orgId,
+ )
+ : `/organization/${orgId}`;
+
+ return (
+ <Breadcrumb className={className}>
+ <BreadcrumbList>
+ {organization && (
+ <DropdownMenu>
+ <DropdownMenuTrigger className="flex items-center gap-1 text-sm text-primary">
+ {organization?.name ?? "Organization"}
+ {isCloudPlan(organization?.plan) &&
+ organization.id !== env.NEXT_PUBLIC_DEMO_ORG_ID && (
+ <Badge
+ className="ml-1 px-1 py-0 text-xs font-normal"
+ variant="secondary"
+ >
+ {planLabels[organization.plan]}
+ </Badge>
+ )}
+ <ChevronDownIcon className="h-4 w-4" />
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="start">
+ <DropdownMenuItem className="font-semibold" asChild>
+ <Link href="/" className="cursor-pointer">
+ Organizations
+ </Link>
+ </DropdownMenuItem>
+ <DropdownMenuSeparator />
+ <div className="max-h-36 overflow-y-auto">
+ {organizations ? (
+ organizations
+ .sort((a, b) => {
+ // sort demo org to the bottom
+ const isDemoA = env.NEXT_PUBLIC_DEMO_ORG_ID === a.id;
+ const isDemoB = env.NEXT_PUBLIC_DEMO_ORG_ID === b.id;
+ if (isDemoA) return 1;
+ if (isDemoB) return -1;
+ return 0;
+ })
+ .map((dropdownOrg) => (
+ <Fragment key={dropdownOrg.id}>
+ {env.NEXT_PUBLIC_DEMO_ORG_ID === dropdownOrg.id && (
+ <DropdownMenuSeparator />
+ )}
+ <DropdownMenuItem asChild>
+ <Link
+ href={getOrgPath(dropdownOrg.id)}
+ className="flex cursor-pointer justify-between"
+ >
+ <span
+ className="max-w-36 overflow-hidden overflow-ellipsis whitespace-nowrap"
+ title={dropdownOrg.name}
+ >
+ {dropdownOrg.name}
+ </span>
+ <Button
+ asChild
+ variant="ghost"
+ size="xs"
+ className="-my-1 ml-4 hover:bg-background"
+ >
+ <div
+ onClick={(e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ router.push(
+ `/organization/${dropdownOrg.id}/settings`,
+ );
+ }}
+ >
+ <Settings size={12} />
+ </div>
+ </Button>
+ </Link>
+ </DropdownMenuItem>
+ </Fragment>
+ ))
+ ) : (
+ <LoadingMenuItem />
+ )}
+ </div>
+
+ {canCreateOrganizations && (
+ <>
+ <DropdownMenuSeparator />
+ <DropdownMenuItem asChild>
+ <Button
+ variant="ghost"
+ size="xs"
+ className="h-8 w-full text-sm font-normal"
+ asChild
+ >
+ <Link href={createOrganizationRoute}>
+ <PlusIcon
+ className="mr-1.5 h-4 w-4"
+ aria-hidden="true"
+ />
+ New Organization
+ </Link>
+ </Button>
+ </DropdownMenuItem>
+ </>
+ )}
+ </DropdownMenuContent>
+ </DropdownMenu>
+ )}
+ {organization && project && (
+ <>
+ <BreadcrumbSeparator>
+ <Slash />
+ </BreadcrumbSeparator>
+ <DropdownMenu>
+ <DropdownMenuTrigger className="flex items-center gap-1 text-primary">
+ {project?.name ?? "Project"}
+ <ChevronDownIcon className="h-4 w-4" />
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="start">
+ <DropdownMenuItem asChild className="font-semibold">
+ <Link
+ href={`/organization/${organization.id}`}
+ className="cursor-pointer"
+ >
+ Projects
+ </Link>
+ </DropdownMenuItem>
+ <DropdownMenuSeparator />
+ <div className="max-h-36 overflow-y-auto">
+ {organizations ? (
+ organizations
+ .find((org) => org.id === organization.id)
+ ?.projects.map((dropdownProject) => (
+ <DropdownMenuItem key={dropdownProject.id} asChild>
+ <Link
+ href={getProjectPath(dropdownProject.id)}
+ className="flex cursor-pointer justify-between"
+ >
+ <span
+ className="max-w-36 overflow-hidden overflow-ellipsis whitespace-nowrap"
+ title={dropdownProject.name}
+ >
+ {dropdownProject.name}
+ </span>
+ <Button
+ asChild
+ variant="ghost"
+ size="xs"
+ className="-my-1 ml-4 hover:bg-background"
+ >
+ <div
+ onClick={(e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ router.push(
+ `/project/${dropdownProject.id}/settings`,
+ );
+ }}
+ >
+ <Settings size={12} />
+ </div>
+ </Button>
+ </Link>
+ </DropdownMenuItem>
+ ))
+ ) : (
+ <LoadingMenuItem />
+ )}
+ </div>
+
+ {canCreateProjects && (
+ <>
+ <DropdownMenuSeparator />
+ <DropdownMenuItem asChild>
+ <Button
+ variant="ghost"
+ size="xs"
+ className="h-8 w-full text-sm font-normal"
+ asChild
+ >
+ <Link href={createProjectRoute(organization.id)}>
+ <PlusIcon
+ className="mr-1.5 h-4 w-4"
+ aria-hidden="true"
+ />
+ New Project
+ </Link>
+ </Button>
+ </DropdownMenuItem>
+ </>
+ )}
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </>
+ )}
+ {items?.map((item, index) => (
+ <Fragment key={index}>
+ <BreadcrumbSeparator>
+ <Slash />
+ </BreadcrumbSeparator>
+ <BreadcrumbItem key={index}>
+ {item.href ? (
+ <BreadcrumbLink asChild>
+ <Link href={item.href}>{item.name}</Link>
+ </BreadcrumbLink>
+ ) : (
+ <span>{item.name}</span>
+ )}
+ </BreadcrumbItem>
+ </Fragment>
+ ))}
+ </BreadcrumbList>
+ </Breadcrumb>
+ );
+};
+
+export default BreadcrumbComponent;
diff --git a/web/src/components/layouts/container-page.tsx b/web/src/components/layouts/container-page.tsx
new file mode 100644
index 0000000000..a8038dc984
--- /dev/null
+++ b/web/src/components/layouts/container-page.tsx
@@ -0,0 +1,24 @@
+import PageHeader, {
+ type PageHeaderProps,
+} from "@/src/components/layouts/page-header";
+import { cn } from "@/src/utils/tailwind";
+
+type SettingsContainerProps = {
+ children: React.ReactNode;
+ headerProps: Omit<PageHeaderProps, "container">;
+};
+
+const ContainerPage = ({ children, headerProps }: SettingsContainerProps) => {
+ return (
+ <div className={cn("h-full")}>
+ <header className="sticky top-0 z-50 w-full">
+ <PageHeader {...headerProps} container />
+ </header>
+ <main className="relative mt-3 flex min-h-svh flex-1 flex-col lg:container">
+ {children}
+ </main>
+ </div>
+ );
+};
+
+export default ContainerPage;
diff --git a/web/src/components/layouts/full-screen-page.tsx b/web/src/components/layouts/full-screen-page.tsx
deleted file mode 100644
index d802db27d4..0000000000
--- a/web/src/components/layouts/full-screen-page.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { cn } from "@/src/utils/tailwind";
-
-export const FullScreenPage: React.FC<React.PropsWithChildren<{}>> = ({
- children,
-}) => {
- return (
- <div className={cn("flex h-full flex-col overflow-hidden")}>{children}</div>
- );
-};
diff --git a/web/src/components/layouts/header.tsx b/web/src/components/layouts/header.tsx
index 0d4ba6992f..ac01f3110b 100644
--- a/web/src/components/layouts/header.tsx
+++ b/web/src/components/layouts/header.tsx
@@ -2,94 +2,28 @@ import Link from "next/link";
import DocPopup from "@/src/components/layouts/doc-popup";
import { type Status, StatusBadge } from "./status-badge";
import { cn } from "@/src/utils/tailwind";
-import { Badge } from "@/src/components/ui/badge";
-import {
- Breadcrumb,
- BreadcrumbItem,
- BreadcrumbLink,
- BreadcrumbList,
- BreadcrumbSeparator,
-} from "@/src/components/ui/breadcrumb";
-import { Fragment } from "react";
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuSeparator,
- DropdownMenuTrigger,
-} from "@/src/components/ui/dropdown-menu";
-import {
- ChevronDownIcon,
- LoaderCircle,
- PlusIcon,
- Settings,
- Slash,
-} from "lucide-react";
-import { Button } from "@/src/components/ui/button";
-import { env } from "@/src/env.mjs";
-import { useQueryProjectOrOrganization } from "@/src/features/projects/hooks";
-import { useRouter } from "next/router";
-import { useSession } from "next-auth/react";
-import { useHasOrganizationAccess } from "@/src/features/rbac/utils/checkOrganizationAccess";
-import {
- createOrganizationRoute,
- createProjectRoute,
-} from "@/src/features/setup/setupRoutes";
-import { isCloudPlan, planLabels } from "@langfuse/shared";
-import { SidebarTrigger } from "@/src/components/ui/sidebar";
-import { EnvLabel } from "@/src/components/EnvLabel";
export default function Header({
- level = "h2",
...props
}: {
title: string;
- breadcrumb?: { name: string; href?: string }[];
status?: Status;
label?: {
text: string;
href: string;
};
help?: { description: string; href?: string; className?: string };
- featureBetaURL?: string;
actionButtons?: React.ReactNode;
- level?: "h2" | "h3";
className?: string;
}) {
return (
- <div
- className={cn(
- level === "h2"
- ? "sticky top-0 z-20 mb-2 border-b bg-background p-3"
- : "mb-2",
- props.className,
- )}
- >
- {level === "h2" && (
- <div className="flex items-center">
- <SidebarTrigger />
- <div className="ml-3">
- <EnvLabel />
- </div>
- <BreadcrumbComponent
- items={props.breadcrumb}
- className="ml-3 border-l pl-3"
- />
- </div>
- )}
-
+ <div className={cn("mb-2", props.className)}>
<div className="mt-2 flex flex-wrap items-center justify-between gap-2">
<div className="flex items-center gap-3 md:gap-5">
<div className="flex min-w-0 flex-row justify-center align-middle">
- {level === "h2" ? (
- <h2 className="text-3xl font-bold leading-7 sm:tracking-tight">
- {props.title}
- </h2>
- ) : (
- <h3 className="text-xl font-bold leading-7 sm:tracking-tight">
- {props.title}
- </h3>
- )}
+ <h3 className="text-xl font-bold leading-7 sm:tracking-tight">
+ {props.title}
+ </h3>
{props.help ? (
<DocPopup
description={props.help.description}
@@ -97,21 +31,6 @@ export default function Header({
className={props.help.className}
/>
) : null}
- {props.featureBetaURL ? (
- <Link
- href={props.featureBetaURL}
- rel="noopener noreferrer"
- target="_blank"
- className="flex items-center"
- >
- <Badge
- title="Feature is currently in beta. Click to learn more."
- className="ml-2"
- >
- Beta
- </Badge>
- </Link>
- ) : null}
</div>
{props.status && <StatusBadge type={props.status} />}
{props.label && (
@@ -127,272 +46,3 @@ export default function Header({
</div>
);
}
-
-const LoadingMenuItem = () => (
- <DropdownMenuItem>
- <LoaderCircle className="mr-1.5 h-4 w-4 animate-spin" /> Loading...
- </DropdownMenuItem>
-);
-
-const BreadcrumbComponent = ({
- items,
- className,
-}: {
- items?: { name: string; href?: string }[];
- className?: string;
-}) => {
- const router = useRouter();
- const session = useSession();
- const { organization, project } = useQueryProjectOrOrganization();
-
- const organizations = session.data?.user?.organizations;
-
- const canCreateOrganizations = session.data?.user?.canCreateOrganizations;
- const canCreateProjects = useHasOrganizationAccess({
- organizationId: organization?.id,
- scope: "projects:create",
- });
-
- /**
- * Truncate the path before the first dynamic segment that is not allowlisted.
- * e.g. /project/[projectId]/traces/[traceId] -> /project/[projectId]/traces
- */
- const truncatePathBeforeDynamicSegments = (path: string) => {
- const allowlistedIds = ["[projectId]", "[organizationId]", "[page]"];
- const segments = router.route.split("/");
- const idSegments = segments.filter(
- (segment) => segment.startsWith("[") && segment.endsWith("]"),
- );
- const stopSegment = idSegments.filter((id) => !allowlistedIds.includes(id));
- if (stopSegment.length === 0) return path;
- const stopIndex = segments.indexOf(stopSegment[0]);
- const truncatedPath = path.split("/").slice(0, stopIndex).join("/");
- return truncatedPath;
- };
-
- const getProjectPath = (projectId: string) =>
- router.query.projectId
- ? truncatePathBeforeDynamicSegments(router.asPath).replace(
- router.query.projectId as string,
- projectId,
- )
- : `/project/${projectId}`;
-
- const getOrgPath = (orgId: string) =>
- router.query.organizationId
- ? truncatePathBeforeDynamicSegments(router.asPath).replace(
- router.query.organizationId as string,
- orgId,
- )
- : `/organization/${orgId}`;
-
- return (
- <Breadcrumb className={className}>
- <BreadcrumbList>
- {organization && (
- <DropdownMenu>
- <DropdownMenuTrigger className="flex items-center gap-1 text-sm text-primary">
- {organization?.name ?? "Organization"}
- {isCloudPlan(organization?.plan) &&
- organization.id !== env.NEXT_PUBLIC_DEMO_ORG_ID && (
- <Badge
- className="ml-1 px-1 py-0 text-xs font-normal"
- variant="secondary"
- >
- {planLabels[organization.plan]}
- </Badge>
- )}
- <ChevronDownIcon className="h-4 w-4" />
- </DropdownMenuTrigger>
- <DropdownMenuContent align="start">
- <DropdownMenuItem className="font-semibold" asChild>
- <Link href="/" className="cursor-pointer">
- Organizations
- </Link>
- </DropdownMenuItem>
- <DropdownMenuSeparator />
- <div className="max-h-36 overflow-y-auto">
- {organizations ? (
- organizations
- .sort((a, b) => {
- // sort demo org to the bottom
- const isDemoA = env.NEXT_PUBLIC_DEMO_ORG_ID === a.id;
- const isDemoB = env.NEXT_PUBLIC_DEMO_ORG_ID === b.id;
- if (isDemoA) return 1;
- if (isDemoB) return -1;
- return 0;
- })
- .map((dropdownOrg) => (
- <Fragment key={dropdownOrg.id}>
- {env.NEXT_PUBLIC_DEMO_ORG_ID === dropdownOrg.id && (
- <DropdownMenuSeparator />
- )}
- <DropdownMenuItem asChild>
- <Link
- href={getOrgPath(dropdownOrg.id)}
- className="flex cursor-pointer justify-between"
- >
- <span
- className="max-w-36 overflow-hidden overflow-ellipsis whitespace-nowrap"
- title={dropdownOrg.name}
- >
- {dropdownOrg.name}
- </span>
- <Button
- asChild
- variant="ghost"
- size="xs"
- className="-my-1 ml-4 hover:bg-background"
- >
- <div
- onClick={(e) => {
- e.preventDefault();
- e.stopPropagation();
- router.push(
- `/organization/${dropdownOrg.id}/settings`,
- );
- }}
- >
- <Settings size={12} />
- </div>
- </Button>
- </Link>
- </DropdownMenuItem>
- </Fragment>
- ))
- ) : (
- <LoadingMenuItem />
- )}
- </div>
-
- {canCreateOrganizations && (
- <>
- <DropdownMenuSeparator />
- <DropdownMenuItem asChild>
- <Button
- variant="ghost"
- size="xs"
- className="h-8 w-full text-sm font-normal"
- asChild
- >
- <Link href={createOrganizationRoute}>
- <PlusIcon
- className="mr-1.5 h-4 w-4"
- aria-hidden="true"
- />
- New Organization
- </Link>
- </Button>
- </DropdownMenuItem>
- </>
- )}
- </DropdownMenuContent>
- </DropdownMenu>
- )}
- {organization && project && (
- <>
- <BreadcrumbSeparator>
- <Slash />
- </BreadcrumbSeparator>
- <DropdownMenu>
- <DropdownMenuTrigger className="flex items-center gap-1 text-primary">
- {project?.name ?? "Project"}
- <ChevronDownIcon className="h-4 w-4" />
- </DropdownMenuTrigger>
- <DropdownMenuContent align="start">
- <DropdownMenuItem asChild className="font-semibold">
- <Link
- href={`/organization/${organization.id}`}
- className="cursor-pointer"
- >
- Projects
- </Link>
- </DropdownMenuItem>
- <DropdownMenuSeparator />
- <div className="max-h-36 overflow-y-auto">
- {organizations ? (
- organizations
- .find((org) => org.id === organization.id)
- ?.projects.map((dropdownProject) => (
- <DropdownMenuItem key={dropdownProject.id} asChild>
- <Link
- href={getProjectPath(dropdownProject.id)}
- className="flex cursor-pointer justify-between"
- >
- <span
- className="max-w-36 overflow-hidden overflow-ellipsis whitespace-nowrap"
- title={dropdownProject.name}
- >
- {dropdownProject.name}
- </span>
- <Button
- asChild
- variant="ghost"
- size="xs"
- className="-my-1 ml-4 hover:bg-background"
- >
- <div
- onClick={(e) => {
- e.preventDefault();
- e.stopPropagation();
- router.push(
- `/project/${dropdownProject.id}/settings`,
- );
- }}
- >
- <Settings size={12} />
- </div>
- </Button>
- </Link>
- </DropdownMenuItem>
- ))
- ) : (
- <LoadingMenuItem />
- )}
- </div>
-
- {canCreateProjects && (
- <>
- <DropdownMenuSeparator />
- <DropdownMenuItem asChild>
- <Button
- variant="ghost"
- size="xs"
- className="h-8 w-full text-sm font-normal"
- asChild
- >
- <Link href={createProjectRoute(organization.id)}>
- <PlusIcon
- className="mr-1.5 h-4 w-4"
- aria-hidden="true"
- />
- New Project
- </Link>
- </Button>
- </DropdownMenuItem>
- </>
- )}
- </DropdownMenuContent>
- </DropdownMenu>
- </>
- )}
- {items?.map((item, index) => (
- <Fragment key={index}>
- <BreadcrumbSeparator>
- <Slash />
- </BreadcrumbSeparator>
- <BreadcrumbItem key={index}>
- {item.href ? (
- <BreadcrumbLink asChild>
- <Link href={item.href}>{item.name}</Link>
- </BreadcrumbLink>
- ) : (
- <span>{item.name}</span>
- )}
- </BreadcrumbItem>
- </Fragment>
- ))}
- </BreadcrumbList>
- </Breadcrumb>
- );
-};
diff --git a/web/src/components/layouts/layout.tsx b/web/src/components/layouts/layout.tsx
index da43aa30b5..28b616652f 100644
--- a/web/src/components/layouts/layout.tsx
+++ b/web/src/components/layouts/layout.tsx
@@ -313,7 +313,7 @@ export default function Layout(props: PropsWithChildren) {
}}
/>
<SidebarInset className="h-dvh max-w-full md:peer-data-[state=collapsed]:w-[calc(100vw-var(--sidebar-width-icon))] md:peer-data-[state=expanded]:w-[calc(100vw-var(--sidebar-width))]">
- <main className="h-full p-3">{props.children}</main>
+ <main className="h-full">{props.children}</main>
<Toaster visibleToasts={1} />
<CommandMenu mainNavigation={navigation} />
</SidebarInset>
diff --git a/web/src/components/layouts/page-header.tsx b/web/src/components/layouts/page-header.tsx
new file mode 100644
index 0000000000..4021b6d095
--- /dev/null
+++ b/web/src/components/layouts/page-header.tsx
@@ -0,0 +1,80 @@
+import { EnvLabel } from "@/src/components/EnvLabel";
+import { ItemBadge, type LangfuseItemType } from "@/src/components/ItemBadge";
+import BreadcrumbComponent from "@/src/components/layouts/breadcrumb";
+import DocPopup from "@/src/components/layouts/doc-popup";
+import { SidebarTrigger } from "@/src/components/ui/sidebar";
+import { cn } from "@/src/utils/tailwind";
+
+export type PageHeaderProps = {
+ title: string;
+ breadcrumb?: { name: string; href?: string }[];
+ actionButtonsLeft?: React.ReactNode; // Right-side actions (buttons, etc.)
+ actionButtonsRight?: React.ReactNode; // Right-side actions (buttons, etc.)
+ help?: { description: string; href?: string; className?: string };
+ itemType?: LangfuseItemType;
+ container?: boolean;
+};
+
+const PageHeader = ({
+ title,
+ itemType,
+ actionButtonsLeft,
+ actionButtonsRight,
+ breadcrumb,
+ help,
+ container = false,
+}: PageHeaderProps) => {
+ return (
+ <div className="sticky top-0 z-30 w-full border-b bg-background shadow-sm">
+ <div className="flex flex-col justify-center">
+ {/* Top Row */}
+ <div className="border-b">
+ <div
+ className={cn(
+ "flex min-h-12 items-center gap-3 px-3 py-2 md:max-h-12",
+ container && "lg:container",
+ )}
+ >
+ <SidebarTrigger />
+ <div>
+ <EnvLabel />
+ </div>
+ <BreadcrumbComponent items={breadcrumb} />
+ </div>
+ </div>
+
+ {/* Bottom Row */}
+ <div className="bg-muted">
+ <div
+ className={cn(
+ "flex min-h-16 items-center justify-between p-3 md:max-h-16",
+ container && "lg:container",
+ )}
+ >
+ <div className="flex-no-wrap flex min-h-16 items-center gap-1 md:max-h-16">
+ {itemType && <ItemBadge type={itemType} showLabel />}
+ <h2 className="line-clamp-2 h-16 min-w-0 place-content-center text-lg font-semibold leading-7">
+ {title}
+ </h2>
+ {help && (
+ <div className="-ml-1 -mt-2">
+ <DocPopup
+ description={help.description}
+ href={help.href}
+ className={help.className}
+ />
+ </div>
+ )}
+ <div className="flex items-center gap-1">{actionButtonsLeft}</div>
+ </div>
+ <div className="flex flex-row flex-wrap items-center gap-1">
+ {actionButtonsRight}
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+};
+
+export default PageHeader;
diff --git a/web/src/components/layouts/page.tsx b/web/src/components/layouts/page.tsx
new file mode 100644
index 0000000000..b7b36fb4d4
--- /dev/null
+++ b/web/src/components/layouts/page.tsx
@@ -0,0 +1,33 @@
+import PageHeader, {
+ type PageHeaderProps,
+} from "@/src/components/layouts/page-header";
+import { cn } from "@/src/utils/tailwind";
+
+type PageContainerProps = {
+ children: React.ReactNode;
+ headerProps: Omit<PageHeaderProps, "container">;
+ scrollable?: boolean;
+};
+
+const Page = ({
+ children,
+ headerProps,
+ scrollable = false,
+}: PageContainerProps) => {
+ return (
+ <div className={cn("h-full", !scrollable && "flex flex-col")}>
+ <header className="sticky top-0 z-50 w-full">
+ <PageHeader {...headerProps} container={false} />
+ </header>
+ <main
+ className={`flex flex-1 flex-col p-3 ${
+ scrollable ? "relative flex min-h-svh" : "h-full overflow-hidden"
+ }`}
+ >
+ {children}
+ </main>
+ </div>
+ );
+};
+
+export default Page;
diff --git a/web/src/components/layouts/scroll-screen-page.tsx b/web/src/components/layouts/scroll-screen-page.tsx
deleted file mode 100644
index 83cd2f9603..0000000000
--- a/web/src/components/layouts/scroll-screen-page.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import { cn } from "@/src/utils/tailwind";
-
-export const ScrollScreenPage: React.FC<React.PropsWithChildren<{}>> = ({
- children,
-}) => {
- return (
- <div className={cn("relative flex min-h-svh flex-1 flex-col pb-3")}>
- {children}
- </div>
- );
-};
diff --git a/web/src/components/layouts/status-badge.tsx b/web/src/components/layouts/status-badge.tsx
index 197daa0413..f25560bfc7 100644
--- a/web/src/components/layouts/status-badge.tsx
+++ b/web/src/components/layouts/status-badge.tsx
@@ -1,7 +1,7 @@
import { cn } from "@/src/utils/tailwind";
const statusCategories = {
- active: ["production", "live", "active"],
+ active: ["production", "live", "active", "public"],
pending: ["pending", "waiting", "queued"],
inactive: ["disabled", "inactive"],
completed: ["completed", "done", "finished"],
diff --git a/web/src/components/nav/app-sidebar.tsx b/web/src/components/nav/app-sidebar.tsx
index a31f241299..fd453e03b2 100644
--- a/web/src/components/nav/app-sidebar.tsx
+++ b/web/src/components/nav/app-sidebar.tsx
@@ -35,12 +35,14 @@ export function AppSidebar({
}: AppSidebarProps) {
return (
<Sidebar collapsible="icon" variant="sidebar" {...props}>
- <SidebarHeader>
- <div className="flex items-center gap-2 p-2 pr-0">
- <LangfuseLogo version />
- </div>
- <DemoBadge />
- </SidebarHeader>
+ <div className="border-b">
+ <SidebarHeader>
+ <div className="flex items-center gap-2 p-2 pr-0">
+ <LangfuseLogo version />
+ </div>
+ <DemoBadge />
+ </SidebarHeader>
+ </div>
<SidebarContent>
<NavMain items={navItems} />
<div className="flex-1" />
diff --git a/web/src/components/publish-object-switch.tsx b/web/src/components/publish-object-switch.tsx
index 28d0d417c3..1622136e65 100644
--- a/web/src/components/publish-object-switch.tsx
+++ b/web/src/components/publish-object-switch.tsx
@@ -1,8 +1,14 @@
-import { Switch } from "@/src/components/ui/switch";
+import { Button } from "@/src/components/ui/button";
+import { Label } from "@/src/components/ui/label";
+import {
+ Popover,
+ PopoverContent,
+ PopoverTrigger,
+} from "@/src/components/ui/popover";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
import { useHasProjectAccess } from "@/src/features/rbac/utils/checkProjectAccess";
import { api } from "@/src/utils/api";
-import { Link, LockIcon } from "lucide-react";
+import { CheckIcon, Globe, Link, Share2 } from "lucide-react";
import { useState } from "react";
export const PublishTraceSwitch = (props: {
@@ -23,6 +29,7 @@ export const PublishTraceSwitch = (props: {
return (
<Base
id={props.traceId}
+ itemName="trace"
isPublic={props.isPublic}
onChange={(val) => {
mut.mutate({
@@ -56,6 +63,7 @@ export const PublishSessionSwitch = (props: {
return (
<Base
id={props.sessionId}
+ itemName="session"
isPublic={props.isPublic}
onChange={(val) => {
mut.mutate({
@@ -73,6 +81,7 @@ export const PublishSessionSwitch = (props: {
const Base = (props: {
id: string;
+ itemName: string;
onChange: (value: boolean) => void;
isLoading: boolean;
isPublic: boolean;
@@ -83,38 +92,96 @@ const Base = (props: {
const copyUrl = () => {
setIsCopied(true);
void navigator.clipboard.writeText(window.location.href);
- setTimeout(() => setIsCopied(false), 1500);
+ setTimeout(() => setIsCopied(false), 2500);
+ };
+
+ const handleOnClick = () => {
+ if (props.isLoading) return;
+ props.onChange(!props.isPublic);
};
return (
- <div className="flex items-center gap-3">
+ <div className="flex items-center gap-1">
<div className="text-sm font-semibold">
- {props.isLoading ? (
- "Loading.."
- ) : props.isPublic ? (
- <div
- className="flex cursor-pointer items-center gap-1 text-dark-green"
- onClick={() => copyUrl()}
- >
- {isCopied ? "Link copied ..." : "Public"}
- <Link size={16} />
- </div>
- ) : (
- <div className="flex items-center gap-1">
- Private
- <LockIcon size={16} />
- </div>
- )}
+ <Popover>
+ <PopoverTrigger asChild>
+ <Button
+ id="publish-trace"
+ variant="ghost"
+ size="icon"
+ loading={props.isLoading}
+ disabled={props.disabled}
+ >
+ {props.isPublic ? (
+ <Globe
+ className="h-4 w-4"
+ fill="#b3d9ff"
+ stroke="#4d94ff"
+ strokeWidth={2}
+ />
+ ) : (
+ <Share2 className="h-4 w-4" />
+ )}
+ </Button>
+ </PopoverTrigger>
+ <PopoverContent className="flex flex-col gap-3">
+ {props.isPublic ? (
+ <>
+ <Label className="text-base capitalize">
+ {props.itemName} Shared
+ </Label>
+ <span className="text-sm text-muted-foreground">
+ This {props.itemName} is public. Anyone with the link can view
+ this {props.itemName}.
+ </span>
+ <div className="mr-2 flex items-center justify-end gap-2 text-sm">
+ <Button variant="outline" size="sm" onClick={copyUrl}>
+ {isCopied ? (
+ <>
+ <CheckIcon size={12} className="mr-1" />
+ Copied
+ </>
+ ) : (
+ <>
+ <Link size={12} className="mr-1" />
+ Copy
+ </>
+ )}
+ </Button>
+ <Button
+ variant="destructive-secondary"
+ size="sm"
+ loading={props.isLoading}
+ onClick={handleOnClick}
+ >
+ Unshare
+ </Button>
+ </div>
+ </>
+ ) : (
+ <>
+ <Label className="text-base capitalize">
+ {props.itemName} Private
+ </Label>
+ <span className="text-sm text-muted-foreground">
+ This {props.itemName} is private. Only authorized project
+ members can view this {props.itemName}.
+ </span>
+ <div className="mr-2 flex items-center justify-end gap-2 text-sm">
+ <Button
+ variant="secondary"
+ size="sm"
+ loading={props.isLoading}
+ onClick={handleOnClick}
+ >
+ Share
+ </Button>
+ </div>
+ </>
+ )}
+ </PopoverContent>
+ </Popover>
</div>
- <Switch
- id="publish-trace"
- checked={props.isPublic}
- onCheckedChange={() => {
- if (props.isLoading) return;
- props.onChange(!props.isPublic);
- }}
- disabled={props.disabled}
- />
</div>
);
};
diff --git a/web/src/components/session/index.tsx b/web/src/components/session/index.tsx
index 2dfc4a5d22..334eb4d359 100644
--- a/web/src/components/session/index.tsx
+++ b/web/src/components/session/index.tsx
@@ -1,5 +1,4 @@
import { GroupedScoreBadges } from "@/src/components/grouped-score-badge";
-import Header from "@/src/components/layouts/header";
import { ErrorPage } from "@/src/components/error-page";
import { PublishSessionSwitch } from "@/src/components/publish-object-switch";
import { StarSessionToggle } from "@/src/components/star-toggle";
@@ -18,7 +17,7 @@ import { Button } from "@/src/components/ui/button";
import useLocalStorage from "@/src/components/useLocalStorage";
import { CommentDrawerButton } from "@/src/features/comments/CommentDrawerButton";
import { useSession } from "next-auth/react";
-import { ScrollScreenPage } from "@/src/components/layouts/scroll-screen-page";
+import Page from "@/src/components/layouts/page";
// some projects have thousands of traces in a sessions, paginate to avoid rendering all at once
const PAGE_SIZE = 50;
@@ -94,17 +93,18 @@ export const SessionPage: React.FC<{
);
return (
- <ScrollScreenPage>
- <Header
- title="Session"
- breadcrumb={[
+ <Page
+ scrollable
+ headerProps={{
+ title: sessionId,
+ itemType: "SESSION",
+ breadcrumb: [
{
name: "Sessions",
href: `/project/${projectId}/sessions`,
},
- { name: sessionId },
- ]}
- actionButtons={[
+ ],
+ actionButtonsLeft: [
<StarSessionToggle
key="star"
projectId={projectId}
@@ -117,6 +117,8 @@ export const SessionPage: React.FC<{
isPublic={session.data?.public ?? false}
key="publish"
/>,
+ ],
+ actionButtonsRight: [
<DetailPageNav
key="nav"
currentId={encodeURIComponent(sessionId)}
@@ -133,8 +135,9 @@ export const SessionPage: React.FC<{
objectType="SESSION"
count={sessionCommentCounts.data?.get(sessionId)}
/>,
- ]}
- />
+ ],
+ }}
+ >
<div className="flex flex-wrap gap-2">
{session.data?.users.filter(Boolean).map((userId) => (
<Link
@@ -211,7 +214,7 @@ export const SessionPage: React.FC<{
</Button>
)}
</div>
- </ScrollScreenPage>
+ </Page>
);
};
diff --git a/web/src/components/star-toggle.tsx b/web/src/components/star-toggle.tsx
index 476b3758ab..127aa05569 100644
--- a/web/src/components/star-toggle.tsx
+++ b/web/src/components/star-toggle.tsx
@@ -3,7 +3,6 @@ import { StarIcon } from "lucide-react";
import { Button } from "@/src/components/ui/button";
import { api } from "@/src/utils/api";
import { useHasProjectAccess } from "@/src/features/rbac/utils/checkProjectAccess";
-import { cn } from "@/src/utils/tailwind";
import { type RouterOutput, type RouterInput } from "@/src/utils/types";
import { useState } from "react";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
@@ -31,10 +30,10 @@ export function StarToggle({
loading={isLoading}
>
<StarIcon
- className={cn(
- "h-4 w-4",
- value ? "fill-current text-yellow-500" : "text-muted-foreground",
- )}
+ className="h-4 w-4"
+ fill={value ? "#facc15" : "none"}
+ stroke={value ? "#ca8a04" : "currentColor"}
+ strokeWidth={2}
/>
</Button>
);
diff --git a/web/src/components/trace/index.tsx b/web/src/components/trace/index.tsx
index ede275b13c..0e1e69ec1d 100644
--- a/web/src/components/trace/index.tsx
+++ b/web/src/components/trace/index.tsx
@@ -2,8 +2,6 @@ import { type Trace } from "@langfuse/shared";
import { ObservationTree } from "./ObservationTree";
import { ObservationPreview } from "./ObservationPreview";
import { TracePreview } from "./TracePreview";
-
-import Header from "@/src/components/layouts/header";
import { Badge } from "@/src/components/ui/badge";
import {
Select,
@@ -41,7 +39,6 @@ import { DeleteButton } from "@/src/components/deleteButton";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
import { TraceTimelineView } from "@/src/components/trace/TraceTimelineView";
import { type APIScore, ObservationLevel } from "@langfuse/shared";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
import { calculateDisplayTotalCost } from "@/src/components/trace/lib/helpers";
import { useIsAuthenticatedAndProjectMember } from "@/src/features/auth/hooks";
import {
@@ -51,6 +48,7 @@ import {
TabsBarTrigger,
} from "@/src/components/ui/tabs-bar";
import { useHasEntitlement } from "@/src/features/entitlements/hooks";
+import Page from "@/src/components/layouts/page";
export function Trace(props: {
observations: Array<ObservationReturnType>;
@@ -374,20 +372,20 @@ export function TracePage({
/>
);
- if (!trace.data) return <div>loading...</div>;
+ if (!trace.data) return <div className="p-3">Loading...</div>;
return (
- <FullScreenPage>
- <Header
- title="Trace Detail"
- breadcrumb={[
+ <Page
+ headerProps={{
+ title: `${trace.data.name}: ${trace.data.id}`,
+ itemType: "TRACE",
+ breadcrumb: [
{
name: "Traces",
href: `/project/${router.query.projectId as string}/traces`,
},
- { name: traceId },
- ]}
- actionButtons={
+ ],
+ actionButtonsLeft: (
<>
<StarTraceDetailsToggle
traceId={trace.data.id}
@@ -399,6 +397,10 @@ export function TracePage({
projectId={trace.data.projectId}
isPublic={trace.data.public}
/>
+ </>
+ ),
+ actionButtonsRight: (
+ <>
<DetailPageNav
currentId={traceId}
path={(entry) => {
@@ -432,8 +434,9 @@ export function TracePage({
/>
)}
</>
- }
- />
+ ),
+ }}
+ >
<div className="flex flex-wrap gap-2">
{trace.data.sessionId ? (
<Link
@@ -513,6 +516,6 @@ export function TracePage({
/>
</TabsBarContent>
</TabsBar>
- </FullScreenPage>
+ </Page>
);
}
diff --git a/web/src/components/ui/sidebar.tsx b/web/src/components/ui/sidebar.tsx
index 0d1dfb8e39..92b081108d 100644
--- a/web/src/components/ui/sidebar.tsx
+++ b/web/src/components/ui/sidebar.tsx
@@ -368,7 +368,7 @@ const SidebarHeader = React.forwardRef<
<div
ref={ref}
data-sidebar="header"
- className={cn("flex flex-col gap-2 p-2", className)}
+ className={cn("flex min-h-12 flex-col px-3 py-2 md:max-h-12", className)}
{...props}
/>
);
diff --git a/web/src/ee/features/annotation-queues/components/AnnotationQueueItemPage.tsx b/web/src/ee/features/annotation-queues/components/AnnotationQueueItemPage.tsx
index da559e4fae..7396abcad3 100644
--- a/web/src/ee/features/annotation-queues/components/AnnotationQueueItemPage.tsx
+++ b/web/src/ee/features/annotation-queues/components/AnnotationQueueItemPage.tsx
@@ -95,7 +95,8 @@ const AnnotateIOView = ({
return configs.map((c) => c.id);
}, [configs]);
- if (trace.isLoading || !trace.data) return <div>Loading...</div>;
+ if (trace.isLoading || !trace.data)
+ return <div className="p-3">Loading...</div>;
let isValidObservationId = false;
diff --git a/web/src/ee/features/annotation-queues/components/AnnotationQueuesItem.tsx b/web/src/ee/features/annotation-queues/components/AnnotationQueuesItem.tsx
index 04735f875d..65c14de4ae 100644
--- a/web/src/ee/features/annotation-queues/components/AnnotationQueuesItem.tsx
+++ b/web/src/ee/features/annotation-queues/components/AnnotationQueuesItem.tsx
@@ -1,5 +1,3 @@
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
-import Header from "@/src/components/layouts/header";
import { Tabs, TabsList, TabsTrigger } from "@/src/components/ui/tabs";
import useSessionStorage from "@/src/components/useSessionStorage";
import { SupportOrUpgradePage } from "@/src/ee/features/billing/components/SupportOrUpgradePage";
@@ -8,6 +6,7 @@ import { useHasProjectAccess } from "@/src/features/rbac/utils/checkProjectAcces
import { AnnotationQueueItemPage } from "@/src/ee/features/annotation-queues/components/AnnotationQueueItemPage";
import { api } from "@/src/utils/api";
import { Goal, Network } from "lucide-react";
+import Page from "@/src/components/layouts/page";
export const AnnotationQueuesItem = ({
annotationQueueId,
@@ -47,47 +46,47 @@ export const AnnotationQueuesItem = ({
if (!hasAccess || !hasEntitlement) return <SupportOrUpgradePage />;
return (
- <FullScreenPage>
- <>
- <Header
- title={`${queue.data?.name ?? annotationQueueId}`}
- breadcrumb={[
- {
- name: "Annotation Queues",
- href: `/project/${projectId}/annotation-queues`,
- },
- {
- name: queue.data?.name ?? annotationQueueId,
- href: `/project/${projectId}/annotation-queues/${annotationQueueId}`,
- },
- ]}
- actionButtons={
- <Tabs
- value={view}
- onValueChange={(view: string) => {
- setView(view as "hideTree" | "showTree");
- }}
- >
- <TabsList>
- <TabsTrigger value="hideTree">
- <Goal className="mr-1 h-4 w-4"></Goal>
- Focused
- </TabsTrigger>
- <TabsTrigger value="showTree">
- <Network className="mr-1 h-4 w-4"></Network>
- Detailed
- </TabsTrigger>
- </TabsList>
- </Tabs>
- }
- />
- <AnnotationQueueItemPage
- projectId={projectId}
- annotationQueueId={annotationQueueId}
- view={view}
- queryItemId={itemId}
- />
- </>
- </FullScreenPage>
+ <Page
+ headerProps={{
+ title: `${queue.data?.name}: ${itemId}`,
+ itemType: "QUEUE_ITEM",
+ breadcrumb: [
+ {
+ name: "Annotation Queues",
+ href: `/project/${projectId}/annotation-queues`,
+ },
+ {
+ name: queue.data?.name ?? annotationQueueId,
+ href: `/project/${projectId}/annotation-queues/${annotationQueueId}`,
+ },
+ ],
+ actionButtonsRight: (
+ <Tabs
+ value={view}
+ onValueChange={(view: string) => {
+ setView(view as "hideTree" | "showTree");
+ }}
+ >
+ <TabsList>
+ <TabsTrigger value="hideTree">
+ <Goal className="mr-1 h-4 w-4"></Goal>
+ Focused
+ </TabsTrigger>
+ <TabsTrigger value="showTree">
+ <Network className="mr-1 h-4 w-4"></Network>
+ Detailed
+ </TabsTrigger>
+ </TabsList>
+ </Tabs>
+ ),
+ }}
+ >
+ <AnnotationQueueItemPage
+ projectId={projectId}
+ annotationQueueId={annotationQueueId}
+ view={view}
+ queryItemId={itemId}
+ />
+ </Page>
);
};
diff --git a/web/src/ee/features/annotation-queues/pages/AnnotationQueueItems.tsx b/web/src/ee/features/annotation-queues/pages/AnnotationQueueItems.tsx
index b7e38f2122..d6ab5c3a99 100644
--- a/web/src/ee/features/annotation-queues/pages/AnnotationQueueItems.tsx
+++ b/web/src/ee/features/annotation-queues/pages/AnnotationQueueItems.tsx
@@ -1,7 +1,5 @@
-import Header from "@/src/components/layouts/header";
import { api } from "@/src/utils/api";
import { useRouter } from "next/router";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
import { AnnotationQueueItemsTable } from "@/src/ee/features/annotation-queues/components/AnnotationQueueItemsTable";
import { CardDescription } from "@/src/components/ui/card";
import { Button } from "@/src/components/ui/button";
@@ -16,6 +14,7 @@ import { useHasEntitlement } from "@/src/features/entitlements/hooks";
import { SupportOrUpgradePage } from "@/src/ee/features/billing/components/SupportOrUpgradePage";
import { Skeleton } from "@/src/components/ui/skeleton";
import { TableWithMetadataWrapper } from "@/src/components/table/TableWithMetadataWrapper";
+import Page from "@/src/components/layouts/page";
export default function QueueItems() {
const router = useRouter();
@@ -39,76 +38,70 @@ export default function QueueItems() {
if (!hasReadAccess || !hasEntitlement) return <SupportOrUpgradePage />;
return (
- <FullScreenPage>
- <>
- <Header
- title={queue.data?.name ?? queueId}
- breadcrumb={[
- {
- name: "Annotation Queues",
- href: `/project/${projectId}/annotation-queues`,
- },
- { name: queue.data?.name ?? queueId },
- ]}
- actionButtons={
- !hasWriteAccess ? (
- <Button disabled>
- <Lock className="mr-1 h-4 w-4" />
- <span className="text-sm">Process queue</span>
- </Button>
+ <Page
+ headerProps={{
+ title: `${queue.data?.name}: ${queueId}`,
+ itemType: "ANNOTATION_QUEUE",
+ breadcrumb: [
+ {
+ name: "Annotation Queues",
+ href: `/project/${projectId}/annotation-queues`,
+ },
+ ],
+ actionButtonsRight: !hasWriteAccess ? (
+ <Button disabled>
+ <Lock className="mr-1 h-4 w-4" />
+ <span className="text-sm">Process queue</span>
+ </Button>
+ ) : (
+ <Button asChild>
+ <Link
+ href={`/project/${projectId}/annotation-queues/${queueId}/items`}
+ >
+ <ClipboardPen className="mr-1 h-4 w-4" />
+ <span className="text-sm">Process queue</span>
+ </Link>
+ </Button>
+ ),
+ }}
+ >
+ <TableWithMetadataWrapper
+ tableComponent={
+ <AnnotationQueueItemsTable projectId={projectId} queueId={queueId} />
+ }
+ cardTitleChildren={
+ <div className="flex w-full flex-row items-center justify-between">
+ {queue.data ? (
+ <span>{queue.data.name}</span>
) : (
- <Button asChild>
- <Link
- href={`/project/${projectId}/annotation-queues/${queueId}/items`}
- >
- <ClipboardPen className="mr-1 h-4 w-4" />
- <span className="text-sm">Process queue</span>
- </Link>
- </Button>
- )
- }
- />
- <TableWithMetadataWrapper
- tableComponent={
- <AnnotationQueueItemsTable
+ <Skeleton className="h-full w-1/2" />
+ )}
+ <CreateOrEditAnnotationQueueButton
projectId={projectId}
queueId={queueId}
/>
- }
- cardTitleChildren={
- <div className="flex w-full flex-row items-center justify-between">
- {queue.data ? (
- <span>{queue.data.name}</span>
- ) : (
- <Skeleton className="h-full w-1/2" />
- )}
- <CreateOrEditAnnotationQueueButton
- projectId={projectId}
- queueId={queueId}
- />
- </div>
- }
- cardContentChildren={
- <>
- {queue.data?.description && (
- <CardDescription className="text-sm">
- {queue.data?.description}
- </CardDescription>
- )}
- <Separator orientation="horizontal" />
- <h5 className="text-md font-bold leading-7 sm:tracking-tight">
- Score Configs
- </h5>
- {queue.data?.scoreConfigs.map((scoreConfig) => (
- <Badge key={scoreConfig.id} className="mr-2" variant="outline">
- {getScoreDataTypeIcon(scoreConfig.dataType)}
- <span className="ml-0.5">{scoreConfig.name}</span>
- </Badge>
- ))}
- </>
- }
- />
- </>
- </FullScreenPage>
+ </div>
+ }
+ cardContentChildren={
+ <>
+ {queue.data?.description && (
+ <CardDescription className="text-sm">
+ {queue.data?.description}
+ </CardDescription>
+ )}
+ <Separator orientation="horizontal" />
+ <h5 className="text-md font-bold leading-7 sm:tracking-tight">
+ Score Configs
+ </h5>
+ {queue.data?.scoreConfigs.map((scoreConfig) => (
+ <Badge key={scoreConfig.id} className="mr-2" variant="outline">
+ {getScoreDataTypeIcon(scoreConfig.dataType)}
+ <span className="ml-0.5">{scoreConfig.name}</span>
+ </Badge>
+ ))}
+ </>
+ }
+ />
+ </Page>
);
}
diff --git a/web/src/ee/features/annotation-queues/pages/AnnotationQueues.tsx b/web/src/ee/features/annotation-queues/pages/AnnotationQueues.tsx
index 0b7bc4d2c7..6f9f3767ac 100644
--- a/web/src/ee/features/annotation-queues/pages/AnnotationQueues.tsx
+++ b/web/src/ee/features/annotation-queues/pages/AnnotationQueues.tsx
@@ -1,10 +1,9 @@
-import Header from "@/src/components/layouts/header";
import { useRouter } from "next/router";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
import { AnnotationQueuesTable } from "@/src/ee/features/annotation-queues/components/AnnotationQueuesTable";
import { useHasProjectAccess } from "@/src/features/rbac/utils/checkProjectAccess";
import { useHasEntitlement } from "@/src/features/entitlements/hooks";
import { SupportOrUpgradePage } from "@/src/ee/features/billing/components/SupportOrUpgradePage";
+import Page from "@/src/components/layouts/page";
export default function AnnotationQueues() {
const router = useRouter();
@@ -17,18 +16,17 @@ export default function AnnotationQueues() {
if (!hasAccess || !hasEntitlement) return <SupportOrUpgradePage />;
return (
- <FullScreenPage>
- <>
- <Header
- title="Annotation Queues"
- help={{
- description:
- "Annotation queues are used to manage scoring workflows for your LLM projects. See docs to learn more.",
- href: "https://langfuse.com/docs/scores/annotation",
- }}
- />
- <AnnotationQueuesTable projectId={projectId} />
- </>
- </FullScreenPage>
+ <Page
+ headerProps={{
+ title: "Annotation Queues",
+ help: {
+ description:
+ "Annotation queues are used to manage scoring workflows for your LLM projects. See docs to learn more.",
+ href: "https://langfuse.com/docs/scores/annotation",
+ },
+ }}
+ >
+ <AnnotationQueuesTable projectId={projectId} />
+ </Page>
);
}
diff --git a/web/src/ee/features/audit-log-viewer/AuditLogsSettingsPage.tsx b/web/src/ee/features/audit-log-viewer/AuditLogsSettingsPage.tsx
index 7cec2269ec..c1ec1ee0b3 100644
--- a/web/src/ee/features/audit-log-viewer/AuditLogsSettingsPage.tsx
+++ b/web/src/ee/features/audit-log-viewer/AuditLogsSettingsPage.tsx
@@ -29,7 +29,7 @@ export function AuditLogsSettingsPage(props: { projectId: string }) {
return (
<>
- <Header title="Audit Logs" level="h3" />
+ <Header title="Audit Logs" />
<p className="mb-3 text-sm text-muted-foreground">
Track who changed what in your project and when. Monitor settings,
configurations, and data changes over time. Reach out to the Langfuse
diff --git a/web/src/ee/features/billing/components/BillingSettings.tsx b/web/src/ee/features/billing/components/BillingSettings.tsx
index c3656321c7..578cba1314 100644
--- a/web/src/ee/features/billing/components/BillingSettings.tsx
+++ b/web/src/ee/features/billing/components/BillingSettings.tsx
@@ -57,7 +57,7 @@ export const BillingSettings = () => {
);
return (
<div>
- <Header title="Usage & Billing" level="h3" />
+ <Header title="Usage & Billing" />
<OrganizationUsageChart />
</div>
);
@@ -213,7 +213,6 @@ const BillingPortalOrPricingPageButton = () => {
<DialogHeader>
<Header
title="Plans"
- level="h3"
actionButtons={
<Button variant="secondary" asChild>
<Link href="https://langfuse.com/pricing" target="_blank">
diff --git a/web/src/ee/features/evals/components/eval-template-detail.tsx b/web/src/ee/features/evals/components/eval-template-detail.tsx
index 1a8d08e2b7..ff89f48c93 100644
--- a/web/src/ee/features/evals/components/eval-template-detail.tsx
+++ b/web/src/ee/features/evals/components/eval-template-detail.tsx
@@ -1,5 +1,4 @@
import * as React from "react";
-import Header from "@/src/components/layouts/header";
import { EvalTemplateForm } from "@/src/ee/features/evals/components/template-form";
import { api } from "@/src/utils/api";
import { type EvalTemplate } from "@langfuse/shared";
@@ -17,7 +16,7 @@ import { Button } from "@/src/components/ui/button";
import { Plus } from "lucide-react";
import { useState } from "react";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
-import { ScrollScreenPage } from "@/src/components/layouts/scroll-screen-page";
+import Page from "@/src/components/layouts/page";
export const EvalTemplateDetail = () => {
const router = useRouter();
@@ -47,42 +46,42 @@ export const EvalTemplateDetail = () => {
);
return (
- <ScrollScreenPage>
- <Header
- title={template.data?.name ?? "Loading..."}
- actionButtons={
- template.data && (
- <>
- {!isEditing && (
- <UpdateTemplate
- projectId={projectId}
- isLoading={template.isLoading}
- setIsEditing={setIsEditing}
- />
- )}
- <EvalVersionDropdown
- disabled={allTemplates.isLoading}
- options={allTemplates.data?.templates ?? []}
- defaultOption={template.data ?? undefined}
- onSelect={(template) => {
- router.push(
- `/project/${projectId}/evals/templates/${template.id}`,
- );
- }}
- />
- </>
- )
- }
- breadcrumb={[
+ <Page
+ scrollable
+ headerProps={{
+ title: `${template.data?.name}: ${templateId}`,
+ itemType: "EVAL_TEMPLATE",
+ breadcrumb: [
{
name: "Eval Templates",
href: `/project/${router.query.projectId as string}/evals/templates`,
},
- { name: template.data?.name ?? "Loading..." },
- ]}
- />
+ ],
+ actionButtonsRight: (
+ <>
+ {!isEditing && (
+ <UpdateTemplate
+ projectId={projectId}
+ isLoading={template.isLoading}
+ setIsEditing={setIsEditing}
+ />
+ )}
+ <EvalVersionDropdown
+ disabled={allTemplates.isLoading}
+ options={allTemplates.data?.templates ?? []}
+ defaultOption={template.data ?? undefined}
+ onSelect={(template) => {
+ router.push(
+ `/project/${projectId}/evals/templates/${template.id}`,
+ );
+ }}
+ />
+ </>
+ ),
+ }}
+ >
{allTemplates.isLoading || !allTemplates.data ? (
- <div>Loading...</div>
+ <div className="p-3">Loading...</div>
) : (
<EvalTemplateForm
projectId={projectId}
@@ -91,7 +90,7 @@ export const EvalTemplateDetail = () => {
setIsEditing={setIsEditing}
/>
)}
- </ScrollScreenPage>
+ </Page>
);
};
@@ -156,7 +155,7 @@ export function UpdateTemplate({
return (
<Button
- variant="secondary"
+ variant="outline"
onClick={() => handlePromptEdit()}
disabled={!hasAccess}
loading={isLoading}
diff --git a/web/src/ee/features/evals/components/evaluator-detail.tsx b/web/src/ee/features/evals/components/evaluator-detail.tsx
index e48f346a12..2e7df24310 100644
--- a/web/src/ee/features/evals/components/evaluator-detail.tsx
+++ b/web/src/ee/features/evals/components/evaluator-detail.tsx
@@ -1,5 +1,4 @@
import * as React from "react";
-import Header from "@/src/components/layouts/header";
import { type RouterOutputs, api } from "@/src/utils/api";
import { useRouter } from "next/router";
import { EvaluatorForm } from "@/src/ee/features/evals/components/evaluator-form";
@@ -14,7 +13,6 @@ import { useState } from "react";
import TableLink from "@/src/components/table/table-link";
import EvalLogTable from "@/src/ee/features/evals/components/eval-log";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
import { TableWithMetadataWrapper } from "@/src/components/table/TableWithMetadataWrapper";
import { StatusBadge } from "@/src/components/layouts/status-badge";
import { DetailPageNav } from "@/src/features/navigate-detail-pages/DetailPageNav";
@@ -28,6 +26,7 @@ import {
DialogTitle,
DialogTrigger,
} from "@/src/components/ui/dialog";
+import Page from "@/src/components/layouts/page";
export const EvaluatorDetail = () => {
const router = useRouter();
@@ -59,7 +58,7 @@ export const EvaluatorDetail = () => {
allTemplates.isLoading ||
!allTemplates.data
) {
- return <div>Loading...</div>;
+ return <div className="p-3">Loading...</div>;
}
if (evaluator.data && evaluator.data.evalTemplate === null) {
@@ -72,17 +71,19 @@ export const EvaluatorDetail = () => {
: undefined;
return (
- <FullScreenPage>
- <Header
- title={evaluator.data ? `Evaluator ${evaluator.data.id}` : "Loading..."}
- breadcrumb={[
+ <Page
+ headerProps={{
+ title: evaluator.data
+ ? `${evaluator.data.scoreName}: ${evaluator.data.id}`
+ : "Loading...",
+ itemType: "EVALUATOR",
+ breadcrumb: [
{
name: "Evaluators",
href: `/project/${router.query.projectId as string}/evals`,
},
- { name: evaluator.data?.id },
- ]}
- actionButtons={
+ ],
+ actionButtonsRight: (
<>
<StatusBadge
type={evaluator.data?.status.toLowerCase()}
@@ -105,8 +106,9 @@ export const EvaluatorDetail = () => {
/>
)}
</>
- }
- />
+ ),
+ }}
+ >
{existingEvaluator && (
<TableWithMetadataWrapper
tableComponent={
@@ -169,7 +171,7 @@ export const EvaluatorDetail = () => {
}
/>
)}
- </FullScreenPage>
+ </Page>
);
};
diff --git a/web/src/ee/features/evals/pages/evaluators.tsx b/web/src/ee/features/evals/pages/evaluators.tsx
index 56819d1956..54c1facef6 100644
--- a/web/src/ee/features/evals/pages/evaluators.tsx
+++ b/web/src/ee/features/evals/pages/evaluators.tsx
@@ -1,11 +1,10 @@
-import Header from "@/src/components/layouts/header";
+import Page from "@/src/components/layouts/page";
import { useRouter } from "next/router";
import Link from "next/link";
import { useHasProjectAccess } from "@/src/features/rbac/utils/checkProjectAccess";
import { Plus } from "lucide-react";
import EvaluatorTable from "@/src/ee/features/evals/components/evaluator-table";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
import { Tabs, TabsList, TabsTrigger } from "@/src/components/ui/tabs";
import { ActionButton } from "@/src/components/ActionButton";
import { api } from "@/src/utils/api";
@@ -45,19 +44,19 @@ export default function EvaluatorsPage() {
}
return (
- <FullScreenPage>
- <Header
- title="Evaluators"
- help={{
+ <Page
+ headerProps={{
+ title: "Evaluators",
+ help: {
description:
"Use LLM-as-a-judge evaluators as practical addition to human annotation. Configure an evaluation prompt and a model as judge to evaluate incoming traces.",
href: "https://langfuse.com/docs/scores/model-based-evals",
- }}
- actionButtons={
+ },
+ actionButtonsRight: (
<ActionButton
hasAccess={hasWriteAccess}
icon={<Plus className="h-4 w-4" />}
- variant="secondary"
+ variant="outline"
onClick={() => capture("eval_config:new_form_open")}
href={`/project/${projectId}/evals/new`}
limitValue={evaluatorCountFirstPage ?? 0}
@@ -65,8 +64,9 @@ export default function EvaluatorsPage() {
>
New evaluator
</ActionButton>
- }
- />
+ ),
+ }}
+ >
<EvaluatorTable
projectId={projectId}
menuItems={
@@ -85,6 +85,6 @@ export default function EvaluatorsPage() {
</Tabs>
}
/>
- </FullScreenPage>
+ </Page>
);
}
diff --git a/web/src/ee/features/evals/pages/new-evaluator.tsx b/web/src/ee/features/evals/pages/new-evaluator.tsx
index c9fad5a6a6..7951dd21cb 100644
--- a/web/src/ee/features/evals/pages/new-evaluator.tsx
+++ b/web/src/ee/features/evals/pages/new-evaluator.tsx
@@ -1,4 +1,4 @@
-import Header from "@/src/components/layouts/header";
+import Page from "@/src/components/layouts/page";
import { EvaluatorForm } from "@/src/ee/features/evals/components/evaluator-form";
import { api } from "@/src/utils/api";
@@ -15,19 +15,21 @@ export default function NewEvaluatorPage() {
});
return (
- <div>
- <Header
- title="New evaluator"
- help={{
+ <Page
+ scrollable
+ headerProps={{
+ title: "Create evaluator",
+ help: {
description:
"Select a template defining the evaluation prompt and a model as judge to evaluate incoming traces.",
href: "https://langfuse.com/docs/scores/model-based-evals",
- }}
- />
+ },
+ }}
+ >
<EvaluatorForm
projectId={projectId}
evalTemplates={evalTemplates.data?.templates ?? []}
/>
- </div>
+ </Page>
);
}
diff --git a/web/src/ee/features/evals/pages/new-template.tsx b/web/src/ee/features/evals/pages/new-template.tsx
index bb09fc0ce1..9384d300cc 100644
--- a/web/src/ee/features/evals/pages/new-template.tsx
+++ b/web/src/ee/features/evals/pages/new-template.tsx
@@ -1,8 +1,6 @@
-import Header from "@/src/components/layouts/header";
-import { ScrollScreenPage } from "@/src/components/layouts/scroll-screen-page";
+import Page from "@/src/components/layouts/page";
import { EvalTemplateForm } from "@/src/ee/features/evals/components/template-form";
import { useHasProjectAccess } from "@/src/features/rbac/utils/checkProjectAccess";
-
import { useRouter } from "next/router";
export default function NewTemplatesPage() {
@@ -19,16 +17,18 @@ export default function NewTemplatesPage() {
}
return (
- <ScrollScreenPage>
- <Header
- title="Create eval template"
- help={{
+ <Page
+ scrollable
+ headerProps={{
+ title: "Create eval template",
+ help: {
description:
"Create an evaluation template. Choose from one of the pre-defined templates or create your own.",
href: "https://langfuse.com/docs/scores/model-based-evals",
- }}
- />
+ },
+ }}
+ >
<EvalTemplateForm projectId={projectId} isEditing={true} />
- </ScrollScreenPage>
+ </Page>
);
}
diff --git a/web/src/ee/features/evals/pages/templates.tsx b/web/src/ee/features/evals/pages/templates.tsx
index 5d9f4c65dd..973d167acc 100644
--- a/web/src/ee/features/evals/pages/templates.tsx
+++ b/web/src/ee/features/evals/pages/templates.tsx
@@ -1,4 +1,4 @@
-import Header from "@/src/components/layouts/header";
+import Page from "@/src/components/layouts/page";
import { useRouter } from "next/router";
import { Button } from "@/src/components/ui/button";
import Link from "next/link";
@@ -27,20 +27,20 @@ export default function TemplatesPage() {
}
return (
- <div className="flex h-[calc(100vh-6rem)] flex-col overflow-hidden md:h-[calc(100vh-2rem)]">
- <Header
- title="Eval Templates"
- help={{
+ <Page
+ headerProps={{
+ title: "Eval Templates",
+ help: {
description:
"Create an evaluation template. Choose from one of the pre-defined templates or create your own.",
href: "https://langfuse.com/docs/scores/model-based-evals",
- }}
- actionButtons={
+ },
+ actionButtonsRight: (
<Button
disabled={!hasWriteAccess}
onClick={() => capture("eval_templates:new_form_open")}
asChild
- variant="secondary"
+ variant="outline"
>
<Link
href={
@@ -54,11 +54,12 @@ export default function TemplatesPage() {
) : (
<Lock className="mr-2 h-4 w-4" />
)}
- New template
+ New Template
</Link>
</Button>
- }
- />
+ ),
+ }}
+ >
<EvalsTemplateTable
projectId={projectId}
menuItems={
@@ -75,6 +76,6 @@ export default function TemplatesPage() {
</Tabs>
}
/>
- </div>
+ </Page>
);
}
diff --git a/web/src/ee/features/playground/page/index.tsx b/web/src/ee/features/playground/page/index.tsx
index 35ec9e1567..a554362dab 100644
--- a/web/src/ee/features/playground/page/index.tsx
+++ b/web/src/ee/features/playground/page/index.tsx
@@ -1,7 +1,6 @@
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
-import Header from "@/src/components/layouts/header";
import { ResetPlaygroundButton } from "@/src/ee/features/playground/page/components/ResetPlaygroundButton";
import { SaveToPromptButton } from "@/src/ee/features/playground/page/components/SaveToPromptButton";
+import Page from "@/src/components/layouts/page";
import { PlaygroundProvider } from "@/src/ee/features/playground/page/context";
import Playground from "@/src/ee/features/playground/page/playground";
import { useHasEntitlement } from "@/src/features/entitlements/hooks";
@@ -11,24 +10,25 @@ export default function PlaygroundPage() {
if (!available) return null;
return (
<PlaygroundProvider>
- <FullScreenPage>
- <Header
- title="Playground"
- help={{
+ <Page
+ headerProps={{
+ title: "Playground",
+ help: {
description: "A sandbox to test and iterate your prompts",
href: "https://langfuse.com/docs/playground",
- }}
- actionButtons={
+ },
+ actionButtonsRight: (
<>
<SaveToPromptButton />
<ResetPlaygroundButton />
</>
- }
- />
+ ),
+ }}
+ >
<div className="flex-1 overflow-auto">
<Playground />
</div>
- </FullScreenPage>
+ </Page>
</PlaygroundProvider>
);
}
diff --git a/web/src/features/batch-exports/components/BatchExportsSettingsPage.tsx b/web/src/features/batch-exports/components/BatchExportsSettingsPage.tsx
index 4cbec53fb6..d63893c787 100644
--- a/web/src/features/batch-exports/components/BatchExportsSettingsPage.tsx
+++ b/web/src/features/batch-exports/components/BatchExportsSettingsPage.tsx
@@ -11,7 +11,7 @@ export function BatchExportsSettingsPage(props: { projectId: string }) {
return (
<>
- <Header title="Exports" level="h3" />
+ <Header title="Exports" />
<p className="mb-4 text-sm">
Export large datasets in your preferred format via the export buttons
across Langfuse. Exports are processed asynchronously and remain
diff --git a/web/src/features/comments/CommentDrawerButton.tsx b/web/src/features/comments/CommentDrawerButton.tsx
index 7d0667199e..112fee1a13 100644
--- a/web/src/features/comments/CommentDrawerButton.tsx
+++ b/web/src/features/comments/CommentDrawerButton.tsx
@@ -65,7 +65,7 @@ export function CommentDrawerButton({
<div className="mx-auto w-full overflow-y-auto md:max-h-full">
<DrawerHeader className="sticky top-0 z-10 rounded-sm bg-background">
<DrawerTitle>
- <Header title="Comments" level="h3"></Header>
+ <Header title="Comments"></Header>
</DrawerTitle>
</DrawerHeader>
<div data-vaul-no-drag className="px-2">
diff --git a/web/src/features/datasets/components/DatasetAnalytics.tsx b/web/src/features/datasets/components/DatasetAnalytics.tsx
index 51134ee54c..36c830deb7 100644
--- a/web/src/features/datasets/components/DatasetAnalytics.tsx
+++ b/web/src/features/datasets/components/DatasetAnalytics.tsx
@@ -15,6 +15,7 @@ export function DatasetAnalytics(props: {
className="max-w-fit"
placeholder="Search..."
title="Charts"
+ variant="outline"
iconLeft={<ChartColumnBig className="mr-1 h-4 w-4" />}
hideClearButton
onValueChange={(values, changedValue, selectedKeys) => {
diff --git a/web/src/features/datasets/components/NewDatasetItemButton.tsx b/web/src/features/datasets/components/NewDatasetItemButton.tsx
index 5f0c8a6b44..482221754e 100644
--- a/web/src/features/datasets/components/NewDatasetItemButton.tsx
+++ b/web/src/features/datasets/components/NewDatasetItemButton.tsx
@@ -27,7 +27,7 @@ export const NewDatasetItemButton = (props: {
<Dialog open={hasAccess && open} onOpenChange={setOpen}>
<DialogTrigger asChild>
<ActionButton
- variant="secondary"
+ variant="outline"
className={props.className}
hasAccess={hasAccess}
onClick={() => capture("dataset_item:new_form_open")}
diff --git a/web/src/features/models/components/ModelSettings.tsx b/web/src/features/models/components/ModelSettings.tsx
index 3b2b9f2d4b..4b26f6e018 100644
--- a/web/src/features/models/components/ModelSettings.tsx
+++ b/web/src/features/models/components/ModelSettings.tsx
@@ -4,7 +4,7 @@ import ModelTable from "@/src/components/table/use-cases/models";
export function ModelsSettings(props: { projectId: string }) {
return (
<>
- <Header title="Models" level="h3" />
+ <Header title="Models" />
<p className="mb-4 text-sm">
A model represents a LLM model. It is used to calculate tokens and cost.
</p>
diff --git a/web/src/features/navigate-detail-pages/DetailPageNav.tsx b/web/src/features/navigate-detail-pages/DetailPageNav.tsx
index 55076f3c06..e09034867e 100644
--- a/web/src/features/navigate-detail-pages/DetailPageNav.tsx
+++ b/web/src/features/navigate-detail-pages/DetailPageNav.tsx
@@ -67,12 +67,12 @@ export const DetailPageNav = (props: {
if (entries.length > 1)
return (
- <div className="flex flex-row gap-2">
+ <div className="flex flex-row gap-1">
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="outline"
- size="icon"
+ className="p-2"
disabled={!previousPageEntry}
onClick={() => {
if (previousPageEntry) {
@@ -87,6 +87,9 @@ export const DetailPageNav = (props: {
}}
>
<ChevronUp className="h-4 w-4" />
+ <span className="ml-1 h-4 w-4 rounded-sm bg-primary/80 text-xs text-primary-foreground shadow-sm">
+ K
+ </span>
</Button>
</TooltipTrigger>
<TooltipContent>
@@ -101,7 +104,7 @@ export const DetailPageNav = (props: {
<TooltipTrigger asChild>
<Button
variant="outline"
- size="icon"
+ className="p-2"
disabled={!nextPageEntry}
onClick={() => {
if (nextPageEntry) {
@@ -116,6 +119,9 @@ export const DetailPageNav = (props: {
}}
>
<ChevronDown className="h-4 w-4" />
+ <span className="ml-1 h-4 w-4 rounded-sm bg-primary/80 text-xs text-primary-foreground shadow-sm">
+ J
+ </span>
</Button>
</TooltipTrigger>
<TooltipContent>
diff --git a/web/src/features/organizations/components/ProjectOverview.tsx b/web/src/features/organizations/components/ProjectOverview.tsx
index 6f324386a9..8c531ba07b 100644
--- a/web/src/features/organizations/components/ProjectOverview.tsx
+++ b/web/src/features/organizations/components/ProjectOverview.tsx
@@ -30,25 +30,166 @@ import {
createProjectRoute,
} from "@/src/features/setup/setupRoutes";
import { isCloudPlan, planLabels } from "@langfuse/shared";
-import { ScrollScreenPage } from "@/src/components/layouts/scroll-screen-page";
+import ContainerPage from "@/src/components/layouts/container-page";
+import { type User } from "next-auth";
-const SingleOrganizationProjectOverview = ({
- orgId,
+const OrganizationProjectTiles = ({
+ org,
search,
- level = "h2",
}: {
- orgId: string;
+ org: User["organizations"][number];
search?: string;
- level?: "h2" | "h3";
}) => {
- const createProjectAccess = useHasOrganizationAccess({
- organizationId: orgId,
- scope: "projects:create",
- });
+ return (
+ <div className="grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3">
+ {org.projects
+ .filter(
+ (p) => !search || p.name.toLowerCase().includes(search.toLowerCase()),
+ )
+ .map((project) => (
+ <Card key={project.id}>
+ <CardHeader>
+ <CardTitle className="text-base">{project.name}</CardTitle>
+ </CardHeader>
+ {!project.deletedAt ? (
+ <CardFooter className="gap-2">
+ <Button asChild variant="secondary">
+ <Link href={`/project/${project.id}`}>Go to project</Link>
+ </Button>
+ <Button asChild variant="ghost">
+ <Link href={`/project/${project.id}/settings`}>
+ <Settings size={16} />
+ </Link>
+ </Button>
+ </CardFooter>
+ ) : (
+ <CardContent>
+ <CardDescription>Project is being deleted</CardDescription>
+ </CardContent>
+ )}
+ </Card>
+ ))}
+ </div>
+ );
+};
+
+const DemoOrganizationTile = () => {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Try Langfuse Demo</CardTitle>
+ </CardHeader>
+ <CardContent>
+ We have built a Q&A chatbot that answers questions based on the Langfuse
+ Docs. Interact with it to see traces in Langfuse.
+ </CardContent>
+ <CardFooter>
+ <Button asChild variant="secondary">
+ <Link href={`/project/${env.NEXT_PUBLIC_DEMO_PROJECT_ID}`}>
+ View Demo Project
+ </Link>
+ </Button>
+ </CardFooter>
+ </Card>
+ );
+};
+
+const OrganizationActionButtons = ({
+ orgId,
+ primaryButtonVariant = "default",
+}: {
+ orgId: string;
+ primaryButtonVariant?: "default" | "secondary";
+}) => {
const membersViewAccess = useHasOrganizationAccess({
organizationId: orgId,
scope: "organizationMembers:read",
});
+ const createProjectAccess = useHasOrganizationAccess({
+ organizationId: orgId,
+ scope: "projects:create",
+ });
+
+ return (
+ <>
+ <Button asChild variant="ghost">
+ <Link href={`/organization/${orgId}/settings`}>
+ <Settings size={14} />
+ </Link>
+ </Button>
+ {membersViewAccess && (
+ <Button asChild variant="ghost">
+ <Link href={`/organization/${orgId}/settings/members`}>
+ <Users size={14} />
+ </Link>
+ </Button>
+ )}
+ {createProjectAccess ? (
+ <Button asChild variant={primaryButtonVariant}>
+ <Link href={createProjectRoute(orgId)}>
+ <PlusIcon className="mr-2 h-4 w-4" aria-hidden="true" />
+ New project
+ </Link>
+ </Button>
+ ) : (
+ <Button disabled variant={primaryButtonVariant}>
+ <LockIcon className="mr-2 h-4 w-4" aria-hidden="true" />
+ New project
+ </Button>
+ )}
+ </>
+ );
+};
+
+const SingleOrganizationPage = ({
+ orgId,
+ search,
+}: {
+ orgId: string;
+ search?: string;
+}) => {
+ const session = useSession();
+ const org = session.data?.user?.organizations.find((o) => o.id === orgId);
+
+ if (!org) {
+ return null;
+ }
+
+ const isDemoOrg =
+ env.NEXT_PUBLIC_DEMO_ORG_ID === orgId &&
+ org.projects.some((p) => p.id === env.NEXT_PUBLIC_DEMO_PROJECT_ID);
+
+ if (isDemoOrg) {
+ return (
+ <ContainerPage
+ headerProps={{
+ title: "Demo Organization",
+ }}
+ >
+ <DemoOrganizationTile />
+ </ContainerPage>
+ );
+ }
+
+ return (
+ <ContainerPage
+ headerProps={{
+ title: org?.name ?? "Organization",
+ actionButtonsRight: <OrganizationActionButtons orgId={orgId} />,
+ }}
+ >
+ <OrganizationProjectTiles org={org} search={search} />
+ </ContainerPage>
+ );
+};
+
+const SingleOrganizationProjectOverviewTile = ({
+ orgId,
+ search,
+}: {
+ orgId: string;
+ search?: string;
+}) => {
const session = useSession();
const org = session.data?.user?.organizations.find((o) => o.id === orgId);
@@ -63,23 +204,7 @@ const SingleOrganizationProjectOverview = ({
if (isDemoOrg) {
return (
<div key={orgId}>
- {level === "h2" && <Header title="Demo Organization" />}
- <Card>
- <CardHeader>
- <CardTitle>Try Langfuse Demo</CardTitle>
- </CardHeader>
- <CardContent>
- We have built a Q&A chatbot that answers questions based on the
- Langfuse Docs. Interact with it to see traces in Langfuse.
- </CardContent>
- <CardFooter>
- <Button asChild variant="secondary">
- <Link href={`/project/${env.NEXT_PUBLIC_DEMO_PROJECT_ID}`}>
- View Demo Project
- </Link>
- </Button>
- </CardFooter>
- </Card>
+ <DemoOrganizationTile />
</div>
);
}
@@ -88,10 +213,9 @@ const SingleOrganizationProjectOverview = ({
<div key={orgId} className="mb-10">
<Header
title={org.name}
- level={level}
status={orgId === env.NEXT_PUBLIC_DEMO_ORG_ID ? "Demo Org" : undefined}
label={
- isCloudPlan(org.plan) && level === "h3"
+ isCloudPlan(org.plan)
? {
text: planLabels[org.plan],
href: `/organization/${org.id}/settings/billing`,
@@ -99,65 +223,13 @@ const SingleOrganizationProjectOverview = ({
: undefined
}
actionButtons={
- <>
- <Button asChild variant="ghost">
- <Link href={`/organization/${orgId}/settings`}>
- <Settings size={14} />
- </Link>
- </Button>
- {membersViewAccess && (
- <Button asChild variant="ghost">
- <Link href={`/organization/${orgId}/settings/members`}>
- <Users size={14} />
- </Link>
- </Button>
- )}
- {createProjectAccess ? (
- <Button asChild variant="secondary">
- <Link href={createProjectRoute(orgId)}>
- <PlusIcon className="mr-2 h-4 w-4" aria-hidden="true" />
- New project
- </Link>
- </Button>
- ) : (
- <Button variant="secondary" disabled>
- <LockIcon className="mr-2 h-4 w-4" aria-hidden="true" />
- New project
- </Button>
- )}
- </>
+ <OrganizationActionButtons
+ orgId={orgId}
+ primaryButtonVariant="secondary"
+ />
}
/>
- <div className="grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3">
- {org.projects
- .filter(
- (p) =>
- !search || p.name.toLowerCase().includes(search.toLowerCase()),
- )
- .map((project) => (
- <Card key={project.id}>
- <CardHeader>
- <CardTitle className="text-base">{project.name}</CardTitle>
- </CardHeader>
- {!project.deletedAt ? (
- <CardFooter className="gap-2">
- <Button asChild variant="secondary">
- <Link href={`/project/${project.id}`}>Go to project</Link>
- </Button>
- <Button asChild variant="ghost">
- <Link href={`/project/${project.id}/settings`}>
- <Settings size={16} />
- </Link>
- </Button>
- </CardFooter>
- ) : (
- <CardContent>
- <CardDescription>Project is being deleted</CardDescription>
- </CardContent>
- )}
- </Card>
- ))}
- </div>
+ <OrganizationProjectTiles org={org} search={search} />
</div>
);
};
@@ -178,40 +250,54 @@ export const OrganizationProjectOverview = () => {
organizations.filter((org) => org.id !== env.NEXT_PUBLIC_DEMO_ORG_ID)
.length === 0 && !queryOrgId;
+ if (queryOrgId) {
+ const org = organizations.find((org) => org.id === queryOrgId);
+
+ if (!org) {
+ return null;
+ }
+
+ return (
+ <SingleOrganizationPage orgId={org.id} search={search ?? undefined} />
+ );
+ }
+
return (
- <ScrollScreenPage>
- {!queryOrgId && (
- <>
- <Header
- title="Organizations"
- help={{
- description:
- "Organizations help you manage access to projects. Each organization can have multiple projects and team members with different roles.",
- href: "https://langfuse.com/docs/rbac",
- }}
- actionButtons={
- <>
- <Input
- className="w-36 lg:w-56"
- placeholder="Search projects"
- onChange={(e) => setQueryParams({ search: e.target.value })}
- />
- {canCreateOrg && (
- <Button data-testid="create-organization-btn" asChild>
- <Link href={createOrganizationRoute}>
- <PlusIcon className="mr-1.5 h-4 w-4" aria-hidden="true" />
- New Organization
- </Link>
- </Button>
- )}
- </>
- }
- />
- </>
- )}
+ <ContainerPage
+ headerProps={{
+ title: "Organizations",
+ help: {
+ description:
+ "Organizations help you manage access to projects. Each organization can have multiple projects and team members with different roles.",
+ href: "https://langfuse.com/docs/rbac",
+ },
+ breadcrumb: [
+ {
+ name: "Organizations",
+ href: "/",
+ },
+ ],
+ actionButtonsRight: (
+ <>
+ <Input
+ className="mr-1 w-36 lg:w-56"
+ placeholder="Search projects"
+ onChange={(e) => setQueryParams({ search: e.target.value })}
+ />
+ {canCreateOrg && (
+ <Button data-testid="create-organization-btn" asChild>
+ <Link href={createOrganizationRoute}>
+ <PlusIcon className="mr-1.5 h-4 w-4" aria-hidden="true" />
+ New Organization
+ </Link>
+ </Button>
+ )}
+ </>
+ ),
+ }}
+ >
{showOnboarding && <Onboarding />}
{organizations
- .filter((org) => queryOrgId === undefined || org.id === queryOrgId)
.sort((a, b) => {
// sort demo org to the bottom
const isDemoA = env.NEXT_PUBLIC_DEMO_ORG_ID === a.id;
@@ -225,14 +311,13 @@ export const OrganizationProjectOverview = () => {
{!queryOrgId && org.id === env.NEXT_PUBLIC_DEMO_ORG_ID && (
<Divider />
)}
- <SingleOrganizationProjectOverview
+ <SingleOrganizationProjectOverviewTile
orgId={org.id}
search={search ?? undefined}
- level={queryOrgId ? "h2" : "h3"}
/>
</Fragment>
))}
- </ScrollScreenPage>
+ </ContainerPage>
);
};
diff --git a/web/src/features/organizations/components/RenameOrganization.tsx b/web/src/features/organizations/components/RenameOrganization.tsx
index 437f60c106..e87529748e 100644
--- a/web/src/features/organizations/components/RenameOrganization.tsx
+++ b/web/src/features/organizations/components/RenameOrganization.tsx
@@ -63,7 +63,7 @@ export default function RenameOrganization() {
return (
<div>
- <Header title="Organization Name" level="h3" />
+ <Header title="Organization Name" />
<Card className="mb-4 p-3">
{form.getValues().name !== "" ? (
<p className="mb-4 text-sm text-primary">
diff --git a/web/src/features/projects/components/ConfigureRetention.tsx b/web/src/features/projects/components/ConfigureRetention.tsx
index 66c62cf5ca..583d6f7340 100644
--- a/web/src/features/projects/components/ConfigureRetention.tsx
+++ b/web/src/features/projects/components/ConfigureRetention.tsx
@@ -62,7 +62,7 @@ export default function ConfigureRetention() {
return (
<div>
- <Header title="Data Retention" level="h3" />
+ <Header title="Data Retention" />
<Card className="mb-4 p-3">
<p className="mb-4 text-sm text-primary">
Data retention automatically deletes events older than the specified
diff --git a/web/src/features/projects/components/HostNameProject.tsx b/web/src/features/projects/components/HostNameProject.tsx
index c1850b4612..927399c883 100644
--- a/web/src/features/projects/components/HostNameProject.tsx
+++ b/web/src/features/projects/components/HostNameProject.tsx
@@ -8,7 +8,7 @@ export function HostNameProject() {
const uiCustomization = useUiCustomization();
return (
<div>
- <Header title="Host Name" level="h3" />
+ <Header title="Host Name" />
<Card className="mb-4 p-3">
<div className="">
<div className="mb-2 text-sm">
diff --git a/web/src/features/projects/components/RenameProject.tsx b/web/src/features/projects/components/RenameProject.tsx
index 2051c34c85..9e0449c1ba 100644
--- a/web/src/features/projects/components/RenameProject.tsx
+++ b/web/src/features/projects/components/RenameProject.tsx
@@ -60,7 +60,7 @@ export default function RenameProject() {
return (
<div>
- <Header title="Project Name" level="h3" />
+ <Header title="Project Name" />
<Card className="mb-4 p-3">
{form.getValues().name !== "" ? (
<p className="mb-4 text-sm text-primary">
diff --git a/web/src/features/prompts/components/duplicate-prompt.tsx b/web/src/features/prompts/components/duplicate-prompt.tsx
index 86279998b3..099a506668 100644
--- a/web/src/features/prompts/components/duplicate-prompt.tsx
+++ b/web/src/features/prompts/components/duplicate-prompt.tsx
@@ -51,7 +51,7 @@ const DuplicatePromptForm: React.FC<{
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
defaultValues: {
- name: promptName,
+ name: promptName + "-copy",
isCopySingleVersion: CopySettings.SINGLE_VERSION,
},
});
@@ -205,7 +205,7 @@ export const DuplicatePromptButton: React.FC<{
<ActionButton
icon={<Copy className="mr-1 h-4 w-4" aria-hidden="true" />}
hasAccess={hasAccess}
- variant="secondary"
+ variant="outline"
limit={promptLimit}
title="Duplicate prompt"
limitValue={allPromptNames.data?.length ?? undefined}
diff --git a/web/src/features/prompts/components/prompt-detail.tsx b/web/src/features/prompts/components/prompt-detail.tsx
index 537d4be3d8..5ac28ea23a 100644
--- a/web/src/features/prompts/components/prompt-detail.tsx
+++ b/web/src/features/prompts/components/prompt-detail.tsx
@@ -2,7 +2,6 @@ import Link from "next/link";
import { useRouter } from "next/router";
import { NumberParam, useQueryParam } from "use-query-params";
import type { z } from "zod";
-import Header from "@/src/components/layouts/header";
import { OpenAiMessageView } from "@/src/components/trace/IOPreview";
import { Tabs, TabsList, TabsTrigger } from "@/src/components/ui/tabs";
import { Badge } from "@/src/components/ui/badge";
@@ -28,7 +27,6 @@ import { Lock, Plus, FlaskConical } from "lucide-react";
import { useHasProjectAccess } from "@/src/features/rbac/utils/checkProjectAccess";
import { Button } from "@/src/components/ui/button";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
import {
Dialog,
DialogContent,
@@ -39,6 +37,7 @@ import { useState } from "react";
import { useHasEntitlement } from "@/src/features/entitlements/hooks";
import { showSuccessToast } from "@/src/features/notifications/showSuccessToast";
import { DuplicatePromptButton } from "@/src/features/prompts/components/duplicate-prompt";
+import Page from "@/src/components/layouts/page";
export const PromptDetail = () => {
const projectId = useProjectIdFromURL();
@@ -134,30 +133,29 @@ export const PromptDetail = () => {
).map((t) => t.value);
if (!promptHistory.data || !prompt) {
- return <div>Loading...</div>;
+ return <div className="p-3">Loading...</div>;
}
-
return (
- <FullScreenPage>
- <Header
- title={prompt.name}
- help={{
+ <Page
+ headerProps={{
+ title: prompt.name,
+ itemType: "PROMPT",
+ 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={[
+ },
+ breadcrumb: [
{
name: "Prompts",
href: `/project/${projectId}/prompts/`,
},
{
- name: prompt.name,
+ name: `${prompt.name} (latest)`,
href: `/project/${projectId}/prompts/${encodeURIComponent(promptName)}`,
},
- { name: `Version ${prompt.version}` },
- ]}
- actionButtons={
+ ],
+ actionButtonsRight: (
<>
<JumpToPlaygroundButton
source="prompt"
@@ -217,7 +215,7 @@ export const PromptDetail = () => {
</Button>
</>
) : (
- <Button variant="secondary" disabled>
+ <Button variant="outline" disabled>
<div className="flex flex-row items-center">
<Lock className="h-3 w-3" />
<span className="ml-2">New version</span>
@@ -251,8 +249,9 @@ export const PromptDetail = () => {
</TabsList>
</Tabs>
</>
- }
- />
+ ),
+ }}
+ >
<div className="grid grid-cols-3 gap-4 overflow-hidden">
<div className="col-span-3">
<div className="mb-5 rounded-lg border bg-card font-semibold text-card-foreground">
@@ -359,6 +358,6 @@ export const PromptDetail = () => {
/>
</div>
</div>
- </FullScreenPage>
+ </Page>
);
};
diff --git a/web/src/features/prompts/components/prompt-new.tsx b/web/src/features/prompts/components/prompt-new.tsx
index c6b3514c8b..feb790a647 100644
--- a/web/src/features/prompts/components/prompt-new.tsx
+++ b/web/src/features/prompts/components/prompt-new.tsx
@@ -1,10 +1,8 @@
import { StringParam, useQueryParam } from "use-query-params";
-
-import Header from "@/src/components/layouts/header";
import { NewPromptForm } from "@/src/features/prompts/components/NewPromptForm";
import useProjectIdFromURL from "@/src/hooks/useProjectIdFromURL";
import { api } from "@/src/utils/api";
-import { ScrollScreenPage } from "@/src/components/layouts/scroll-screen-page";
+import Page from "@/src/components/layouts/page";
export const NewPrompt = () => {
const projectId = useProjectIdFromURL();
@@ -23,7 +21,7 @@ export const NewPrompt = () => {
);
if (isInitialLoading) {
- return <div>Loading...</div>;
+ return <div className="p-3">Loading...</div>;
}
const breadcrumb: { name: string; href?: string }[] = [
@@ -48,20 +46,20 @@ export const NewPrompt = () => {
}
return (
- <ScrollScreenPage>
- <Header
- title={
- initialPrompt
- ? `${initialPrompt.name} \u2014 New version`
- : "Create new prompt"
- }
- help={{
+ <Page
+ scrollable
+ headerProps={{
+ title: initialPrompt
+ ? `${initialPrompt.name} \u2014 New version`
+ : "Create new prompt",
+ help: {
description:
"Manage and version your prompts in Langfuse. Edit and update them via the UI and SDK. Retrieve the production version via the SDKs. Learn more in the docs.",
href: "https://langfuse.com/docs/prompts",
- }}
- breadcrumb={breadcrumb}
- />
+ },
+ breadcrumb: breadcrumb,
+ }}
+ >
{initialPrompt ? (
<p className="text-sm text-muted-foreground">
Prompts are immutable in Langfuse. To update a prompt, create a new
@@ -71,6 +69,6 @@ export const NewPrompt = () => {
<div className="my-8">
<NewPromptForm {...{ initialPrompt }} />
</div>
- </ScrollScreenPage>
+ </Page>
);
};
diff --git a/web/src/features/public-api/components/ApiKeyList.tsx b/web/src/features/public-api/components/ApiKeyList.tsx
index 7ee72c6c21..25a2cb898f 100644
--- a/web/src/features/public-api/components/ApiKeyList.tsx
+++ b/web/src/features/public-api/components/ApiKeyList.tsx
@@ -46,7 +46,7 @@ export function ApiKeyList(props: { projectId: string }) {
if (!hasAccess) {
return (
<div>
- <Header title="API Keys" level="h3" />
+ <Header title="API Keys" />
<Alert>
<AlertTitle>Access Denied</AlertTitle>
<AlertDescription>
@@ -59,7 +59,7 @@ export function ApiKeyList(props: { projectId: string }) {
return (
<div>
- <Header title="API Keys" level="h3" />
+ <Header title="API Keys" />
<Card className="mb-4">
<Table>
<TableHeader>
diff --git a/web/src/features/public-api/components/LLMApiKeyList.tsx b/web/src/features/public-api/components/LLMApiKeyList.tsx
index 5c59e41d6b..90e5d77fd9 100644
--- a/web/src/features/public-api/components/LLMApiKeyList.tsx
+++ b/web/src/features/public-api/components/LLMApiKeyList.tsx
@@ -58,7 +58,7 @@ export function LlmApiKeyList(props: { projectId: string }) {
if (!hasAccess) {
return (
<div>
- <Header title="LLM API Keys" level="h3" />
+ <Header title="LLM API Keys" />
<Alert>
<AlertTitle>Access Denied</AlertTitle>
<AlertDescription>
@@ -71,7 +71,7 @@ export function LlmApiKeyList(props: { projectId: string }) {
return (
<div id="llm-api-keys">
- <Header title="LLM API keys" level="h3" />
+ <Header title="LLM API keys" />
<p className="mb-4 text-sm">
These keys are used to power the Langfuse playground and evaluations
feature and will incur costs based on usage with your key provider.
diff --git a/web/src/features/rbac/components/MembershipInvitesPage.tsx b/web/src/features/rbac/components/MembershipInvitesPage.tsx
index b951619731..4a04b4de23 100644
--- a/web/src/features/rbac/components/MembershipInvitesPage.tsx
+++ b/web/src/features/rbac/components/MembershipInvitesPage.tsx
@@ -185,7 +185,7 @@ export function MembershipInvitesPage({
orgRole: invite.orgRole,
projectRole:
invite.projectId === projectId
- ? invite.projectRole ?? undefined
+ ? (invite.projectRole ?? undefined)
: undefined,
invitedByUser: invite.invitedByUser,
};
@@ -200,7 +200,7 @@ export function MembershipInvitesPage({
return (
<>
{/* Header included in order to hide it when there are not invites yet */}
- <Header title="Membership Invites" level="h3" />
+ <Header title="Membership Invites" />
<DataTableToolbar columns={columns} />
<DataTable
columns={columns}
diff --git a/web/src/features/scores/components/AnnotateDrawer.tsx b/web/src/features/scores/components/AnnotateDrawer.tsx
index 3a0d280024..73b8fe4f7a 100644
--- a/web/src/features/scores/components/AnnotateDrawer.tsx
+++ b/web/src/features/scores/components/AnnotateDrawer.tsx
@@ -152,7 +152,6 @@ export function AnnotateDrawer({
<DrawerTitle>
<Header
title="Annotate"
- level="h3"
help={{
description: `Annotate ${observationId ? "observation" : "trace"} with scores to capture human evaluation across different dimensions.`,
href: "https://langfuse.com/docs/scores/manually",
diff --git a/web/src/features/scores/components/AnnotateDrawerContent.tsx b/web/src/features/scores/components/AnnotateDrawerContent.tsx
index 41f2e93a14..d9d6de57d9 100644
--- a/web/src/features/scores/components/AnnotateDrawerContent.tsx
+++ b/web/src/features/scores/components/AnnotateDrawerContent.tsx
@@ -150,7 +150,6 @@ function AnnotateHeader({
return (
<Header
title="Annotate"
- level="h3"
help={{
description: `Annotate ${observationId ? "observation" : "trace"} with scores to capture human evaluation across different dimensions.`,
href: "https://langfuse.com/docs/scores/manually",
diff --git a/web/src/features/scores/components/ScoreConfigSettings.tsx b/web/src/features/scores/components/ScoreConfigSettings.tsx
index f10df910a4..9fabd0f1b4 100644
--- a/web/src/features/scores/components/ScoreConfigSettings.tsx
+++ b/web/src/features/scores/components/ScoreConfigSettings.tsx
@@ -14,7 +14,7 @@ export function ScoreConfigSettings({ projectId }: { projectId: string }) {
return (
<div id="score-configs">
- <Header title="Score Configs" level="h3" />
+ <Header title="Score Configs" />
<p className="mb-4 text-sm">
Score configs define which scores are available for{" "}
<a
diff --git a/web/src/features/scores/components/multi-select-key-values.tsx b/web/src/features/scores/components/multi-select-key-values.tsx
index 7b0ecce053..ea351562f8 100644
--- a/web/src/features/scores/components/multi-select-key-values.tsx
+++ b/web/src/features/scores/components/multi-select-key-values.tsx
@@ -52,6 +52,7 @@ type MultiSelectKeyValuesProps<
hideClearButton?: boolean;
iconLeft?: React.ReactNode;
iconRight?: React.ReactNode;
+ variant?: "outline" | "secondary";
};
export function MultiSelectKeyValues<
@@ -71,6 +72,7 @@ export function MultiSelectKeyValues<
hideClearButton = false,
iconLeft,
iconRight,
+ variant = "secondary",
}: MultiSelectKeyValuesProps<T>) {
const [isOpen, setIsOpen] = React.useState(false);
const [searchQuery, setSearchQuery] = React.useState("");
@@ -169,9 +171,9 @@ export function MultiSelectKeyValues<
>
<DropdownMenuTrigger asChild>
<Button
- variant="outline"
+ variant={variant}
className={cn(
- "flex h-8 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-1 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
+ "flex h-8 w-full items-center justify-between rounded-md px-3 py-1 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
className,
)}
disabled={disabled}
diff --git a/web/src/features/setup/components/SetupPage.tsx b/web/src/features/setup/components/SetupPage.tsx
index 7503db5455..3056526f21 100644
--- a/web/src/features/setup/components/SetupPage.tsx
+++ b/web/src/features/setup/components/SetupPage.tsx
@@ -1,5 +1,5 @@
import Header from "@/src/components/layouts/header";
-import { ScrollScreenPage } from "@/src/components/layouts/scroll-screen-page";
+import ContainerPage from "@/src/components/layouts/container-page";
import {
Breadcrumb,
BreadcrumbItem,
@@ -72,168 +72,173 @@ export function SetupPage() {
}, [hasAnyTrace, capture]);
return (
- <ScrollScreenPage>
- <Header
- title="Setup"
- help={{
+ <ContainerPage
+ headerProps={{
+ title: "Setup",
+ help: {
description:
"Create a new organization. This will be used to manage your projects and teams.",
- }}
- />
- <div className="mt-3 md:container md:mx-auto">
- <Breadcrumb className="mb-3">
- <BreadcrumbList>
- <BreadcrumbItem>
- <BreadcrumbPage
- className={cn(
- stepInt !== 1
- ? "text-muted-foreground"
- : "font-semibold text-foreground",
- )}
- >
- 1. Create Organization
- {stepInt > 1 && <Check className="ml-1 inline-block h-3 w-3" />}
- </BreadcrumbPage>
- </BreadcrumbItem>
- <BreadcrumbSeparator />
- <BreadcrumbItem>
- <BreadcrumbPage
- className={cn(
- stepInt !== 2
- ? "text-muted-foreground"
- : "font-semibold text-foreground",
- )}
- >
- 2. Invite Members
- {stepInt > 2 && <Check className="ml-1 inline-block h-3 w-3" />}
- </BreadcrumbPage>
- </BreadcrumbItem>
- <BreadcrumbSeparator />
- <BreadcrumbItem>
- <BreadcrumbPage
- className={cn(
- stepInt !== 3
- ? "text-muted-foreground"
- : "font-semibold text-foreground",
- )}
- >
- 3. Create Project
- {stepInt > 3 && <Check className="ml-1 inline-block h-3 w-3" />}
- </BreadcrumbPage>
- </BreadcrumbItem>
- <BreadcrumbSeparator />
- <BreadcrumbItem>
- <BreadcrumbPage
- className={cn(
- stepInt !== 4
- ? "text-muted-foreground"
- : "font-semibold text-foreground",
- )}
- >
- 4. Setup Tracing
- {stepInt === 4 && (
- <Check className="ml-1 inline-block h-3 w-3" />
- )}
- </BreadcrumbPage>
- </BreadcrumbItem>
- </BreadcrumbList>
- </Breadcrumb>
- <Card className="p-3">
- {
- // 1. Create Org
- stepInt === 1 && (
+ },
+ ...(stepInt === 1 && {
+ breadcrumb: [
+ {
+ name: "Organizations",
+ href: "/",
+ },
+ ],
+ }),
+ }}
+ >
+ <Breadcrumb className="mb-3">
+ <BreadcrumbList>
+ <BreadcrumbItem>
+ <BreadcrumbPage
+ className={cn(
+ stepInt !== 1
+ ? "text-muted-foreground"
+ : "font-semibold text-foreground",
+ )}
+ >
+ 1. Create Organization
+ {stepInt > 1 && <Check className="ml-1 inline-block h-3 w-3" />}
+ </BreadcrumbPage>
+ </BreadcrumbItem>
+ <BreadcrumbSeparator />
+ <BreadcrumbItem>
+ <BreadcrumbPage
+ className={cn(
+ stepInt !== 2
+ ? "text-muted-foreground"
+ : "font-semibold text-foreground",
+ )}
+ >
+ 2. Invite Members
+ {stepInt > 2 && <Check className="ml-1 inline-block h-3 w-3" />}
+ </BreadcrumbPage>
+ </BreadcrumbItem>
+ <BreadcrumbSeparator />
+ <BreadcrumbItem>
+ <BreadcrumbPage
+ className={cn(
+ stepInt !== 3
+ ? "text-muted-foreground"
+ : "font-semibold text-foreground",
+ )}
+ >
+ 3. Create Project
+ {stepInt > 3 && <Check className="ml-1 inline-block h-3 w-3" />}
+ </BreadcrumbPage>
+ </BreadcrumbItem>
+ <BreadcrumbSeparator />
+ <BreadcrumbItem>
+ <BreadcrumbPage
+ className={cn(
+ stepInt !== 4
+ ? "text-muted-foreground"
+ : "font-semibold text-foreground",
+ )}
+ >
+ 4. Setup Tracing
+ {stepInt === 4 && <Check className="ml-1 inline-block h-3 w-3" />}
+ </BreadcrumbPage>
+ </BreadcrumbItem>
+ </BreadcrumbList>
+ </Breadcrumb>
+ <Card className="p-3">
+ {
+ // 1. Create Org
+ stepInt === 1 && (
+ <div>
+ <Header title="New Organization" />
+ <p className="mb-4 text-sm text-muted-foreground">
+ Organizations are used to manage your projects and teams.
+ </p>
+ <NewOrganizationForm
+ onSuccess={(orgId) => {
+ router.push(inviteMembersRoute(orgId));
+ }}
+ />
+ </div>
+ )
+ }
+ {
+ // 2. Invite Members
+ stepInt === 2 && organization && (
+ <div className="flex flex-col gap-10">
<div>
- <Header title="New Organization" level="h3" />
+ <Header title="Organization Members" />
<p className="mb-4 text-sm text-muted-foreground">
- Organizations are used to manage your projects and teams.
+ Invite members to your organization to collaborate on
+ projects. You can always add more members later.
</p>
- <NewOrganizationForm
- onSuccess={(orgId) => {
- router.push(inviteMembersRoute(orgId));
- }}
- />
+ <MembersTable orgId={organization.id} />
</div>
- )
- }
- {
- // 2. Invite Members
- stepInt === 2 && organization && (
- <div className="flex flex-col gap-10">
- <div>
- <Header title="Organization Members" level="h3" />
- <p className="mb-4 text-sm text-muted-foreground">
- Invite members to your organization to collaborate on
- projects. You can always add more members later.
- </p>
- <MembersTable orgId={organization.id} />
- </div>
- <div>
- <MembershipInvitesPage orgId={organization.id} />
- </div>
+ <div>
+ <MembershipInvitesPage orgId={organization.id} />
</div>
- )
- }
- {
- // 3. Create Project
- stepInt === 3 && organization && (
+ </div>
+ )
+ }
+ {
+ // 3. Create Project
+ stepInt === 3 && organization && (
+ <div>
+ <Header title="New Project" />
+ <p className="mb-4 text-sm text-muted-foreground">
+ Projects are used to group traces, datasets, evals and prompts.
+ Multiple environments are best separated via tags within a
+ project.
+ </p>
+ <NewProjectForm
+ orgId={organization.id}
+ onSuccess={(projectId) =>
+ router.push(setupTracingRoute(projectId))
+ }
+ />
+ </div>
+ )
+ }
+ {
+ // 4. Setup Tracing
+ stepInt === 4 && project && organization && (
+ <div className="space-y-8">
<div>
- <Header title="New Project" level="h3" />
+ <Header title="API Keys" />
<p className="mb-4 text-sm text-muted-foreground">
- Projects are used to group traces, datasets, evals and
- prompts. Multiple environments are best separated via tags
- within a project.
+ These keys are used to authenticate your API requests. You can
+ create more keys later in the project settings.
</p>
- <NewProjectForm
- orgId={organization.id}
- onSuccess={(projectId) =>
- router.push(setupTracingRoute(projectId))
- }
+ <TracingSetup
+ projectId={project.id}
+ hasAnyTrace={hasAnyTrace ?? false}
/>
</div>
- )
- }
- {
- // 4. Setup Tracing
- stepInt === 4 && project && organization && (
- <div className="space-y-8">
- <div>
- <Header title="API Keys" level="h3" />
- <p className="mb-4 text-sm text-muted-foreground">
- These keys are used to authenticate your API requests. You
- can create more keys later in the project settings.
- </p>
- <TracingSetup
- projectId={project.id}
- hasAnyTrace={hasAnyTrace ?? false}
- />
- </div>
- </div>
- )
- }
- </Card>
- {stepInt === 2 && organization && (
+ </div>
+ )
+ }
+ </Card>
+ {stepInt === 2 && organization && (
+ <Button
+ className="mt-4"
+ data-testid="btn-skip-add-members"
+ onClick={() => router.push(createProjectRoute(organization.id))}
+ >
+ Next
+ </Button>
+ )}
+ {
+ // 4. Setup Tracing
+ stepInt === 4 && project && (
<Button
className="mt-4"
- data-testid="btn-skip-add-members"
- onClick={() => router.push(createProjectRoute(organization.id))}
+ onClick={() => router.push(`/project/${project.id}`)}
+ variant={hasAnyTrace ? "default" : "secondary"}
>
- Next
+ {hasAnyTrace ? "Open Dashboard" : "Skip for now"}
</Button>
- )}
- {
- // 4. Setup Tracing
- stepInt === 4 && project && (
- <Button
- className="mt-4"
- onClick={() => router.push(`/project/${project.id}`)}
- variant={hasAnyTrace ? "default" : "secondary"}
- >
- {hasAnyTrace ? "Open Dashboard" : "Skip for now"}
- </Button>
- )
- }
- </div>
- </ScrollScreenPage>
+ )
+ }
+ </ContainerPage>
);
}
@@ -285,7 +290,6 @@ const TracingSetup = ({
<div>
<Header
title="Setup Tracing"
- level="h3"
status={hasAnyTrace ? "active" : "pending"}
/>
<p className="mb-4 text-sm text-muted-foreground">
diff --git a/web/src/pages/organization/[organizationId]/settings/index.tsx b/web/src/pages/organization/[organizationId]/settings/index.tsx
index b9a84b292b..d32bb4fd7d 100644
--- a/web/src/pages/organization/[organizationId]/settings/index.tsx
+++ b/web/src/pages/organization/[organizationId]/settings/index.tsx
@@ -10,7 +10,7 @@ import { SettingsDangerZone } from "@/src/components/SettingsDangerZone";
import { DeleteOrganizationButton } from "@/src/features/organizations/components/DeleteOrganizationButton";
import { BillingSettings } from "@/src/ee/features/billing/components/BillingSettings";
import { useHasEntitlement } from "@/src/features/entitlements/hooks";
-import { ScrollScreenPage } from "@/src/components/layouts/scroll-screen-page";
+import ContainerPage from "@/src/components/layouts/container-page";
const OrgSettingsPage = () => {
const organization = useQueryOrganization();
@@ -21,8 +21,11 @@ const OrgSettingsPage = () => {
if (!organization) return null;
return (
- <ScrollScreenPage>
- <Header title="Organization Settings" />
+ <ContainerPage
+ headerProps={{
+ title: "Organization Settings",
+ }}
+ >
<PagedSettingsContainer
activeSlug={page as string | undefined}
pages={[
@@ -33,7 +36,7 @@ const OrgSettingsPage = () => {
<div className="flex flex-col gap-6">
<RenameOrganization />
<div>
- <Header title="Debug Information" level="h3" />
+ <Header title="Debug Information" />
<JSONView
title="Metadata"
json={{ name: organization.name, id: organization.id }}
@@ -58,7 +61,7 @@ const OrgSettingsPage = () => {
content: (
<div className="flex flex-col gap-6">
<div>
- <Header title="Organization Members" level="h3" />
+ <Header title="Organization Members" />
<MembersTable orgId={organization.id} />
</div>
<div>
@@ -80,7 +83,7 @@ const OrgSettingsPage = () => {
},
]}
/>
- </ScrollScreenPage>
+ </ContainerPage>
);
};
diff --git a/web/src/pages/project/[projectId]/datasets.tsx b/web/src/pages/project/[projectId]/datasets.tsx
index 73e7ffae97..da40bf688f 100644
--- a/web/src/pages/project/[projectId]/datasets.tsx
+++ b/web/src/pages/project/[projectId]/datasets.tsx
@@ -1,23 +1,23 @@
-import Header from "@/src/components/layouts/header";
import { useRouter } from "next/router";
import { DatasetsTable } from "@/src/features/datasets/components/DatasetsTable";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
+import Page from "@/src/components/layouts/page";
export default function Traces() {
const router = useRouter();
const projectId = router.query.projectId as string;
return (
- <FullScreenPage>
- <Header
- title="Datasets"
- help={{
+ <Page
+ headerProps={{
+ title: "Datasets",
+ help: {
description:
"Datasets in Langfuse are a collection of inputs (and expected outputs) of an LLM application. They are used to benchmark new releases before deployment to production. See docs to learn more.",
href: "https://langfuse.com/docs/datasets",
- }}
- />
+ },
+ }}
+ >
<DatasetsTable projectId={projectId} />
- </FullScreenPage>
+ </Page>
);
}
diff --git a/web/src/pages/project/[projectId]/datasets/[datasetId]/compare.tsx b/web/src/pages/project/[projectId]/datasets/[datasetId]/compare.tsx
index 182cc0d4ed..badedd39bf 100644
--- a/web/src/pages/project/[projectId]/datasets/[datasetId]/compare.tsx
+++ b/web/src/pages/project/[projectId]/datasets/[datasetId]/compare.tsx
@@ -1,5 +1,3 @@
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
-import Header from "@/src/components/layouts/header";
import { Button } from "@/src/components/ui/button";
import { DatasetCompareRunsTable } from "@/src/features/datasets/components/DatasetCompareRunsTable";
import { MultiSelectKeyValues } from "@/src/features/scores/components/multi-select-key-values";
@@ -35,6 +33,7 @@ import {
transformAggregatedRunMetricsToChartData,
} from "@/src/features/dashboard/lib/score-analytics-utils";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
+import Page from "@/src/components/layouts/page";
export default function DatasetCompare() {
const router = useRouter();
@@ -161,10 +160,10 @@ export default function DatasetCompare() {
}
return (
- <FullScreenPage>
- <Header
- title={`Compare runs: ${dataset.data?.name ?? datasetId}`}
- breadcrumb={[
+ <Page
+ headerProps={{
+ title: `Compare runs: ${dataset.data?.name ?? datasetId}`,
+ breadcrumb: [
{
name: "Datasets",
href: `/project/${projectId}/datasets`,
@@ -173,11 +172,11 @@ export default function DatasetCompare() {
name: dataset.data?.name ?? datasetId,
href: `/project/${projectId}/datasets/${datasetId}`,
},
- ]}
- help={{
+ ],
+ help: {
description: "Compare your dataset runs side by side",
- }}
- actionButtons={[
+ },
+ actionButtonsRight: [
<Dialog
key="create-experiment-dialog"
open={isCreateExperimentDialogOpen}
@@ -185,7 +184,7 @@ export default function DatasetCompare() {
>
<DialogTrigger asChild disabled={!hasExperimentWriteAccess}>
<Button
- variant="secondary"
+ variant="outline"
disabled={!hasExperimentWriteAccess}
onClick={() => capture("dataset_run:new_form_open")}
>
@@ -270,8 +269,9 @@ export default function DatasetCompare() {
}
}}
/>,
- ]}
- />
+ ],
+ }}
+ >
{Boolean(selectedMetrics.length) &&
Boolean(runAggregatedMetrics?.size) && (
<Card className="my-4 max-h-64">
@@ -326,6 +326,6 @@ export default function DatasetCompare() {
runIds={runIds ?? []}
localExperiments={localRuns}
/>
- </FullScreenPage>
+ </Page>
);
}
diff --git a/web/src/pages/project/[projectId]/datasets/[datasetId]/index.tsx b/web/src/pages/project/[projectId]/datasets/[datasetId]/index.tsx
index 438d2e814b..2036758112 100644
--- a/web/src/pages/project/[projectId]/datasets/[datasetId]/index.tsx
+++ b/web/src/pages/project/[projectId]/datasets/[datasetId]/index.tsx
@@ -1,4 +1,3 @@
-import Header from "@/src/components/layouts/header";
import { DatasetRunsTable } from "@/src/features/datasets/components/DatasetRunsTable";
import { api } from "@/src/utils/api";
import { useRouter } from "next/router";
@@ -7,7 +6,6 @@ import Link from "next/link";
import { DetailPageNav } from "@/src/features/navigate-detail-pages/DetailPageNav";
import { DatasetActionButton } from "@/src/features/datasets/components/DatasetActionButton";
import { DeleteButton } from "@/src/components/deleteButton";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
import { DuplicateDatasetButton } from "@/src/features/datasets/components/DuplicateDatasetButton";
import { useState } from "react";
import { MultiSelectKeyValues } from "@/src/features/scores/components/multi-select-key-values";
@@ -33,6 +31,7 @@ import {
PopoverTrigger,
} from "@/src/components/ui/popover";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
+import Page from "@/src/components/layouts/page";
export default function Dataset() {
const router = useRouter();
@@ -107,21 +106,19 @@ export default function Dataset() {
};
return (
- <FullScreenPage>
- <Header
- title={dataset.data?.name ?? ""}
- breadcrumb={[
+ <Page
+ headerProps={{
+ title: dataset.data?.name ?? "",
+ itemType: "DATASET",
+ breadcrumb: [
{ name: "Datasets", href: `/project/${projectId}/datasets` },
- { name: dataset.data?.name ?? datasetId },
- ]}
- help={
- dataset.data?.description
- ? {
- description: dataset.data.description,
- }
- : undefined
- }
- actionButtons={
+ ],
+ help: dataset.data?.description
+ ? {
+ description: dataset.data.description,
+ }
+ : undefined,
+ actionButtonsRight: [
<>
<Dialog
open={isCreateExperimentDialogOpen}
@@ -129,7 +126,7 @@ export default function Dataset() {
>
<DialogTrigger asChild disabled={!hasExperimentWriteAccess}>
<Button
- variant="secondary"
+ variant="outline"
disabled={!hasExperimentWriteAccess}
onClick={() => capture("dataset_run:new_form_open")}
>
@@ -161,6 +158,7 @@ export default function Dataset() {
{hasReadAccess && hasEntitlement && evaluators.isSuccess && (
<MultiSelectKeyValues
+ variant="outline"
className="max-w-fit"
placeholder="Search..."
title="Evaluators"
@@ -238,10 +236,10 @@ export default function Dataset() {
redirectUrl={`/project/${projectId}/datasets`}
deleteConfirmation={dataset.data?.name}
/>
- </>
- }
- />
-
+ </>,
+ ],
+ }}
+ >
<DatasetRunsTable
projectId={projectId}
datasetId={datasetId}
@@ -262,6 +260,6 @@ export default function Dataset() {
</Tabs>
}
/>
- </FullScreenPage>
+ </Page>
);
}
diff --git a/web/src/pages/project/[projectId]/datasets/[datasetId]/items.tsx b/web/src/pages/project/[projectId]/datasets/[datasetId]/items.tsx
index 35945e5d8b..6add9c861b 100644
--- a/web/src/pages/project/[projectId]/datasets/[datasetId]/items.tsx
+++ b/web/src/pages/project/[projectId]/datasets/[datasetId]/items.tsx
@@ -1,4 +1,3 @@
-import Header from "@/src/components/layouts/header";
import { api } from "@/src/utils/api";
import { useRouter } from "next/router";
import { Tabs, TabsList, TabsTrigger } from "@/src/components/ui/tabs";
@@ -8,7 +7,6 @@ import { DetailPageNav } from "@/src/features/navigate-detail-pages/DetailPageNa
import { DatasetActionButton } from "@/src/features/datasets/components/DatasetActionButton";
import { DeleteButton } from "@/src/components/deleteButton";
import { NewDatasetItemButton } from "@/src/features/datasets/components/NewDatasetItemButton";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
import { DuplicateDatasetButton } from "@/src/features/datasets/components/DuplicateDatasetButton";
import { UploadDatasetCsvButton } from "@/src/features/datasets/components/UploadDatasetCsvButton";
import { MarkdownOrJsonView } from "@/src/components/trace/IOPreview";
@@ -19,6 +17,7 @@ import {
PopoverTrigger,
} from "@/src/components/ui/popover";
import { FolderKanban } from "lucide-react";
+import Page from "@/src/components/layouts/page";
export default function DatasetItems() {
const router = useRouter();
@@ -32,27 +31,19 @@ export default function DatasetItems() {
});
return (
- <FullScreenPage>
- <Header
- title={dataset.data?.name ?? ""}
- help={
- dataset.data?.description
- ? {
- description: dataset.data.description,
- }
- : undefined
- }
- breadcrumb={[
+ <Page
+ headerProps={{
+ title: dataset.data?.name ?? "",
+ itemType: "DATASET",
+ help: dataset.data?.description
+ ? {
+ description: dataset.data.description,
+ }
+ : undefined,
+ breadcrumb: [
{ name: "Datasets", href: `/project/${projectId}/datasets` },
- {
- name: dataset.data?.name ?? datasetId,
- href: `/project/${projectId}/datasets/${datasetId}`,
- },
- {
- name: "Items",
- },
- ]}
- actionButtons={
+ ],
+ actionButtonsRight: [
<>
<NewDatasetItemButton projectId={projectId} datasetId={datasetId} />
<UploadDatasetCsvButton
@@ -113,10 +104,10 @@ export default function DatasetItems() {
redirectUrl={`/project/${projectId}/datasets`}
deleteConfirmation={dataset.data?.name}
/>
- </>
- }
- />
-
+ </>,
+ ],
+ }}
+ >
<DatasetItemsTable
projectId={projectId}
datasetId={datasetId}
@@ -133,6 +124,6 @@ export default function DatasetItems() {
</Tabs>
}
/>
- </FullScreenPage>
+ </Page>
);
}
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 29e2ba4600..ecfff0edfa 100644
--- a/web/src/pages/project/[projectId]/datasets/[datasetId]/items/[itemId].tsx
+++ b/web/src/pages/project/[projectId]/datasets/[datasetId]/items/[itemId].tsx
@@ -1,5 +1,5 @@
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
import Header from "@/src/components/layouts/header";
+import Page from "@/src/components/layouts/page";
import { Button } from "@/src/components/ui/button";
import {
ResizableHandle,
@@ -36,10 +36,11 @@ export default function Dataset() {
);
return (
- <FullScreenPage>
- <Header
- title={`Dataset Item`}
- breadcrumb={[
+ <Page
+ headerProps={{
+ title: itemId,
+ itemType: "DATASET_ITEM",
+ breadcrumb: [
{ name: "Datasets", href: `/project/${projectId}/datasets` },
{
name: dataset.data?.name ?? datasetId,
@@ -49,9 +50,8 @@ export default function Dataset() {
name: "Items",
href: `/project/${projectId}/datasets/${datasetId}/items`,
},
- { name: itemId },
- ]}
- actionButtons={
+ ],
+ actionButtonsLeft: (
<>
{item.data?.sourceTraceId && (
<Button variant="outline" asChild>
@@ -63,17 +63,19 @@ export default function Dataset() {
</Link>
</Button>
)}
- <DetailPageNav
- currentId={itemId}
- path={(entry) =>
- `/project/${projectId}/datasets/${datasetId}/items/${entry.id}`
- }
- listKey="datasetItems"
- />
</>
- }
- />
-
+ ),
+ actionButtonsRight: (
+ <DetailPageNav
+ currentId={itemId}
+ path={(entry) =>
+ `/project/${projectId}/datasets/${datasetId}/items/${entry.id}`
+ }
+ listKey="datasetItems"
+ />
+ ),
+ }}
+ >
<ResizablePanelGroup direction="vertical">
<ResizablePanel
minSize={10}
@@ -88,7 +90,7 @@ export default function Dataset() {
</ResizablePanel>
<ResizableHandle withHandle className="bg-border" />
<ResizablePanel minSize={10} className="flex flex-col space-y-4">
- <Header title="Runs" level="h3" />
+ <Header title="Runs" />
<DatasetRunItemsTable
projectId={projectId}
datasetItemId={itemId}
@@ -96,6 +98,6 @@ export default function Dataset() {
/>
</ResizablePanel>
</ResizablePanelGroup>
- </FullScreenPage>
+ </Page>
);
}
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 334f18c9b7..2d0057816c 100644
--- a/web/src/pages/project/[projectId]/datasets/[datasetId]/runs/[runId].tsx
+++ b/web/src/pages/project/[projectId]/datasets/[datasetId]/runs/[runId].tsx
@@ -1,5 +1,3 @@
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
-import Header from "@/src/components/layouts/header";
import { TableWithMetadataWrapper } from "@/src/components/table/TableWithMetadataWrapper";
import { Button } from "@/src/components/ui/button";
import { JSONView } from "@/src/components/ui/CodeJsonViewer";
@@ -10,6 +8,7 @@ import { api } from "@/src/utils/api";
import { Columns3 } from "lucide-react";
import Link from "next/link";
import { useRouter } from "next/router";
+import Page from "@/src/components/layouts/page";
export default function Dataset() {
const router = useRouter();
@@ -28,32 +27,20 @@ export default function Dataset() {
});
return (
- <FullScreenPage>
- <Header
- title={`Dataset Run`}
- breadcrumb={[
+ <Page
+ headerProps={{
+ title: run.data?.name ?? runId,
+ itemType: "DATASET_RUN",
+ breadcrumb: [
{ name: "Datasets", href: `/project/${projectId}/datasets` },
{
name: dataset.data?.name ?? datasetId,
href: `/project/${projectId}/datasets/${datasetId}`,
},
{ name: "Runs", href: `/project/${projectId}/datasets/${datasetId}` },
- { name: run.data?.name ?? "" },
- ]}
- actionButtons={
+ ],
+ actionButtonsRight: [
<>
- <DeleteDatasetRunButton
- projectId={projectId}
- datasetRunId={runId}
- redirectUrl={`/project/${projectId}/datasets/${datasetId}`}
- />
- <DetailPageNav
- currentId={runId}
- path={(entry) =>
- `/project/${projectId}/datasets/${datasetId}/runs/${entry.id}`
- }
- listKey="datasetRuns"
- />
<Link
href={{
pathname: `/project/${projectId}/datasets/${datasetId}/compare`,
@@ -65,9 +52,22 @@ export default function Dataset() {
<span>Compare</span>
</Button>
</Link>
- </>
- }
- />
+ <DetailPageNav
+ currentId={runId}
+ path={(entry) =>
+ `/project/${projectId}/datasets/${datasetId}/runs/${entry.id}`
+ }
+ listKey="datasetRuns"
+ />
+ <DeleteDatasetRunButton
+ projectId={projectId}
+ datasetRunId={runId}
+ redirectUrl={`/project/${projectId}/datasets/${datasetId}`}
+ />
+ </>,
+ ],
+ }}
+ >
{run.data?.description || run.data?.metadata ? (
<TableWithMetadataWrapper
tableComponent={
@@ -106,6 +106,6 @@ export default function Dataset() {
datasetRunId={runId}
/>
)}
- </FullScreenPage>
+ </Page>
);
}
diff --git a/web/src/pages/project/[projectId]/evals/configs/[configId].tsx b/web/src/pages/project/[projectId]/evals/configs/[configId].tsx
index e9e6e0ee57..d50f22568c 100644
--- a/web/src/pages/project/[projectId]/evals/configs/[configId].tsx
+++ b/web/src/pages/project/[projectId]/evals/configs/[configId].tsx
@@ -44,7 +44,7 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
export default function RedirectPage() {
const router = useRouter();
if (router.isFallback) {
- return <div>Loading...</div>;
+ return <div className="p-3">Loading...</div>;
}
return <div>Redirecting...</div>;
diff --git a/web/src/pages/project/[projectId]/evals/configs/index.tsx b/web/src/pages/project/[projectId]/evals/configs/index.tsx
index 2988721681..dc6f5d76d1 100644
--- a/web/src/pages/project/[projectId]/evals/configs/index.tsx
+++ b/web/src/pages/project/[projectId]/evals/configs/index.tsx
@@ -21,7 +21,7 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
export default function RedirectPage() {
const router = useRouter();
if (router.isFallback) {
- return <div>Loading...</div>;
+ return <div className="p-3">Loading...</div>;
}
return <div>Redirecting...</div>;
diff --git a/web/src/pages/project/[projectId]/evals/configs/new.tsx b/web/src/pages/project/[projectId]/evals/configs/new.tsx
index 36741bc10d..61d41a6d0e 100644
--- a/web/src/pages/project/[projectId]/evals/configs/new.tsx
+++ b/web/src/pages/project/[projectId]/evals/configs/new.tsx
@@ -21,7 +21,7 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
export default function RedirectPage() {
const router = useRouter();
if (router.isFallback) {
- return <div>Loading...</div>;
+ return <div className="p-3">Loading...</div>;
}
return <div>Redirecting...</div>;
diff --git a/web/src/pages/project/[projectId]/evals/log.tsx b/web/src/pages/project/[projectId]/evals/log.tsx
index 6173dd87db..ec8a1ff643 100644
--- a/web/src/pages/project/[projectId]/evals/log.tsx
+++ b/web/src/pages/project/[projectId]/evals/log.tsx
@@ -3,13 +3,12 @@
// Please consider this when planning long-term use and integration of this functionality into your projects.
// For more information see https://langfuse.com/docs/open-source
-import Header from "@/src/components/layouts/header";
import { useRouter } from "next/router";
import EvalLogTable from "@/src/ee/features/evals/components/eval-log";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
import { Tabs, TabsList, TabsTrigger } from "@/src/components/ui/tabs";
import Link from "next/link";
import { useHasProjectAccess } from "@/src/features/rbac/utils/checkProjectAccess";
+import Page from "@/src/components/layouts/page";
export default function LogPage() {
const router = useRouter();
@@ -25,14 +24,15 @@ export default function LogPage() {
}
return (
- <FullScreenPage>
- <Header
- title="Eval Log"
- help={{
+ <Page
+ headerProps={{
+ title: "Eval Log",
+ help: {
description: "View of all running evals.",
href: "https://langfuse.com/docs/scores/model-based-evals",
- }}
- />
+ },
+ }}
+ >
<EvalLogTable
projectId={projectId}
menuItems={
@@ -51,6 +51,6 @@ export default function LogPage() {
</Tabs>
}
/>
- </FullScreenPage>
+ </Page>
);
}
diff --git a/web/src/pages/project/[projectId]/index.tsx b/web/src/pages/project/[projectId]/index.tsx
index 4502a1e30f..cd74825b77 100644
--- a/web/src/pages/project/[projectId]/index.tsx
+++ b/web/src/pages/project/[projectId]/index.tsx
@@ -1,4 +1,3 @@
-import Header from "@/src/components/layouts/header";
import { useRouter } from "next/router";
import { GenerationLatencyChart } from "@/src/features/dashboard/components/LatencyChart";
import { ChartScores } from "@/src/features/dashboard/components/ChartScores";
@@ -26,8 +25,8 @@ import { useDebounce } from "@/src/hooks/useDebounce";
import { ScoreAnalytics } from "@/src/features/dashboard/components/score-analytics/ScoreAnalytics";
import SetupTracingButton from "@/src/features/setup/components/SetupTracingButton";
import { useUiCustomization } from "@/src/ee/features/ui-customization/useUiCustomization";
-import { ScrollScreenPage } from "@/src/components/layouts/scroll-screen-page";
import { useEntitlementLimit } from "@/src/features/entitlements/hooks";
+import Page from "@/src/components/layouts/page";
export default function Dashboard() {
const router = useRouter();
@@ -144,8 +143,13 @@ export default function Dashboard() {
const mergedFilterState: FilterState = [...userFilterState, ...timeFilter];
return (
- <ScrollScreenPage>
- <Header title="Dashboard" actionButtons={<SetupTracingButton />} />
+ <Page
+ scrollable
+ headerProps={{
+ title: "Dashboard",
+ actionButtonsLeft: <SetupTracingButton />,
+ }}
+ >
<div className="my-3 flex flex-wrap items-center justify-between gap-2">
<div className="flex flex-col gap-2 lg:flex-row">
<DatePickerWithRange
@@ -261,6 +265,6 @@ export default function Dashboard() {
/>
)}
</div>
- </ScrollScreenPage>
+ </Page>
);
}
diff --git a/web/src/pages/project/[projectId]/observations.tsx b/web/src/pages/project/[projectId]/observations.tsx
index 5cef0901ce..8efb0f3fb8 100644
--- a/web/src/pages/project/[projectId]/observations.tsx
+++ b/web/src/pages/project/[projectId]/observations.tsx
@@ -1,23 +1,23 @@
-import Header from "@/src/components/layouts/header";
import { useRouter } from "next/router";
import ObservationsTable from "@/src/components/table/use-cases/observations";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
+import Page from "@/src/components/layouts/page";
export default function Generations() {
const router = useRouter();
const projectId = router.query.projectId as string;
return (
- <FullScreenPage>
- <Header
- title="Observations"
- help={{
+ <Page
+ headerProps={{
+ title: "Observations",
+ help: {
description:
"An observation captures a single function call in an application. See docs to learn more.",
href: "https://langfuse.com/docs/tracing",
- }}
- />
+ },
+ }}
+ >
<ObservationsTable projectId={projectId} />
- </FullScreenPage>
+ </Page>
);
}
diff --git a/web/src/pages/project/[projectId]/prompts/[promptName]/metrics.tsx b/web/src/pages/project/[projectId]/prompts/[promptName]/metrics.tsx
index 80200fb763..1404f60bda 100644
--- a/web/src/pages/project/[projectId]/prompts/[promptName]/metrics.tsx
+++ b/web/src/pages/project/[projectId]/prompts/[promptName]/metrics.tsx
@@ -1,4 +1,3 @@
-import Header from "@/src/components/layouts/header";
import { DataTable } from "@/src/components/table/data-table";
import { useRowHeightLocalStorage } from "@/src/components/table/data-table-row-height-switch";
import { DataTableToolbar } from "@/src/components/table/data-table-toolbar";
@@ -19,7 +18,7 @@ import { verifyAndPrefixScoreDataAgainstKeys } from "@/src/features/scores/compo
import { type ScoreAggregate } from "@langfuse/shared";
import { useIndividualScoreColumns } from "@/src/features/scores/hooks/useIndividualScoreColumns";
import useColumnOrder from "@/src/features/column-visibility/hooks/useColumnOrder";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
+import Page from "@/src/components/layouts/page";
export type PromptVersionTableRow = {
version: number;
@@ -374,15 +373,15 @@ export default function PromptVersionTable() {
: [];
return (
- <FullScreenPage>
- <Header
- title={promptName}
- help={{
+ <Page
+ headerProps={{
+ 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={[
+ },
+ breadcrumb: [
{
name: "Prompts",
href: `/project/${projectId}/prompts/`,
@@ -392,8 +391,8 @@ export default function PromptVersionTable() {
href: `/project/${projectId}/prompts/${encodeURIComponent(promptName)}`,
},
{ name: `Metrics` },
- ]}
- actionButtons={
+ ],
+ actionButtonsLeft: (
<>
<Tabs value="metrics">
<TabsList>
@@ -408,8 +407,9 @@ export default function PromptVersionTable() {
</TabsList>
</Tabs>
</>
- }
- />
+ ),
+ }}
+ >
<div className="gap-3">
<DataTableToolbar
columns={columns}
@@ -451,6 +451,6 @@ export default function PromptVersionTable() {
onColumnOrderChange={setColumnOrder}
rowHeight={rowHeight}
/>
- </FullScreenPage>
+ </Page>
);
}
diff --git a/web/src/pages/project/[projectId]/prompts/index.tsx b/web/src/pages/project/[projectId]/prompts/index.tsx
index 15ea1536bc..a1aa1959b3 100644
--- a/web/src/pages/project/[projectId]/prompts/index.tsx
+++ b/web/src/pages/project/[projectId]/prompts/index.tsx
@@ -1,19 +1,19 @@
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
-import Header from "@/src/components/layouts/header";
+import Page from "@/src/components/layouts/page";
import { PromptTable } from "@/src/features/prompts/components/prompts-table";
export default function Prompts() {
return (
- <FullScreenPage>
- <Header
- title="Prompts"
- help={{
+ <Page
+ headerProps={{
+ title: "Prompts",
+ help: {
description:
"Manage and version your prompts in Langfuse. Edit and update them via the UI and SDK. Retrieve the production version via the SDKs. Learn more in the docs.",
href: "https://langfuse.com/docs/prompts",
- }}
- />
+ },
+ }}
+ >
<PromptTable />
- </FullScreenPage>
+ </Page>
);
}
diff --git a/web/src/pages/project/[projectId]/scores.tsx b/web/src/pages/project/[projectId]/scores.tsx
index 92544bd057..f30456f949 100644
--- a/web/src/pages/project/[projectId]/scores.tsx
+++ b/web/src/pages/project/[projectId]/scores.tsx
@@ -1,24 +1,23 @@
-import Header from "@/src/components/layouts/header";
-
import { useRouter } from "next/router";
import ScoresTable from "@/src/components/table/use-cases/scores";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
+import Page from "@/src/components/layouts/page";
export default function ScoresPage() {
const router = useRouter();
const projectId = router.query.projectId as string;
return (
- <FullScreenPage>
- <Header
- title="Scores"
- help={{
+ <Page
+ headerProps={{
+ title: "Scores",
+ help: {
description:
"A scores is an evaluation of a traces or observations. It can be created from user feedback, model-based evaluations, or manual review. See docs to learn more.",
href: "https://langfuse.com/docs/scores",
- }}
- />
+ },
+ }}
+ >
<ScoresTable projectId={projectId} />
- </FullScreenPage>
+ </Page>
);
}
diff --git a/web/src/pages/project/[projectId]/sessions.tsx b/web/src/pages/project/[projectId]/sessions.tsx
index 4293743063..65ebacf987 100644
--- a/web/src/pages/project/[projectId]/sessions.tsx
+++ b/web/src/pages/project/[projectId]/sessions.tsx
@@ -1,24 +1,23 @@
-import Header from "@/src/components/layouts/header";
import { useRouter } from "next/router";
import SessionsTable from "@/src/components/table/use-cases/sessions";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
+import Page from "@/src/components/layouts/page";
export default function Sessions() {
const router = useRouter();
const projectId = router.query.projectId as string;
return (
- <FullScreenPage>
- <Header
- title="Sessions"
- help={{
+ <Page
+ headerProps={{
+ title: "Sessions",
+ help: {
description:
"A session is a collection of related traces, such as a conversation or thread. To begin, add a sessionId to the trace.",
href: "https://langfuse.com/docs/sessions",
- }}
- />
-
+ },
+ }}
+ >
<SessionsTable projectId={projectId} />
- </FullScreenPage>
+ </Page>
);
}
diff --git a/web/src/pages/project/[projectId]/settings/index.tsx b/web/src/pages/project/[projectId]/settings/index.tsx
index 0424ebc140..1bf4a58e66 100644
--- a/web/src/pages/project/[projectId]/settings/index.tsx
+++ b/web/src/pages/project/[projectId]/settings/index.tsx
@@ -25,6 +25,7 @@ import { AuditLogsSettingsPage } from "@/src/ee/features/audit-log-viewer/AuditL
import { ModelsSettings } from "@/src/features/models/components/ModelSettings";
import ConfigureRetention from "@/src/features/projects/components/ConfigureRetention";
import { env } from "@/src/env.mjs";
+import ContainerPage from "@/src/components/layouts/container-page";
export default function SettingsPage() {
const { project, organization } = useQueryProject();
@@ -33,8 +34,11 @@ export default function SettingsPage() {
const isLangfuseCloud = Boolean(env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION);
if (!project || !organization) return null;
return (
- <div className="lg:container">
- <Header title="Project Settings" />
+ <ContainerPage
+ headerProps={{
+ title: "Project Settings",
+ }}
+ >
<PagedSettingsContainer
activeSlug={router.query.page as string | undefined}
pages={[
@@ -47,7 +51,7 @@ export default function SettingsPage() {
<RenameProject />
{isLangfuseCloud && <ConfigureRetention />}
<div>
- <Header title="Debug Information" level="h3" />
+ <Header title="Debug Information" />
<JSONView
title="Metadata"
json={{
@@ -100,7 +104,7 @@ export default function SettingsPage() {
slug: "members",
content: (
<div>
- <Header title="Project Members" level="h3" />
+ <Header title="Project Members" />
<div>
<MembersTable
orgId={organization.id}
@@ -144,7 +148,7 @@ export default function SettingsPage() {
},
]}
/>
- </div>
+ </ContainerPage>
);
}
@@ -157,7 +161,7 @@ const Integrations = (props: { projectId: string }) => {
return (
<div>
- <Header title="Integrations" level="h3" />
+ <Header title="Integrations" />
<Card className="p-3">
{/* eslint-disable-next-line @next/next/no-img-element */}
<PostHogLogo className="mb-4 w-40 text-foreground" />
diff --git a/web/src/pages/project/[projectId]/settings/integrations/posthog.tsx b/web/src/pages/project/[projectId]/settings/integrations/posthog.tsx
index aba5be1326..64d2d84680 100644
--- a/web/src/pages/project/[projectId]/settings/integrations/posthog.tsx
+++ b/web/src/pages/project/[projectId]/settings/integrations/posthog.tsx
@@ -1,5 +1,7 @@
import { PostHogLogo } from "@/src/components/PosthogLogo";
import Header from "@/src/components/layouts/header";
+import ContainerPage from "@/src/components/layouts/container-page";
+import { StatusBadge } from "@/src/components/layouts/status-badge";
import { Button } from "@/src/components/ui/button";
import {
Form,
@@ -43,28 +45,30 @@ export default function PosthogIntegrationSettings() {
);
if (!entitled) return null;
+ const status =
+ state.isInitialLoading || !hasAccess
+ ? undefined
+ : state.data?.enabled
+ ? "active"
+ : "inactive";
+
return (
- <div className="md:container">
- <Header
- title="PostHog Integration"
- breadcrumb={[
+ <ContainerPage
+ headerProps={{
+ title: "PostHog Integration",
+ breadcrumb: [
{ name: "Settings", href: `/project/${projectId}/settings` },
- ]}
- actionButtons={
+ ],
+ actionButtonsLeft: <>{status && <StatusBadge type={status} />}</>,
+ actionButtonsRight: (
<Button asChild variant="secondary">
<Link href="https://langfuse.com/docs/analytics/posthog">
Integration Docs ↗
</Link>
</Button>
- }
- status={
- state.isInitialLoading || !hasAccess
- ? undefined
- : state.data?.enabled
- ? "active"
- : "inactive"
- }
- />
+ ),
+ }}
+ >
<p className="mb-4 text-sm text-primary">
We have teamed up with{" "}
<Link href="https://posthog.com" className="underline">
@@ -84,7 +88,7 @@ export default function PosthogIntegrationSettings() {
)}
{hasAccess && (
<>
- <Header level="h3" title="Configuration" />
+ <Header title="Configuration" />
<Card className="p-3">
<PostHogLogo className="mb-4 w-36 text-foreground" />
<PostHogIntegrationSettings
@@ -97,7 +101,7 @@ export default function PosthogIntegrationSettings() {
)}
{state.data?.enabled && (
<>
- <Header level="h3" title="Status" className="mt-8" />
+ <Header title="Status" className="mt-8" />
<p className="text-sm text-primary">
Data synced until:{" "}
{state.data?.lastSyncAt
@@ -106,7 +110,7 @@ export default function PosthogIntegrationSettings() {
</p>
</>
)}
- </div>
+ </ContainerPage>
);
}
diff --git a/web/src/pages/project/[projectId]/settings/models/[modelId].tsx b/web/src/pages/project/[projectId]/settings/models/[modelId].tsx
index bc81cea728..ff3eba104a 100644
--- a/web/src/pages/project/[projectId]/settings/models/[modelId].tsx
+++ b/web/src/pages/project/[projectId]/settings/models/[modelId].tsx
@@ -1,7 +1,5 @@
import { useRouter } from "next/router";
import { api } from "@/src/utils/api";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
-import Header from "@/src/components/layouts/header";
import { useHasProjectAccess } from "@/src/features/rbac/utils/checkProjectAccess";
import {
Card,
@@ -22,6 +20,7 @@ import { useMemo } from "react";
import { usePriceUnitMultiplier } from "@/src/features/models/hooks/usePriceUnitMultiplier";
import Generations from "@/src/components/table/use-cases/observations";
import { ArrowTopRightIcon } from "@radix-ui/react-icons";
+import Page from "@/src/components/layouts/page";
export default function ModelDetailPage() {
const router = useRouter();
@@ -65,25 +64,25 @@ export default function ModelDetailPage() {
const isLangfuseModel = !Boolean(model?.projectId);
if (isLoading || !model) {
- return <div>Loading...</div>;
+ return <div className="p-3">Loading...</div>;
}
return (
- <FullScreenPage>
- <Header
- title={model.modelName}
- help={{
+ <Page
+ headerProps={{
+ title: model.modelName,
+ help: {
description: "Model configuration and pricing details",
href: "https://langfuse.com/docs/model-usage-and-cost",
- }}
- breadcrumb={[
+ },
+ breadcrumb: [
{
name: "Models",
href: `/project/${router.query.projectId as string}/settings/models`,
},
{ name: model.modelName },
- ]}
- actionButtons={
+ ],
+ actionButtonsRight: (
<div className="flex gap-2">
{hasWriteAccess &&
(!isLangfuseModel ? (
@@ -101,9 +100,9 @@ export default function ModelDetailPage() {
<CloneModelButton projectId={projectId} modelData={model} />
))}
</div>
- }
- />
-
+ ),
+ }}
+ >
<div className="grid grid-cols-2 gap-6 p-2">
<Card>
<CardHeader>
@@ -203,6 +202,6 @@ export default function ModelDetailPage() {
</CardContent>
</Card>
</div>
- </FullScreenPage>
+ </Page>
);
}
diff --git a/web/src/pages/project/[projectId]/traces.tsx b/web/src/pages/project/[projectId]/traces.tsx
index 567641f889..3816d8695c 100644
--- a/web/src/pages/project/[projectId]/traces.tsx
+++ b/web/src/pages/project/[projectId]/traces.tsx
@@ -1,25 +1,25 @@
-import Header from "@/src/components/layouts/header";
import { useRouter } from "next/router";
import TracesTable from "@/src/components/table/use-cases/traces";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
import SetupTracingButton from "@/src/features/setup/components/SetupTracingButton";
+import Page from "@/src/components/layouts/page";
export default function Traces() {
const router = useRouter();
const projectId = router.query.projectId as string;
return (
- <FullScreenPage>
- <Header
- title="Traces"
- help={{
+ <Page
+ headerProps={{
+ title: "Traces",
+ help: {
description:
"A trace represents a single function/api invocation. Traces contain observations. See docs to learn more.",
href: "https://langfuse.com/docs/tracing",
- }}
- actionButtons={<SetupTracingButton />}
- />
+ },
+ actionButtonsRight: <SetupTracingButton />,
+ }}
+ >
<TracesTable projectId={projectId} />
- </FullScreenPage>
+ </Page>
);
}
diff --git a/web/src/pages/project/[projectId]/users.tsx b/web/src/pages/project/[projectId]/users.tsx
index 4d4f30e1ac..e55d0d117a 100644
--- a/web/src/pages/project/[projectId]/users.tsx
+++ b/web/src/pages/project/[projectId]/users.tsx
@@ -8,8 +8,6 @@ import {
withDefault,
} from "use-query-params";
import { DataTableToolbar } from "@/src/components/table/data-table-toolbar";
-import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
-import Header from "@/src/components/layouts/header";
import { DataTable } from "@/src/components/table/data-table";
import TableLink from "@/src/components/table/table-link";
import { type LangfuseColumnDef } from "@/src/components/table/types";
@@ -24,6 +22,7 @@ import { usersTableCols } from "@/src/server/api/definitions/usersTable";
import { joinTableCoreAndMetrics } from "@/src/components/table/utils/joinTableCoreAndMetrics";
import { useTableDateRange } from "@/src/hooks/useTableDateRange";
import { useDebounce } from "@/src/hooks/useDebounce";
+import Page from "@/src/components/layouts/page";
type RowData = {
userId: string;
@@ -245,15 +244,16 @@ export default function UsersPage() {
];
return (
- <FullScreenPage>
- <Header
- title="Users"
- help={{
+ <Page
+ headerProps={{
+ title: "Users",
+ help: {
description:
"Attribute data in Langfuse to a user by adding a userId to your traces. See docs to learn more.",
href: "https://langfuse.com/docs/user-explorer",
- }}
- />
+ },
+ }}
+ >
<DataTableToolbar
filterColumnDefinition={usersTableCols}
filterState={userFilterState}
@@ -308,6 +308,6 @@ export default function UsersPage() {
state: paginationState,
}}
/>
- </FullScreenPage>
+ </Page>
);
}
diff --git a/web/src/pages/project/[projectId]/users/[userId].tsx b/web/src/pages/project/[projectId]/users/[userId].tsx
index a89eb3ed5a..9e6a93224d 100644
--- a/web/src/pages/project/[projectId]/users/[userId].tsx
+++ b/web/src/pages/project/[projectId]/users/[userId].tsx
@@ -1,5 +1,4 @@
import { useRouter } from "next/router";
-import Header from "@/src/components/layouts/header";
import { api } from "@/src/utils/api";
import TracesTable from "@/src/components/table/use-cases/traces";
import ScoresTable from "@/src/components/table/use-cases/scores";
@@ -11,6 +10,7 @@ import { cn } from "@/src/utils/tailwind";
import { Badge } from "@/src/components/ui/badge";
import { ActionButton } from "@/src/components/ActionButton";
import { LayoutDashboard } from "lucide-react";
+import Page from "@/src/components/layouts/page";
const tabs = ["Traces", "Sessions", "Scores"] as const;
@@ -53,11 +53,12 @@ export default function UserPage() {
};
return (
- <div>
- <Header
- title={`User: ${userId}`}
- breadcrumb={[{ name: "Users", href: `/project/${projectId}/users` }]}
- actionButtons={
+ <Page
+ headerProps={{
+ title: userId,
+ breadcrumb: [{ name: "Users", href: `/project/${projectId}/users` }],
+ itemType: "USER",
+ actionButtonsLeft: (
<>
<ActionButton
href={`/project/${projectId}?filter=user%3Bstring%3B%3B%3D%3B${userId}`} // dashboard filter serialization
@@ -66,85 +67,90 @@ export default function UserPage() {
>
Dashboard
</ActionButton>
- <DetailPageNav
- currentId={encodeURIComponent(userId)}
- path={(entry) =>
- `/project/${projectId}/users/${encodeURIComponent(entry.id)}`
- }
- listKey="users"
- />
</>
- }
- />
-
- {user.data && (
- <div className="my-3 flex flex-wrap gap-2 px-1">
- <Badge variant="outline">
- Observations: {compactNumberFormatter(user.data.totalObservations)}
- </Badge>
- <Badge variant="outline">
- Traces: {compactNumberFormatter(user.data.totalTraces)}
- </Badge>
- <Badge variant="outline">
- Total Tokens: {compactNumberFormatter(user.data.totalTokens)}
- </Badge>
- <Badge variant="outline">
- <span className="flex items-center gap-1">
- Total Cost: {usdFormatter(user.data.sumCalculatedTotalCost)}
- </span>
- </Badge>
- <Badge variant="outline">
- Active:{" "}
- {user.data.firstTrace
- ? `${user.data.firstTrace.toLocaleString()} - ${user.data.lastTrace?.toLocaleString()}`
- : "No traces yet"}
- </Badge>
- </div>
- )}
+ ),
+ actionButtonsRight: (
+ <DetailPageNav
+ currentId={encodeURIComponent(userId)}
+ path={(entry) =>
+ `/project/${projectId}/users/${encodeURIComponent(entry.id)}`
+ }
+ listKey="users"
+ />
+ ),
+ }}
+ >
+ <>
+ {user.data && (
+ <div className="my-3 flex flex-wrap gap-2 px-1">
+ <Badge variant="outline">
+ Observations:{" "}
+ {compactNumberFormatter(user.data.totalObservations)}
+ </Badge>
+ <Badge variant="outline">
+ Traces: {compactNumberFormatter(user.data.totalTraces)}
+ </Badge>
+ <Badge variant="outline">
+ Total Tokens: {compactNumberFormatter(user.data.totalTokens)}
+ </Badge>
+ <Badge variant="outline">
+ <span className="flex items-center gap-1">
+ Total Cost: {usdFormatter(user.data.sumCalculatedTotalCost)}
+ </span>
+ </Badge>
+ <Badge variant="outline">
+ Active:{" "}
+ {user.data.firstTrace
+ ? `${user.data.firstTrace.toLocaleString()} - ${user.data.lastTrace?.toLocaleString()}`
+ : "No traces yet"}
+ </Badge>
+ </div>
+ )}
- <div className="my-3 border-t border-border" />
+ <div className="my-3 border-t border-border" />
- <div>
- <div className="sm:hidden">
- <label htmlFor="tabs" className="sr-only">
- Select a tab
- </label>
- <select
- id="tabs"
- name="tabs"
- className="block w-full rounded-md border-border bg-background py-1 pl-3 pr-10 text-base text-foreground focus:outline-none sm:text-sm"
- defaultValue={currentTab}
- onChange={(e) => handleTabChange(e.currentTarget.value)}
- >
- {tabs.map((tab) => (
- <option key={tab}>{tab}</option>
- ))}
- </select>
- </div>
- <div className="hidden sm:block">
- <div className="border-b border-border">
- <nav className="-mb-px flex space-x-8" aria-label="Tabs">
+ <div>
+ <div className="sm:hidden">
+ <label htmlFor="tabs" className="sr-only">
+ Select a tab
+ </label>
+ <select
+ id="tabs"
+ name="tabs"
+ className="block w-full rounded-md border-border bg-background py-1 pl-3 pr-10 text-base text-foreground focus:outline-none sm:text-sm"
+ defaultValue={currentTab}
+ onChange={(e) => handleTabChange(e.currentTarget.value)}
+ >
{tabs.map((tab) => (
- <button
- key={tab}
- className={cn(
- tab === currentTab
- ? "border-primary-accent text-primary-accent"
- : "border-transparent text-muted-foreground hover:border-border hover:text-primary",
- "whitespace-nowrap border-b-2 px-1 py-4 text-sm font-medium",
- )}
- aria-current={tab === currentTab ? "page" : undefined}
- onClick={() => handleTabChange(tab)}
- >
- {tab}
- </button>
+ <option key={tab}>{tab}</option>
))}
- </nav>
+ </select>
+ </div>
+ <div className="hidden sm:block">
+ <div className="border-b border-border">
+ <nav className="-mb-px flex space-x-8" aria-label="Tabs">
+ {tabs.map((tab) => (
+ <button
+ key={tab}
+ className={cn(
+ tab === currentTab
+ ? "border-primary-accent text-primary-accent"
+ : "border-transparent text-muted-foreground hover:border-border hover:text-primary",
+ "whitespace-nowrap border-b-2 px-1 py-4 text-sm font-medium",
+ )}
+ aria-current={tab === currentTab ? "page" : undefined}
+ onClick={() => handleTabChange(tab)}
+ >
+ {tab}
+ </button>
+ ))}
+ </nav>
+ </div>
</div>
</div>
{renderTabContent()}
- </div>
- </div>
+ </>
+ </Page>
);
}
diff --git a/web/src/pages/trace/[traceId].tsx b/web/src/pages/trace/[traceId].tsx
index 0e8cef6781..0b15cf4854 100644
--- a/web/src/pages/trace/[traceId].tsx
+++ b/web/src/pages/trace/[traceId].tsx
@@ -49,7 +49,7 @@ const TraceRedirectPage = ({
}) => {
const router = useRouter();
if (router.isFallback) {
- return <div>Loading...</div>;
+ return <div className="p-3">Loading...</div>;
}
if (notFound) {
diff --git a/web/src/styles/globals.css b/web/src/styles/globals.css
index e3744f9e92..2b3e533401 100644
--- a/web/src/styles/globals.css
+++ b/web/src/styles/globals.css
@@ -59,11 +59,11 @@
--accent-light-blue: 251 95.2% 91.8%;
--accent-dark-blue: 224 76.3% 38%;
--radius: 0.5rem;
- --sidebar-background: 0 0% 98%;
+ --sidebar-background: 0 0% 100%;
--sidebar-foreground: 240 5.3% 26.1%;
--sidebar-primary: 240 5.9% 10%;
--sidebar-primary-foreground: 0 0% 98%;
- --sidebar-accent: 240 4.8% 95.9%;
+ --sidebar-accent: 210 40% 96.9%;
--sidebar-accent-foreground: 240 5.9% 10%;
--sidebar-border: 220 13% 91%;
--sidebar-ring: 217.2 91.2% 59.8%;
@@ -127,8 +127,8 @@
--radius: 0.5rem;
- --sidebar-background: 222.2 84% 4.4%;
- --sidebar-foreground: 210 40% 86%;
+ --sidebar-background: 222.2 84% 4.9%;
+ --sidebar-foreground: 210 40% 83%;
--sidebar-primary: 210 40% 81%;
--sidebar-primary-foreground: 222.2 47.4% 10.2%;
--sidebar-accent: 217.2 32.6% 16.5%;