2026-09-12 07:35:35 +00:00
|
|
|
import "./globals.css";
|
2026-10-06 02:02:08 +00:00
|
|
|
import type { Metadata, Viewport } from "next";
|
2026-09-12 07:35:35 +00:00
|
|
|
import { ThemeProvider } from "@/components/ThemeProvider";
|
2026-10-06 02:02:08 +00:00
|
|
|
import { SessionLifecycle } from "@/components/auth/SessionLifecycle";
|
Round 4: regressions fixed + mobile standard
Part A — Round 3 regressions:
- A.1: verify-cost-reconciliation.mjs now loads .env.local, wraps in try/catch, exits 1 on any failure
- A.2: Vehicle Costs restored Santam — back to R 14,996.31 (matches row-by-row sum)
- A.3: incl<excl / VAT math / VAT>20% now FATAL — seed exits 2 with full report (4 anomalies on Charl-CCS + Buildsmart)
- A.4: Reconciliation target R 694,962.93 with both deltas itemised (Personnel +R19,800, Santam -R5,322.44, unexplained R 0.00)
- A.5: 'Lines' view uses actual lines (recharts LineChart), no fills; fills only in 'Cost stack'
Part B — Mobile standard:
- B.1: header wraps to 2 rows on mobile; YTD badge cards stack; page-wide overflow eliminated on /income, /charts, /overheads, /running, /expenses
- B.2: IncomeView card row layout stacked — name gets its own line on mobile, never truncated to single char
- B.3: Plant type filter is a <select> dropdown below lg (was 18 pills wrapping to 13 rows); same for sort on /income and /running
- B.4: Plant table first column sticky; -webkit-overflow-scrolling: touch; tables scroll inside their own container
- B.5: All buttons/links use min-h-[44px] tap targets; text below 12px is bumped where it matters
- B.6: Charts legend wraps below title; chart min-height h-44 → h-52 on mobile
- B.7: paddingTop env(safe-area-inset-top) on sticky header for notch/home indicator clearance
AGENTS.md created with the standing mobile checklist rule.
2026-09-12 10:05:43 +00:00
|
|
|
|
2026-09-12 07:35:35 +00:00
|
|
|
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: [
|
2026-09-12 10:12:30 +00:00
|
|
|
{ url: "/icons/favicon-32.png", sizes: "32x32" },
|
|
|
|
|
{ url: "/icons/icon-192.png", sizes: "192x192" },
|
|
|
|
|
{ url: "/icons/icon-512.png", sizes: "512x512" },
|
|
|
|
|
],
|
|
|
|
|
apple: [
|
2026-09-12 07:35:35 +00:00
|
|
|
{ url: "/icons/icon-192.png", sizes: "192x192" },
|
|
|
|
|
{ url: "/icons/icon-512.png", sizes: "512x512" },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
2026-10-06 02:02:08 +00:00
|
|
|
export const viewport: Viewport = { themeColor: "#30638E", width: "device-width", initialScale: 1, viewportFit: "cover" };
|
2026-09-12 07:35:35 +00:00
|
|
|
|
2026-10-06 02:02:08 +00:00
|
|
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
2026-09-12 07:35:35 +00:00
|
|
|
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" />
|
2026-09-12 10:12:30 +00:00
|
|
|
<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" />
|
2026-09-13 17:00:52 +00:00
|
|
|
|
|
|
|
|
{/* 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"
|
|
|
|
|
/>
|
2026-09-12 07:35:35 +00:00
|
|
|
</head>
|
|
|
|
|
<body className="min-h-screen">
|
2026-10-06 02:02:08 +00:00
|
|
|
<ThemeProvider><SessionLifecycle />{children}</ThemeProvider>
|
2026-09-12 07:35:35 +00:00
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
);
|
|
|
|
|
}
|