Skip to content

Commit 4d05526

Browse files
authored
PR.18 refactor/nav-layouts-toward-grok-way
refactor: adopt Grok-style layout with shadcn/ui sidebar
2 parents ac5442e + f702f3e commit 4d05526

37 files changed

Lines changed: 1537 additions & 251 deletions

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ npm run test:unit # Vitest
2626
npm run test:e2e # Playwright
2727
npm run test # All tests (Vitest + Playwright)
2828

29+
npm run analyse # Bundle analyser UI (why is X bundled? bloat? splits?)
30+
31+
fuser -k 3000/tcp 2>/dev/null; rm -f .next/dev/lock # Kill dev server
32+
2933
vercel list # Recent deployments and status
3034
vercel env ls # Check env vars are configured
3135
vercel whoami # Verify CLI is authenticated

app/(root)/(no-right-sidebar)/layout.tsx

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/(root)/(with-right-sidebar)/layout.tsx

Lines changed: 0 additions & 11 deletions
This file was deleted.

app/(root)/(with-right-sidebar)/ask-question/page.tsx renamed to app/(root)/ask-question/page.tsx

File renamed without changes.

app/(root)/(with-right-sidebar)/collections/page.tsx renamed to app/(root)/collections/page.tsx

File renamed without changes.
File renamed without changes.
File renamed without changes.

app/(root)/layout.tsx

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
1-
import { LeftSidebar } from "@/components/navigation/left-sidebar";
2-
import { Navbar } from "@/components/navigation/navbar";
3-
import { SidebarProvider } from "@/components/sidebar-provider";
1+
import { cookies } from "next/headers";
2+
import { AppSidebar } from "@/components/app-sidebar";
3+
import { ContentTopBar } from "@/components/navigation/content-top-bar";
4+
import { MobileHeader } from "@/components/navigation/mobile-header";
5+
import { SidebarProvider } from "@/components/ui/sidebar";
6+
import {
7+
CONTENT_HORIZONTAL_PADDING,
8+
cn,
9+
MOBILE_HEADER_TOP_OFFSET,
10+
} from "@/lib/utils";
11+
12+
const RootLayout = async ({ children }: { children: React.ReactNode }) => {
13+
const cookieStore = await cookies();
14+
const defaultOpen = cookieStore.get("sidebar_state")?.value !== "false";
415

5-
const RootLayout = ({ children }: { children: React.ReactNode }) => {
616
return (
7-
<SidebarProvider>
8-
<div className="flex min-h-screen flex-col">
9-
<Navbar />
10-
<div className="flex flex-1">
11-
<LeftSidebar />
12-
<main className="flex-1">{children}</main>
13-
</div>
17+
<SidebarProvider defaultOpen={defaultOpen}>
18+
{/* Mobile-only fixed header */}
19+
<MobileHeader />
20+
21+
{/* Full-height sidebar */}
22+
<AppSidebar />
23+
24+
{/* Content area */}
25+
<div className="flex min-h-screen flex-1 flex-col">
26+
{/* Desktop-only top bar */}
27+
<ContentTopBar />
28+
<main
29+
className={cn(
30+
"flex-1 pb-10 sm:pt-10",
31+
MOBILE_HEADER_TOP_OFFSET,
32+
CONTENT_HORIZONTAL_PADDING,
33+
)}
34+
>
35+
{children}
36+
</main>
1437
</div>
1538
</SidebarProvider>
1639
);
File renamed without changes.

0 commit comments

Comments
 (0)