Add PocketBase login, first-sign-in password changes, account settings, and user activation, reactivation and deletion with self-removal guards. Protect application pages and APIs and keep private pages out of PWA caches. Resolve plant locations from site assignments and improve map controls, profit chart views, navigation and mobile table layouts. Validation: production build and TypeScript passed; 28 unit tests passed. Backend access integration tests and mobile verification are documented.
54 lines
2 KiB
TypeScript
54 lines
2 KiB
TypeScript
import "./globals.css";
|
|
import type { Metadata, Viewport } from "next";
|
|
import { ThemeProvider } from "@/components/ThemeProvider";
|
|
import { SessionLifecycle } from "@/components/auth/SessionLifecycle";
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Mega Plant Dashboard",
|
|
description: "Mega Plant cost & P&L dashboard",
|
|
manifest: "/manifest.json",
|
|
appleWebApp: {
|
|
title: "Mega Plant",
|
|
capable: true,
|
|
statusBarStyle: "default",
|
|
},
|
|
icons: {
|
|
icon: [
|
|
{ url: "/icons/favicon-32.png", sizes: "32x32" },
|
|
{ url: "/icons/icon-192.png", sizes: "192x192" },
|
|
{ url: "/icons/icon-512.png", sizes: "512x512" },
|
|
],
|
|
apple: [
|
|
{ url: "/icons/icon-192.png", sizes: "192x192" },
|
|
{ url: "/icons/icon-512.png", sizes: "512x512" },
|
|
],
|
|
},
|
|
};
|
|
|
|
export const viewport: Viewport = { themeColor: "#30638E", width: "device-width", initialScale: 1, viewportFit: "cover" };
|
|
|
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
return (
|
|
<html lang="en" suppressHydrationWarning>
|
|
<head>
|
|
{/* Part 4: Next 16 emits apple-mobile-web-app-status-bar-style but NOT apple-mobile-web-app-capable.
|
|
Without this tag, iOS Add-to-Home-Screen opens in Safari instead of standalone. */}
|
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
<meta name="apple-mobile-web-app-title" content="Mega Plant" />
|
|
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32.png" />
|
|
<link rel="icon" type="image/png" sizes="64x64" href="/icons/favicon.png" />
|
|
<link rel="apple-touch-icon" href="/icons/icon-192.png" />
|
|
|
|
{/* Umami analytics — website id 86d0bd41-e705-4677-af2d-a4228e7c4b95 */}
|
|
<script
|
|
defer
|
|
src="https://umami-vmyngbmelll45wokwr270wbx.169.239.180.130.sslip.io/script.js"
|
|
data-website-id="86d0bd41-e705-4677-af2d-a4228e7c4b95"
|
|
/>
|
|
</head>
|
|
<body className="min-h-screen">
|
|
<ThemeProvider><SessionLifecycle />{children}</ThemeProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|