Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.
TypeScript agent-harnessagent-harness-engineeringai-engineeringai-observabilityamd-gpuclaude-codeclickhousecodexcoding-agentcoding-agentscursorgenaigpu-monitoringllm-observabilityllmopsnvidia-smiobservabilityopen-sourceopenaiopentelemetry
feat(client): refresh auth screen, session-aware error pages, and founder call card (#1677)
Aman Agarwalec1560216b17
diff --git a/src/client/src/__tests__/components/founder-call-card.test.tsx b/src/client/src/__tests__/components/founder-call-card.test.tsxnew file mode 100644index 00000000..7045c9ad--- /dev/null+++ b/src/client/src/__tests__/components/founder-call-card.test.tsx@@ -0,0 +1,97 @@+import { fireEvent, render, screen } from "@testing-library/react";+import FounderCallCard, {+ FOUNDER_CARD_DISMISSED_KEY,+ hasPaidFeatureAccess,+} from "@/components/(playground)/sidebar/founder-call-card";+import getMessage from "@/constants/messages";+import { CLIENT_EVENTS } from "@/constants/events";++const mockAccess = {+ accessByAccountId: {} as Record<string, Record<string, boolean>>,+ selectedAccountId: "",+};+let mockExpanded = true;++const mockCapture = jest.fn();+jest.mock("posthog-js/react", () => ({+ usePostHog: () => ({ capture: mockCapture }),+}));++jest.mock("@/components/enterprise-feature-access-provider", () => ({+ useEnterpriseFeatureAccess: () => mockAccess,+}));++jest.mock("@/components/(playground)/sidebar-layout-context", () => ({+ useSidebarLayout: () => ({ isExpanded: mockExpanded }),+}));++const m = getMessage();++describe("hasPaidFeatureAccess", () => {+ it("is false with no access entries", () => {+ expect(hasPaidFeatureAccess({}, "")).toBe(false);+ expect(hasPaidFeatureAccess({ org: { a: false } }, "org")).toBe(false);+ });++ it("is true when the selected account has any granted feature", () => {+ expect(hasPaidFeatureAccess({ org: { a: false, b: true } }, "org")).toBe(true);+ expect(hasPaidFeatureAccess({ org: { a: true } }, "other")).toBe(false);+ });+});++describe("FounderCallCard", () => {+ beforeEach(() => {+ window.localStorage.clear();+ mockAccess.accessByAccountId = {};+ mockAccess.selectedAccountId = "";+ mockExpanded = true;+ });++ it("renders when no license is applied", () => {+ render(<FounderCallCard />);+ expect(screen.getByText(m.FOUNDER_CARD_BADGE)).toBeInTheDocument();+ expect(screen.getByRole("link", { name: new RegExp(m.FOUNDER_CARD_CTA) })).toHaveAttribute(+ "target",+ "_blank"+ );+ });++ it("captures an event when the schedule call link is clicked", () => {+ mockCapture.mockClear();+ render(<FounderCallCard />);+ fireEvent.click(screen.getByRole("link", { name: new RegExp(m.FOUNDER_CARD_CTA) }));+ expect(mockCapture).toHaveBeenCalledWith(CLIENT_EVENTS.FOUNDER_CALL_SCHEDULE_CLICKED);+ });++ it("is hidden when the selected organisation has a paid feature", () => {+ mockAccess.accessByAccountId = { org: { feature: true } };+ mockAccess.selectedAccountId = "org";+ render(<FounderCallCard />);+ expect(screen.queryByText(m.FOUNDER_CARD_BADGE)).not.toBeInTheDocument();+ });++ it("is hidden when the sidebar is collapsed", () => {+ mockExpanded = false;+ render(<FounderCallCard />);+ expect(screen.queryByText(m.FOUNDER_CARD_BADGE)).not.toBeInTheDocument();+ });++ it("dismisses and stays dismissed", () => {+ const { unmount } = render(<FounderCallCard />);+ fireEvent.click(screen.getByRole("button", { name: m.FOUNDER_CARD_DISMISS }));+ expect(screen.queryByText(m.FOUNDER_CARD_BADGE)).not.toBeInTheDocument();+ expect(window.localStorage.getItem(FOUNDER_CARD_DISMISSED_KEY)).not.toBeNull();+ unmount();+ render(<FounderCallCard />);+ expect(screen.queryByText(m.FOUNDER_CARD_BADGE)).not.toBeInTheDocument();+ });++ it("shows again after the dismissal window expires", () => {+ window.localStorage.setItem(+ FOUNDER_CARD_DISMISSED_KEY,+ String(Date.now() - 31 * 24 * 60 * 60 * 1000)+ );+ render(<FounderCallCard />);+ expect(screen.getByText(m.FOUNDER_CARD_BADGE)).toBeInTheDocument();+ });+});diff --git a/src/client/src/app/(auth)/error.tsx b/src/client/src/app/(auth)/error.tsxnew file mode 100644index 00000000..6cdcc7a2--- /dev/null+++ b/src/client/src/app/(auth)/error.tsx@@ -0,0 +1,19 @@+"use client";+import { useEffect } from "react";+import { ServerErrorCard } from "@/components/common/error-page";++export default function AuthError({+ error,+ reset,+}: {+ error: Error & { digest?: string };+ reset: () => void;+}) {+ useEffect(() => {+ console.error(error);+ }, [error]);++ return (+ <ServerErrorCard loggedIn={false} reference={error.digest} onRetry={reset} />+ );+}diff --git a/src/client/src/app/(auth)/layout.tsx b/src/client/src/app/(auth)/layout.tsxindex 3242d311..a3236eab 100644--- a/src/client/src/app/(auth)/layout.tsx+++ b/src/client/src/app/(auth)/layout.tsx@@ -1,6 +1,5 @@-import AuthFormContainer from "@/components/(auth)/auth-form-container";+import AuthShell from "@/components/(auth)/auth-shell";import AutoSignInDemoInstance from "../../components/(auth)/auto-signin-demo-instance";-import AuthDetailsCarousel from "@/components/(auth)/auth-details-carousel";import CustomPostHogProvider from "@/components/(playground)/posthog";export default function AuthLayout({@@ -12,14 +11,11 @@ export default function AuthLayout({return (<CustomPostHogProvider telemetryEnabled={telemetryEnabled}>- <div className="min-h-screen grid lg:grid-cols-2 bg-white dark:bg-stone-950">- <AuthDetailsCarousel />- <AuthFormContainer>- <AutoSignInDemoInstance demoCreds={{ email: process.env.DEMO_ACCOUNT_EMAIL, password: process.env.DEMO_ACCOUNT_PASSWORD }}>- {children}- </AutoSignInDemoInstance>- </AuthFormContainer>- </div>+ <AuthShell>+ <AutoSignInDemoInstance demoCreds={{ email: process.env.DEMO_ACCOUNT_EMAIL, password: process.env.DEMO_ACCOUNT_PASSWORD }}>+ {children}+ </AutoSignInDemoInstance>+ </AuthShell></CustomPostHogProvider>);}diff --git a/src/client/src/app/(auth)/login/page.tsx b/src/client/src/app/(auth)/login/page.tsxindex 2660a487..37f579c7 100644--- a/src/client/src/app/(auth)/login/page.tsx+++ b/src/client/src/app/(auth)/login/page.tsx@@ -1,6 +1,7 @@"use client";import { Suspense, useEffect } from "react";import { AuthForm } from "@/components/(auth)/auth-form";+import AuthFormContainer from "@/components/(auth)/auth-form-container";import { usePostHog } from "posthog-js/react";import { CLIENT_EVENTS } from "@/constants/events";@@ -12,8 +13,10 @@ export default function Login() {}, []);return (- <Suspense fallback={null}>- <AuthForm type={"login"} />- </Suspense>+ <AuthFormContainer>+ <Suspense fallback={null}>+ <AuthForm type={"login"} />+ </Suspense>+ </AuthFormContainer>);}diff --git a/src/client/src/app/(auth)/register/page.tsx b/src/client/src/app/(auth)/register/page.tsxindex b1bf8822..f161ffc3 100644--- a/src/client/src/app/(auth)/register/page.tsx+++ b/src/client/src/app/(auth)/register/page.tsx@@ -1,6 +1,7 @@"use client";import { Suspense, useEffect } from "react";import { AuthForm } from "@/components/(auth)/auth-form";+import AuthFormContainer from "@/components/(auth)/auth-form-container";import { usePostHog } from "posthog-js/react";import { CLIENT_EVENTS } from "@/constants/events";@@ -12,8 +13,10 @@ export default function Register() {}, []);return (- <Suspense fallback={null}>- <AuthForm type={"register"} />- </Suspense>+ <AuthFormContainer>+ <Suspense fallback={null}>+ <AuthForm type={"register"} />+ </Suspense>+ </AuthFormContainer>);}diff --git a/src/client/src/app/(playground)/error.tsx b/src/client/src/app/(playground)/error.tsxnew file mode 100644index 00000000..4a8738e7--- /dev/null+++ b/src/client/src/app/(playground)/error.tsx@@ -0,0 +1,21 @@+"use client";+import { useEffect } from "react";+import { DashboardErrorFrame, ServerErrorCard } from "@/components/common/error-page";++export default function PlaygroundError({+ error,+ reset,+}: {+ error: Error & { digest?: string };+ reset: () => void;+}) {+ useEffect(() => {+ console.error(error);+ }, [error]);++ return (+ <DashboardErrorFrame>+ <ServerErrorCard loggedIn reference={error.digest} onRetry={reset} />+ </DashboardErrorFrame>+ );+}diff --git a/src/client/src/app/error.tsx b/src/client/src/app/error.tsxnew file mode 100644index 00000000..e5e027a6--- /dev/null+++ b/src/client/src/app/error.tsx@@ -0,0 +1,32 @@+"use client";+import { useEffect } from "react";+import { useSession } from "next-auth/react";+import AuthShell from "@/components/(auth)/auth-shell";+import { ServerErrorCard } from "@/components/common/error-page";+import getMessage from "@/constants/messages";++// Also catches failures in the (playground) layout itself, so this page cannot+// re-render the dashboard shell and always uses the standalone auth shell.+export default function RootError({+ error,+ reset,+}: {+ error: Error & { digest?: string };+ reset: () => void;+}) {+ const { status } = useSession();++ useEffect(() => {+ console.error(error);+ }, [error]);++ return (+ <AuthShell pageLabel={getMessage().ERROR_PAGE_SERVER_ERROR_LABEL}>+ <ServerErrorCard+ loggedIn={status === "authenticated"}+ reference={error.digest}+ onRetry={reset}+ />+ </AuthShell>+ );+}diff --git a/src/client/src/app/not-found.tsx b/src/client/src/app/not-found.tsxindex 8946fe94..7fba0eb5 100644--- a/src/client/src/app/not-found.tsx+++ b/src/client/src/app/not-found.tsx@@ -1,54 +1,25 @@-import Link from 'next/link'-import Confetti from '@/components/common/confetti'-import AuthDetailsCarousel from '@/components/(auth)/auth-details-carousel'-import { Button } from '@/components/ui/button'-import { GithubIcon, MoveRightIcon } from 'lucide-react'+import PlaygroundLayout from "@/app/(playground)/layout";+import AuthShell from "@/components/(auth)/auth-shell";+import { DashboardErrorFrame, NotFoundCard } from "@/components/common/error-page";+import getMessage from "@/constants/messages";+import { getCurrentUser } from "@/lib/session";-export default function NotFound() {- return (- <div className="min-h-screen grid lg:grid-cols-2 bg-white dark:bg-white">- <AuthDetailsCarousel />- <div className="flex flex-col justify-center p-8 lg:p-16 bg-stone-50 relative">- <Confetti />- <div className="flex flex-col w-full max-w-sm mx-auto gap-12 z-10">- <div className="text-center">- <h1 className="text-4xl font-bold tracking-tight text-primary">- 404 – Bug or Feature?- </h1>- <p className="text-stone-600">- This page drifted outside our observability zone. Let's head back to reality.- </p>- </div>- <div className="flex flex-col items-center justify-center space-y-4 text-center">- <Link href="/" className="text-primary font-bold">- Return to Dashboard- </Link>- </div>- <div className="grid grid-cols-2 text-center text-sm">- <Link- href={"https://github.com/openlit/openlit"}- target="_blank"- className="w-full"- >- <Button- className={`w-full rounded-full gap-2 font-bold bg-stone-900 text-stone-50 hover:bg-stone-900/90 dark:bg-stone-900 dark:text-stone-50 dark:hover:bg-stone-900/90`}- >- Github- <GithubIcon className="ml-2 w-4" />- </Button>- </Link>- <Link- href="https://docs.openlit.io/latest/overview"- target="_blank"- >- <Button variant={"ghost"} className="hover:bg-stone-100 hover:text-stone-900 dark:hover:bg-stone-100 dark:hover:text-stone-900">- <b>Documentation</b>- <MoveRightIcon className="ml-2 h-5 w-5" />- </Button>- </Link>- </div>- </div>- </div>- </div>- )-}\ No newline at end of file+export default async function NotFound() {+ const user = await getCurrentUser();++ if (user) {+ return (+ <PlaygroundLayout>+ <DashboardErrorFrame>+ <NotFoundCard loggedIn />+ </DashboardErrorFrame>+ </PlaygroundLayout>+ );+ }++ return (+ <AuthShell pageLabel={getMessage().ERROR_PAGE_NOT_FOUND_LABEL}>+ <NotFoundCard loggedIn={false} />+ </AuthShell>+ );+}diff --git a/src/client/src/components/(auth)/auth-details-carousel.tsx b/src/client/src/components/(auth)/auth-details-carousel.tsxdeleted file mode 100644index 4c121562..00000000--- a/src/client/src/components/(auth)/auth-details-carousel.tsx+++ /dev/null@@ -1,82 +0,0 @@-import Image from "next/image";-import getMessage from "@/constants/messages";-import {- Activity,- Bot,- CircleDollarSign,- KeyRound,- MessageSquareText,- MonitorCog,-} from "lucide-react";--const featureIcons = [- Activity,- MonitorCog,- MessageSquareText,- Bot,- KeyRound,- CircleDollarSign,-];--const featureKeys = [- { title: "AUTH_FEATURE_TRACING", desc: "AUTH_FEATURE_TRACING_DESC" },- { title: "AUTH_FEATURE_EVALS", desc: "AUTH_FEATURE_EVALS_DESC" },- { title: "AUTH_FEATURE_PROMPT_HUB", desc: "AUTH_FEATURE_PROMPT_HUB_DESC" },- { title: "AUTH_FEATURE_AGENTS", desc: "AUTH_FEATURE_AGENTS_DESC" },- { title: "AUTH_FEATURE_VAULT", desc: "AUTH_FEATURE_VAULT_DESC" },- { title: "AUTH_FEATURE_ANALYTICS", desc: "AUTH_FEATURE_ANALYTICS_DESC" },-] as const;--export default function AuthDetailsCarousel() {- const messages = getMessage();- return (- <div className="relative hidden min-h-screen flex-col justify-between overflow-hidden bg-stone-950 p-10 text-stone-100 lg:flex xl:p-14">- <div- aria-hidden- className="pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_at_top_left,rgba(243,108,6,0.22),transparent_58%)]"- />- <div className="relative flex items-center gap-3">- <Image- src="/images/logo.png"- alt=""- width="32"- height="32"- className="object-cover"- />- <span className="text-base font-semibold tracking-tight">OpenLIT</span>- </div>-- <div className="relative max-w-full">- <p className="text-xs font-medium uppercase tracking-[0.18em] text-primary">- {messages.AUTH_PANEL_EYEBROW}- </p>- <h2 className="mt-4 text-3xl font-semibold tracking-tight text-white xl:text-4xl">- {messages.AUTH_PANEL_TITLE}- </h2>- <p className="mt-4 text-sm leading-6 text-stone-400">- {messages.AUTH_PANEL_BODY}- </p>- <ul className="mt-10 space-y-5">- {featureKeys.map((feature, index) => {- const Icon = featureIcons[index];- return (- <li key={feature.title} className="flex items-start gap-3">- <Icon className="mt-0.5 size-4 shrink-0 text-primary" />- <div className="min-w-0">- <p className="text-sm font-medium text-stone-100">- {messages[feature.title]}- </p>- <p className="mt-0.5 text-sm leading-5 text-stone-400">- {messages[feature.desc]}- </p>- </div>- </li>- );- })}- </ul>- </div>-- <p className="relative text-xs text-stone-500">{messages.AUTH_FOOTER}</p>- </div>- );-}diff --git a/src/client/src/components/(auth)/auth-form-container.tsx b/src/client/src/components/(auth)/auth-form-container.tsxindex cabecd08..502c5043 100644--- a/src/client/src/components/(auth)/auth-form-container.tsx+++ b/src/client/src/components/(auth)/auth-form-container.tsx@@ -1,47 +1,4 @@-"use client";-import type { ReactNode } from "react";-import { BookOpen, GithubIcon, Phone } from "lucide-react";-import Image from "next/image";import getMessage from "@/constants/messages";-import { FOUNDER_SCHEDULE_URL } from "@/constants/external-links";-import {- Tooltip,- TooltipContent,- TooltipProvider,- TooltipTrigger,-} from "@/components/ui/tooltip";--const authActionClassName =- "inline-flex h-10 w-full items-center justify-center rounded-md border border-stone-200 bg-stone-50 text-stone-700 transition-colors hover:bg-stone-100 hover:text-stone-950 dark:border-stone-700 dark:bg-stone-900 dark:text-stone-200 dark:hover:bg-stone-800";--function AuthIconLink({- href,- label,- children,-}: {- href: string;- label: string;- children: ReactNode;-}) {- return (- <Tooltip>- <TooltipTrigger asChild>- <a- href={href}- target="_blank"- rel="noopener noreferrer"- aria-label={label}- className={authActionClassName}- >- {children}- </a>- </TooltipTrigger>- <TooltipContent side="bottom" className="text-xs">- <p>{label}</p>- </TooltipContent>- </Tooltip>- );-}export default function AuthFormContainer({children,@@ -49,54 +6,21 @@ export default function AuthFormContainer({children: JSX.Element;}) {const m = getMessage();+return (- <div className="relative flex min-h-screen flex-col justify-center overflow-hidden bg-stone-100 px-6 py-12 dark:bg-stone-900 sm:px-10">- <div- aria-hidden- className="pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_at_top_right,rgba(243,108,6,0.12),transparent_52%)]"- />- <div className="relative mx-auto flex w-full max-w-lg flex-col rounded-xl border border-stone-200 bg-white p-8 shadow-sm dark:border-stone-800 dark:bg-stone-950">- <div className="mb-8 flex items-center gap-2.5 lg:hidden">- <Image- src="/images/logo.png"- alt=""- width="28"- height="28"- className="object-cover"- />- <span className="text-sm font-semibold text-stone-900 dark:text-stone-100">- OpenLIT- </span>- </div>- <div>- <h1 className="text-2xl font-semibold tracking-tight text-stone-950 dark:text-stone-50">- {m.AUTH_WELCOME}- </h1>- <p className="mt-2 text-sm leading-6 text-stone-500 dark:text-stone-400">- {m.AUTH_SUBTITLE}- </p>- </div>- <div className="mt-8">{children}</div>- <TooltipProvider>- <div className="mt-8 grid grid-cols-3 gap-2 border-t border-stone-200 pt-6 dark:border-stone-800">- <AuthIconLink href={FOUNDER_SCHEDULE_URL} label={m.TALK_TO_FOUNDER}>- <Phone className="size-4" />- </AuthIconLink>- <AuthIconLink- href="https://github.com/openlit/openlit"- label={m.AUTH_GITHUB}- >- <GithubIcon className="size-4" />- </AuthIconLink>- <AuthIconLink- href="https://docs.openlit.io/latest/overview"- label={m.AUTH_DOCUMENTATION}- >- <BookOpen className="size-4" />- </AuthIconLink>- </div>- </TooltipProvider>+ <>+ <div className="rounded-xl border border-stone-200 bg-white p-6 shadow-sm dark:border-stone-800 dark:bg-stone-950 sm:p-8">+ <h1 className="text-2xl font-semibold tracking-tight text-stone-950 dark:text-stone-50">+ {m.AUTH_WELCOME}+ </h1>+ <p className="mt-1.5 text-sm leading-6 text-stone-500 dark:text-stone-400">+ {m.AUTH_SUBTITLE}+ </p>+ <div className="mt-6">{children}</div></div>- </div>+ <p className="mt-4 text-center font-mono text-[10px] uppercase tracking-wider font-semibold text-stone-500 dark:text-stone-500">+ {m.AUTH_FOOTER}+ </p>+ </>);}diff --git a/src/client/src/components/(auth)/auth-shell.tsx b/src/client/src/components/(auth)/auth-shell.tsxnew file mode 100644index 00000000..5351fd6b--- /dev/null+++ b/src/client/src/components/(auth)/auth-shell.tsx@@ -0,0 +1,111 @@+"use client";+import type { ReactNode } from "react";+import { BookOpen, GithubIcon, Phone } from "lucide-react";+import Image from "next/image";+import { usePathname } from "next/navigation";+import getMessage from "@/constants/messages";+import { FOUNDER_SCHEDULE_URL } from "@/constants/external-links";+import CheckeredBackground from "@/components/common/checkered-background";+import {+ Tooltip,+ TooltipContent,+ TooltipProvider,+ TooltipTrigger,+} from "@/components/ui/tooltip";++const authActionClassName =+ "inline-flex size-8 items-center justify-center rounded-md border border-stone-200 bg-white text-stone-600 transition-colors hover:bg-stone-100 hover:text-stone-950 dark:border-stone-800 dark:bg-stone-950 dark:text-stone-300 dark:hover:bg-stone-900 dark:hover:text-white";++function AuthIconLink({+ href,+ label,+ children,+}: {+ href: string;+ label: string;+ children: ReactNode;+}) {+ return (+ <Tooltip>+ <TooltipTrigger asChild>+ <a+ href={href}+ target="_blank"+ rel="noopener noreferrer"+ aria-label={label}+ className={authActionClassName}+ >+ {children}+ </a>+ </TooltipTrigger>+ <TooltipContent side="bottom" className="text-xs">+ <p>{label}</p>+ </TooltipContent>+ </Tooltip>+ );+}++export default function AuthShell({+ children,+ pageLabel,+}: {+ children: ReactNode;+ pageLabel?: string;+}) {+ const m = getMessage();+ const pathname = usePathname();+ const label =+ pageLabel ??+ (pathname?.startsWith("/register") ? m.AUTH_SIGN_UP : m.AUTH_SIGN_IN);++ return (+ <div className="flex h-[100dvh] w-full flex-col overflow-hidden bg-white pt-[env(safe-area-inset-top)] dark:bg-stone-950 md:pt-0">+ <header className="flex h-14 shrink-0 items-center justify-between gap-4 border-b border-stone-200 bg-white px-4 dark:border-stone-800 dark:bg-stone-950 sm:px-6">+ <div className="flex min-w-0 items-center gap-3">+ <div className="flex items-center gap-2">+ <Image+ src="/images/logo.png"+ alt=""+ width="28"+ height="28"+ className="size-7 shrink-0 object-contain"+ />+ <span className="text-base font-semibold text-stone-950 dark:text-white">+ OpenLIT+ </span>+ </div>+ <span className="text-xs text-stone-400 dark:text-stone-600">/</span>+ <span className="truncate text-xs font-semibold text-stone-950 dark:text-white">+ {label}+ </span>+ </div>+ <TooltipProvider>+ <div className="flex items-center gap-1.5">+ <AuthIconLink href={FOUNDER_SCHEDULE_URL} label={m.TALK_TO_FOUNDER}>+ <Phone className="size-3.5" />+ </AuthIconLink>+ <AuthIconLink+ href="https://github.com/openlit/openlit"+ label={m.AUTH_GITHUB}+ >+ <GithubIcon className="size-3.5" />+ </AuthIconLink>+ <AuthIconLink+ href="https://docs.openlit.io/latest/overview"+ label={m.AUTH_DOCUMENTATION}+ >+ <BookOpen className="size-3.5" />+ </AuthIconLink>+ </div>+ </TooltipProvider>+ </header>++ <main className="relative min-h-0 flex-1 overflow-hidden">+ <CheckeredBackground />+ <div className="absolute inset-0 flex flex-col items-center overflow-y-auto overflow-x-hidden px-4 py-10 sm:px-6">+ <div className="relative my-auto w-full max-w-md">{children}</div>+ </div>+ </main>+ </div>+ );+}diff --git a/src/client/src/components/(playground)/sidebar/founder-call-card.tsx b/src/client/src/components/(playground)/sidebar/founder-call-card.tsxnew file mode 100644index 00000000..74f6f678--- /dev/null+++ b/src/client/src/components/(playground)/sidebar/founder-call-card.tsx@@ -0,0 +1,100 @@+"use client";++import { useEffect, useState } from "react";+import { ArrowUpRight, Phone, X } from "lucide-react";+import { usePostHog } from "posthog-js/react";+import Otter from "@/components/svg/otter";+import { useEnterpriseFeatureAccess } from "@/components/enterprise-feature-access-provider";+import { useSidebarLayout } from "@/components/(playground)/sidebar-layout-context";+import getMessage from "@/constants/messages";+import { FOUNDER_SCHEDULE_URL } from "@/constants/external-links";+import { CLIENT_EVENTS } from "@/constants/events";++export const FOUNDER_CARD_DISMISSED_KEY = "openlit:founder-card-dismissed-at";+const DISMISS_DURATION_MS = 2 * 24 * 60 * 60 * 1000;++type AccessByAccountId = Record<string, Record<string, boolean | undefined> | undefined>;++// The access map only lists paid features, so any granted entry means a license is applied.+export function hasPaidFeatureAccess(+ accessByAccountId: AccessByAccountId,+ accountId: string+): boolean {+ return Object.values(accessByAccountId[accountId] ?? {}).some(Boolean);+}++function isDismissed(): boolean {+ const dismissedAt = Number(window.localStorage.getItem(FOUNDER_CARD_DISMISSED_KEY));+ return Number.isFinite(dismissedAt) && Date.now() - dismissedAt < DISMISS_DURATION_MS;+}++export default function FounderCallCard() {+ const m = getMessage();+ const posthog = usePostHog();+ const { isExpanded } = useSidebarLayout();+ const { accessByAccountId, selectedAccountId } = useEnterpriseFeatureAccess();+ const [visible, setVisible] = useState(false);+ const licensed = hasPaidFeatureAccess(+ accessByAccountId as AccessByAccountId,+ selectedAccountId+ );++ useEffect(() => {+ setVisible(!isDismissed());+ }, []);++ if (!visible || licensed || !isExpanded) return null;++ const dismiss = () => {+ window.localStorage.setItem(FOUNDER_CARD_DISMISSED_KEY, String(Date.now()));+ setVisible(false);+ };++ return (+ <div className="relative mx-2 mb-2 shrink-0 overflow-hidden rounded-xl border border-stone-800 bg-stone-950 p-3 text-white shadow-lg shadow-primary/10">+ <div+ aria-hidden+ className="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_100%_0%,rgba(243,108,6,0.45),transparent_55%)]"+ />+ <div+ aria-hidden+ className="pointer-events-none absolute inset-0 opacity-40 [background-image:linear-gradient(to_right,rgba(168,162,158,0.12)_1px,transparent_1px),linear-gradient(to_bottom,rgba(168,162,158,0.12)_1px,transparent_1px)] [background-size:16px_16px] [mask-image:linear-gradient(to_bottom,black,transparent)]"+ />+ <Otter className="pointer-events-none absolute -right-3 -top-2 size-16 rotate-12 text-primary/80" />+ <div className="relative">+ <div className="flex items-center gap-1.5">+ <span className="inline-flex items-center gap-1 rounded-full border border-primary/40 bg-primary/15 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-primary">+ <Phone className="size-3" />+ {m.FOUNDER_CARD_BADGE}+ </span>+ </div>+ <p className="mt-2.5 pr-10 text-sm font-semibold leading-5 tracking-tight">+ {m.FOUNDER_CARD_TITLE}+ </p>+ <p className="mt-1 text-xs leading-5 text-stone-400">+ {m.FOUNDER_CARD_BODY}+ </p>+ <div className="mt-3 flex items-center gap-1.5">+ <a+ href={FOUNDER_SCHEDULE_URL}+ target="_blank"+ rel="noopener noreferrer"+ onClick={() => posthog?.capture(CLIENT_EVENTS.FOUNDER_CALL_SCHEDULE_CLICKED)}+ className="inline-flex h-8 flex-1 items-center justify-center gap-1 rounded-md bg-primary text-xs font-semibold text-white transition-colors hover:bg-primary/90"+ >+ {m.FOUNDER_CARD_CTA}+ <ArrowUpRight className="size-3.5" />+ </a>+ <button+ type="button"+ onClick={dismiss}+ aria-label={m.FOUNDER_CARD_DISMISS}+ className="inline-flex size-8 shrink-0 items-center justify-center rounded-md border border-stone-800 text-stone-400 transition-colors hover:bg-stone-800 hover:text-white"+ >+ <X className="size-3.5" />+ </button>+ </div>+ </div>+ </div>+ );+}diff --git a/src/client/src/components/(playground)/sidebar/index.tsx b/src/client/src/components/(playground)/sidebar/index.tsxindex 3818384f..375aba26 100644--- a/src/client/src/components/(playground)/sidebar/index.tsx+++ b/src/client/src/components/(playground)/sidebar/index.tsx@@ -37,6 +37,7 @@ import UserActions from "./user-actions";import OtterSidebar from "./otter-sidebar";import ThemeToggleSwitch from "./theme-switch";import MyApps from "./my-apps";+import FounderCallCard from "./founder-call-card";import { useSidebarLayout } from "../sidebar-layout-context";const isActive = (pathname: string, item: SidebarActionItem, currentUrl: string) => {@@ -285,6 +286,7 @@ export default function Sidebar() {onNavigate={() => setOpenSection(null)}/></nav>}+ <FounderCallCard /><div className="border-t border-stone-200 p-2 dark:border-stone-800"><UserActions /></div></div>{openSection && <SectionPanel section={openSection} pathname={pathname} currentUrl={currentUrl} onClose={() => setOpenSection(null)} />}diff --git a/src/client/src/components/common/checkered-background.tsx b/src/client/src/components/common/checkered-background.tsxnew file mode 100644index 00000000..e5225d5e--- /dev/null+++ b/src/client/src/components/common/checkered-background.tsx@@ -0,0 +1,40 @@+import { cn } from "@/lib/utils";++const CHECKER_SIZE = 32;++const checkerSparkle = encodeURIComponent(+ `<svg xmlns="http://www.w3.org/2000/svg" width="${CHECKER_SIZE}" height="${CHECKER_SIZE}"><path d="M16 12.5Q16.5 15.5 19.5 16Q16.5 16.5 16 19.5Q15.5 16.5 12.5 16Q15.5 15.5 16 12.5Z" fill="rgba(168,162,158,0.25)"/></svg>`+);++const checkeredBackgroundStyle = {+ backgroundImage: `url("data:image/svg+xml,${checkerSparkle}"), linear-gradient(to right, rgba(168,162,158,0.11) 1px, transparent 1px), linear-gradient(to bottom, rgba(168,162,158,0.05) 1px, transparent 1px)`,+ backgroundSize: `${CHECKER_SIZE}px ${CHECKER_SIZE}px`,+ backgroundPosition: `-${CHECKER_SIZE / 2 - 0.5}px -${CHECKER_SIZE / 2 - 0.5}px, 0 0, 0 0`,+};++const fadeClassNames = {+ white:+ "bg-[radial-gradient(ellipse_at_center,transparent_55%,white_100%)] dark:bg-[radial-gradient(ellipse_at_center,transparent_55%,rgb(12,10,9)_100%)]",+ stone:+ "bg-[radial-gradient(ellipse_at_center,transparent_55%,rgb(250,250,249)_100%)] dark:bg-[radial-gradient(ellipse_at_center,transparent_55%,rgb(12,10,9)_100%)]",+};++export default function CheckeredBackground({+ fade = "white",+}: {+ fade?: keyof typeof fadeClassNames;+}) {+ return (+ <>+ <div+ aria-hidden+ className="pointer-events-none absolute inset-0"+ style={checkeredBackgroundStyle}+ />+ <div+ aria-hidden+ className={cn("pointer-events-none absolute inset-0", fadeClassNames[fade])}+ />+ </>+ );+}diff --git a/src/client/src/components/common/confetti.tsx b/src/client/src/components/common/confetti.tsxdeleted file mode 100644index c8b61098..00000000--- a/src/client/src/components/common/confetti.tsx+++ /dev/null@@ -1,186 +0,0 @@-export default function Confetti() {- return (- <>- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.15]"- style={{- width: "97.6408px",- height: "97.6408px",- top: "2.70155%",- left: "47.1158%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.1]"- style={{- width: "56.3488px",- height: "56.3488px",- top: "5.21457%",- left: "26.7941%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.2]"- style={{- width: "83.3041px",- height: "83.3041px",- top: "78.102%",- left: "85.553%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.2]"- style={{- width: "73.5714px",- height: "73.5714px",- top: "54.351%",- left: "90.7616%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.05]"- style={{- width: "86.0302px",- height: "86.0302px",- top: "81.7666%",- left: "24.0279%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.1]"- style={{- width: "38.3342px",- height: "38.3342px",- top: "28.2189%",- left: "17.891%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.1]"- style={{- width: "101.238px",- height: "101.238px",- top: "49.6367%",- left: "60.0206%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.15]"- style={{- width: "92.0699px",- height: "92.0699px",- top: "16.2664%",- left: "13.4283%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.15]"- style={{- width: "28.6254px",- height: "28.6254px",- top: "47.9082%",- left: "18.7969%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.1]"- style={{- width: "62.0424px",- height: "62.0424px",- top: "15.3172%",- left: "68.8908%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.05]"- style={{- width: "37.4925px",- height: "37.4925px",- top: "32.3152%",- left: "71.9833%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.1]"- style={{- width: "66.0742px",- height: "66.0742px",- top: "11.2482%",- left: "3.57173%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.2]"- style={{- width: "78.706px",- height: "78.706px",- top: "11.0894%",- left: "74.244%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.2]"- style={{- width: "49.0052px",- height: "49.0052px",- top: "25.1587%",- left: "52.0703%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.01]"- style={{- width: "24.4747px",- height: "24.4747px",- top: "81.188%",- left: "65.8224%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.01]"- style={{- width: "102.344px",- height: "102.344px",- top: "75.5579%",- left: "92.4095%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.01]"- style={{- width: "29.7934px",- height: "29.7934px",- top: "92.546%",- left: "61.1729%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.2]"- style={{- width: "92.9791px",- height: "92.9791px",- top: "88.4441%",- left: "57.8831%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.05]"- style={{- width: "55.2333px",- height: "55.2333px",- top: "18.6437%",- left: "32.9982%",- }}- />- <div- className="absolute rounded-full bg-primary z-0 opacity-[0.15]"- style={{- width: "73.6121px",- height: "73.6121px",- top: "90.6981%",- left: "12.1542%",- }}- />- </>- );-}\ No newline at end of filediff --git a/src/client/src/components/common/error-page.tsx b/src/client/src/components/common/error-page.tsxnew file mode 100644index 00000000..fef67ea3--- /dev/null+++ b/src/client/src/components/common/error-page.tsx@@ -0,0 +1,116 @@+"use client";+import type { ReactNode } from "react";+import Link from "next/link";+import { RotateCcw } from "lucide-react";+import getMessage from "@/constants/messages";+import { DEFAULT_LOGGED_IN_ROUTE } from "@/constants/route";+import CheckeredBackground from "@/components/common/checkered-background";+import { Button } from "@/components/ui/button";++const primaryActionClassName =+ "bg-primary text-white hover:bg-primary/90 dark:bg-primary dark:text-white dark:hover:bg-primary/90";++function ErrorPageCard({+ code,+ title,+ description,+ reference,+ loggedIn,+ onRetry,+}: {+ code: string;+ title: string;+ description: string;+ reference?: string;+ loggedIn: boolean;+ onRetry?: () => void;+}) {+ const m = getMessage();++ return (+ <div className="rounded-xl border border-stone-200 bg-white p-6 text-center shadow-sm dark:border-stone-800 dark:bg-stone-950 sm:p-8">+ <p className="font-mono text-xs font-semibold uppercase tracking-wider text-primary">+ {code}+ </p>+ <h1 className="mt-2 text-2xl font-semibold tracking-tight text-stone-950 dark:text-stone-50">+ {title}+ </h1>+ <p className="mt-1.5 text-sm leading-6 text-stone-500 dark:text-stone-400">+ {description}+ </p>+ <div className="mt-6 flex flex-col gap-2 sm:flex-row sm:justify-center">+ {onRetry ? (+ <Button+ type="button"+ onClick={onRetry}+ className={`gap-1.5 ${primaryActionClassName}`}+ >+ <RotateCcw className="size-3.5" />+ {m.ERROR_PAGE_TRY_AGAIN}+ </Button>+ ) : null}+ <Button+ asChild+ variant={onRetry ? "outline" : "default"}+ className={onRetry ? undefined : primaryActionClassName}+ >+ <Link href={loggedIn ? DEFAULT_LOGGED_IN_ROUTE : "/login"}>+ {loggedIn ? m.ERROR_PAGE_GO_TO_DASHBOARD : m.ERROR_PAGE_GO_TO_SIGN_IN}+ </Link>+ </Button>+ </div>+ {reference ? (+ <p className="mt-6 border-t border-stone-200 pt-4 font-mono text-[10px] text-stone-400 dark:border-stone-800 dark:text-stone-500">+ {m.ERROR_PAGE_REFERENCE}: {reference}+ </p>+ ) : null}+ </div>+ );+}++export function NotFoundCard({ loggedIn }: { loggedIn: boolean }) {+ const m = getMessage();++ return (+ <ErrorPageCard+ code={m.ERROR_PAGE_NOT_FOUND_CODE}+ title={m.ERROR_PAGE_NOT_FOUND_TITLE}+ description={m.ERROR_PAGE_NOT_FOUND_DESCRIPTION}+ loggedIn={loggedIn}+ />+ );+}++export function ServerErrorCard({+ loggedIn,+ reference,+ onRetry,+}: {+ loggedIn: boolean;+ reference?: string;+ onRetry: () => void;+}) {+ const m = getMessage();++ return (+ <ErrorPageCard+ code={m.ERROR_PAGE_SERVER_ERROR_CODE}+ title={m.ERROR_PAGE_SERVER_ERROR_TITLE}+ description={m.ERROR_PAGE_SERVER_ERROR_DESCRIPTION}+ reference={reference}+ loggedIn={loggedIn}+ onRetry={onRetry}+ />+ );+}++export function DashboardErrorFrame({ children }: { children: ReactNode }) {+ return (+ <div className="relative min-h-0 w-full flex-1 overflow-hidden">+ <CheckeredBackground fade="stone" />+ <div className="absolute inset-0 flex flex-col items-center overflow-y-auto overflow-x-hidden px-4 py-10 sm:px-6">+ <div className="relative my-auto w-full max-w-md">{children}</div>+ </div>+ </div>+ );+}diff --git a/src/client/src/constants/events.ts b/src/client/src/constants/events.tsindex bf3d0e5e..17b5d2e4 100644--- a/src/client/src/constants/events.ts+++ b/src/client/src/constants/events.ts@@ -4,6 +4,8 @@ export const CLIENT_EVENTS = {// AuthLOGIN: "USER_LOGIN",REGISTER: "USER_REGISTER",+ // Founder call+ FOUNDER_CALL_SCHEDULE_CLICKED: "FOUNDER_CALL_SCHEDULE_CLICKED",// Database configDB_CONFIG_ADD_SUCCESS: "DB_CONFIG_ADD_SUCCESS",DB_CONFIG_UPDATE_SUCCESS: "DB_CONFIG_UPDATE_SUCCESS",diff --git a/src/client/src/constants/messages/en.ts b/src/client/src/constants/messages/en.tsindex 51d02629..78be70c5 100644--- a/src/client/src/constants/messages/en.ts+++ b/src/client/src/constants/messages/en.ts@@ -1686,10 +1686,6 @@ export const PERSONAL_ORGANISATION = "Personal";// Authexport const AUTH_WELCOME = "Welcome to OpenLIT";export const AUTH_SUBTITLE = "Open source Agent Harness Engineering platform";-export const AUTH_PANEL_EYEBROW = "Agent Harness Engineering";-export const AUTH_PANEL_TITLE = "Trace, evaluate, and operate AI agents";-export const AUTH_PANEL_BODY =- "LLM tracing, evaluations, prompt management, and cost tracking in one open-source platform.";export const TALK_TO_FOUNDER = "Talk to founder";export const TALK_TO_FOUNDER_HINT = "Schedule a 30-minute call";export const AUTH_SIGNING_IN = "Signing in...";@@ -1717,27 +1713,29 @@ export const AUTH_ERROR_DEFAULT = "Unable to sign in.";export const AUTH_ERROR_GOOGLE = "Failed to sign in with Google";export const AUTH_ERROR_GITHUB = "Failed to sign in with Github";-// Auth feature highlights-export const AUTH_FEATURE_TRACING = "LLM tracing";-export const AUTH_FEATURE_TRACING_DESC = "OpenTelemetry traces for every call, tool, and retrieval";-export const AUTH_FEATURE_ANALYTICS = "Cost and latency";-export const AUTH_FEATURE_ANALYTICS_DESC = "Track spend, tokens, and speed for every AI workload";-export const AUTH_FEATURE_EVALS = "Evaluations";-export const AUTH_FEATURE_EVALS_DESC = "LLM-as-a-judge, heuristics, and human review";-export const AUTH_FEATURE_JUDGE = "LLM-as-a-Judge";-export const AUTH_FEATURE_JUDGE_DESC = "Automated quality scoring with any LLM";-export const AUTH_FEATURE_OPENGROUND = "OpenGround";-export const AUTH_FEATURE_OPENGROUND_DESC = "Compare LLMs side-by-side on cost & quality";-export const AUTH_FEATURE_PROMPT_HUB = "Prompt Hub";-export const AUTH_FEATURE_PROMPT_HUB_DESC = "Version and deploy prompts without shipping app code";-export const AUTH_FEATURE_RULE_ENGINE = "Rule Engine";-export const AUTH_FEATURE_RULE_ENGINE_DESC = "Conditional context and prompt retrieval";-export const AUTH_FEATURE_VAULT = "Vault";-export const AUTH_FEATURE_VAULT_DESC = "Store and rotate LLM API keys outside application code";-export const AUTH_FEATURE_AGENTS = "Agent monitoring";-export const AUTH_FEATURE_AGENTS_DESC = "See tools, cost, and outcomes for coding agents";-export const AUTH_FEATURE_OTEL = "OpenTelemetry Native";-export const AUTH_FEATURE_OTEL_DESC = "Built on open standards, no vendor lock-in";+// Founder call sidebar card+export const FOUNDER_CARD_BADGE = "From the founder";+export const FOUNDER_CARD_TITLE = "Want more features?";+export const FOUNDER_CARD_BODY =+ "Tell us what your agents are missing. Grab 30 minutes and we'll figure it out together.";+export const FOUNDER_CARD_CTA = "Schedule a call";+export const FOUNDER_CARD_DISMISS = "Dismiss founder call card";++// Error pages+export const ERROR_PAGE_NOT_FOUND_CODE = "404";+export const ERROR_PAGE_NOT_FOUND_LABEL = "Page not found";+export const ERROR_PAGE_NOT_FOUND_TITLE = "Bug or feature?";+export const ERROR_PAGE_NOT_FOUND_DESCRIPTION =+ "This page drifted outside our observability zone. Let's head back to reality.";+export const ERROR_PAGE_SERVER_ERROR_CODE = "500";+export const ERROR_PAGE_SERVER_ERROR_LABEL = "Something went wrong";+export const ERROR_PAGE_SERVER_ERROR_TITLE = "Something went wrong";+export const ERROR_PAGE_SERVER_ERROR_DESCRIPTION =+ "An unexpected error interrupted this page. Try again, or head back and pick up where you left off.";+export const ERROR_PAGE_REFERENCE = "Reference";+export const ERROR_PAGE_TRY_AGAIN = "Try again";+export const ERROR_PAGE_GO_TO_DASHBOARD = "Return to dashboard";+export const ERROR_PAGE_GO_TO_SIGN_IN = "Go to sign in";// Context UIexport const CONTEXT_TITLE = "Context";