From 1ad7314fe64e2981c95a75e383a669bc03234644 Mon Sep 17 00:00:00 2001 From: Debanjum Date: Wed, 9 Apr 2025 09:01:38 +0530 Subject: [PATCH 1/5] Let only root next.js layout handle html, body tags, not child layouts Remove html, body elements from child page layouts. Let only the root layout handle it. Next.js router structure mounts child layouts inside parent layouts, as defined by their directory hierarchy. So the html, body component should only be defined in the parent layout. This avoids the child layout mounting its html, body component within the actual root layout's existing html, body component. --- src/interface/web/app/agents/layout.tsx | 30 +-------------- src/interface/web/app/automations/layout.tsx | 14 +++---- src/interface/web/app/chat/layout.tsx | 40 +++++--------------- src/interface/web/app/search/layout.tsx | 30 +-------------- src/interface/web/app/settings/layout.tsx | 34 +++-------------- src/interface/web/app/share/chat/layout.tsx | 40 +++++--------------- 6 files changed, 33 insertions(+), 155 deletions(-) diff --git a/src/interface/web/app/agents/layout.tsx b/src/interface/web/app/agents/layout.tsx index 26935325..9500b371 100644 --- a/src/interface/web/app/agents/layout.tsx +++ b/src/interface/web/app/agents/layout.tsx @@ -1,8 +1,5 @@ import type { Metadata } from "next"; -import { noto_sans, noto_sans_arabic } from "@/app/fonts"; import "../globals.css"; -import { ContentSecurityPolicy } from "../common/layoutHelper"; -import { ThemeProvider } from "../components/providers/themeProvider"; export const metadata: Metadata = { title: "Khoj AI - Agents", @@ -34,33 +31,10 @@ export const metadata: Metadata = { }, }; -export default function RootLayout({ +export default function ChildLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { - return ( - - -