import type { Metadata, Viewport } from "next"; import localFont from "next/font/local"; import Script from "next/script"; import { Toaster } from "@/components/ui/sonner"; import { StaleBuildGuard } from "@/components/stale-build-guard"; import { StaleClientRecovery } from "@/components/stale-client-recovery"; import { ViewportScrollLock } from "@/components/viewport-scroll-lock"; import { themePreferenceBootScript } from "@/lib/theme-preference"; // Vendored Inter latin variable (OFL). Do not switch back to next/font/google; // the publish image cannot download fonts at build time. const inter = localFont({ src: "./fonts/InterVariable-latin.woff2", display: "swap", variable: "--font-inter", weight: "100 900", }); // Vendored 9-glyph Noto Sans Symbols subset (OFL) — ☉ ☽ ☿ ♀ ♂ ♃ ♄ ☊ ☋, 1.5 KB. // The North Indian chart draws planets as these symbols, so the face has to be // present rather than hoped for: Apple Symbols / Segoe UI Symbol cover the set // on their own platforms, Android and most Linux browsers do not. // `adjustFontFallback: false` on purpose: the synthetic Arial-metric fallback // next/font/local would otherwise inject carries its own ♀ ♂ and would swallow // the rest of the stack for the glyphs it cannot draw. const planetGlyphs = localFont({ src: "./fonts/NotoSansSymbols-planets.woff2", display: "swap", variable: "--font-planet-glyphs", weight: "400", style: "normal", adjustFontFallback: false, }); export const metadata: Metadata = { title: "Jyotisha · 印度占星", description: "与 Mastra Agent 对话,基于星盘证据讨论事业、关系与时间窗口。", }; export const viewport: Viewport = { width: "device-width", initialScale: 1, viewportFit: "cover", interactiveWidget: "resizes-content", }; export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) { const enableReactDevTools = process.env.NODE_ENV === "development" && process.env.NEXT_PUBLIC_ENABLE_REACT_DEVTOOLS === "1"; return (
{/* Synchronous on purpose: a pinned theme must be on before the first paint, or the page flashes the other theme on every load. */} {enableReactDevTools && ( <> > )}