From 109947552fe798d311fb76927f7b843bc22ea990 Mon Sep 17 00:00:00 2001 From: Moheeb Zara Date: Fri, 15 May 2026 16:50:20 -0700 Subject: [PATCH] fix: landing page rendered unstyled - route bypassed (landing) layout Root cause: app/page.tsx owned `/` and imported the landing component directly, so `/` only got the root layout. The (landing)/layout.tsx that supplies .landing-root, the IBM Plex Mono / Libre Baskerville fonts, and landing.css never ran, so the redesigned page (which is scoped under .landing-root) rendered with no styles at all. The old landing used global Tailwind tokens so the missing layout went unnoticed. Fix: the canonical App Router structure. `/` now resolves to app/(landing)/page.tsx (route groups add no path segment), wrapped by app/(landing)/layout.tsx. The logged-in -> /dashboard redirect moved into that page. Deleted the duplicate app/page.tsx. Build clean, no parallel-route conflict, `/` resolves. 266/266 tests pass. --- app/(landing)/page.tsx | 11 ++++++++++- app/page.tsx | 12 ------------ 2 files changed, 10 insertions(+), 13 deletions(-) delete mode 100644 app/page.tsx diff --git a/app/(landing)/page.tsx b/app/(landing)/page.tsx index 8793ead..cfa378d 100644 --- a/app/(landing)/page.tsx +++ b/app/(landing)/page.tsx @@ -1,4 +1,6 @@ import Link from 'next/link' +import { redirect } from 'next/navigation' +import { createClient } from '@/lib/supabase/server' import { BrandMark } from '@/components/brand-mark' import { GithubIcon, ArrowIcon } from '@/components/landing/icons' import { ResourceShowcase } from '@/components/landing/resource-showcase' @@ -19,7 +21,14 @@ const STEPS = [ { num: '03', title: 'Seed your ops docs', desc: 'Drop in SOPs, credentials, and area leads. The whole board has one place to look things up.' }, ] -export default function LandingPage() { +export default async function LandingPage() { + // `/` resolves here (route group adds no path segment), so this page is + // wrapped by (landing)/layout.tsx which supplies the .landing-root theme, + // fonts, and landing.css. Logged-in visitors skip the marketing page. + const supabase = await createClient() + const { data: { user } } = await supabase.auth.getUser() + if (user) redirect('/dashboard') + return ( <>