Skip to content

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

refactor: `full-screen-page` to drop magic in height calculation (#3944)

marliessophieb26a5371816f
diff --git a/web/src/components/layouts/full-screen-page.tsx b/web/src/components/layouts/full-screen-page.tsx
index 77f2939103..d802db27d4 100644
--- a/web/src/components/layouts/full-screen-page.tsx
+++ b/web/src/components/layouts/full-screen-page.tsx
@@ -1,28 +1,9 @@
import { cn } from "@/src/utils/tailwind";
-export const FullScreenPage: React.FC<
- React.PropsWithChildren<{
- mobile?: boolean;
- className?: string;
- lgHeight?: string;
- mobileHeight?: string;
- }>
-> = ({
+export const FullScreenPage: React.FC<React.PropsWithChildren<{}>> = ({
children,
- mobile = true,
- className,
- lgHeight = "lg:h-[calc(100dvh-1.5rem)]",
- mobileHeight = "h-[calc(100dvh-6rem)]",
}) => {
return (
- <div
- className={cn(
- `flex flex-col overflow-hidden ${lgHeight}`,
- mobile && mobileHeight,
- className,
- )}
- >
- {children}
- </div>
+ <div className={cn("flex h-full flex-col overflow-hidden")}>{children}</div>
);
};
diff --git a/web/src/components/layouts/layout.tsx b/web/src/components/layouts/layout.tsx
index 70310d5ec1..e2c4375519 100644
--- a/web/src/components/layouts/layout.tsx
+++ b/web/src/components/layouts/layout.tsx
@@ -321,7 +321,7 @@ export default function Layout(props: PropsWithChildren) {
href={`${env.NEXT_PUBLIC_BASE_PATH ?? ""}/favicon-16x16.png`}
/>
</Head>
- <div>
+ <div className="h-dvh">
<Transition.Root show={sidebarOpen} as={Fragment}>
<Dialog
as="div"
@@ -575,7 +575,10 @@ export default function Layout(props: PropsWithChildren) {
</Button>
</div>
) : null}
- <main className="p-3">{props.children}</main>
+ {/* px subtracted is the height of the header, remove & refactor when adding shadcn sidebar */}
+ <main className="h-[calc(100dvh-96px)] p-3 min-[384px]:h-[calc(100dvh-64px)] lg:h-dvh">
+ {props.children}
+ </main>
<Toaster visibleToasts={1} />
</div>
</div>
diff --git a/web/src/components/trace/index.tsx b/web/src/components/trace/index.tsx
index 3f213ec354..0c4640c0a0 100644
--- a/web/src/components/trace/index.tsx
+++ b/web/src/components/trace/index.tsx
@@ -290,7 +290,7 @@ export function TracePage({ traceId }: { traceId: string }) {
return <ErrorPage message="You do not have access to this trace." />;
if (!trace.data) return <div>loading...</div>;
return (
- <FullScreenPage mobile={false} className="2xl:container">
+ <FullScreenPage>
<Header
title="Trace Detail"
breadcrumb={[
diff --git a/web/src/features/prompts/components/prompts-table.tsx b/web/src/features/prompts/components/prompts-table.tsx
index a15abba467..49e3bdee47 100644
--- a/web/src/features/prompts/components/prompts-table.tsx
+++ b/web/src/features/prompts/components/prompts-table.tsx
@@ -236,7 +236,7 @@ export function PromptTable() {
] as LangfuseColumnDef<PromptTableRow>[];
return (
- <div>
+ <>
<DataTableToolbar
columns={promptColumns}
filterColumnDefinition={promptsTableColsWithOptions(
@@ -305,6 +305,6 @@ export function PromptTable() {
state: paginationState,
}}
/>
- </div>
+ </>
);
}
diff --git a/web/src/pages/project/[projectId]/prompts/index.tsx b/web/src/pages/project/[projectId]/prompts/index.tsx
index 2867105ff5..15ea1536bc 100644
--- a/web/src/pages/project/[projectId]/prompts/index.tsx
+++ b/web/src/pages/project/[projectId]/prompts/index.tsx
@@ -1,9 +1,10 @@
+import { FullScreenPage } from "@/src/components/layouts/full-screen-page";
import Header from "@/src/components/layouts/header";
import { PromptTable } from "@/src/features/prompts/components/prompts-table";
export default function Prompts() {
return (
- <div>
+ <FullScreenPage>
<Header
title="Prompts"
help={{
@@ -13,6 +14,6 @@ export default function Prompts() {
}}
/>
<PromptTable />
- </div>
+ </FullScreenPage>
);
}