From 9e470979eaa24ca15e5afed3eba1b3eea13b7948 Mon Sep 17 00:00:00 2001 From: SourabhX16 <146323884+SourabhX16@users.noreply.github.com> Date: Thu, 2 Jul 2026 19:38:26 +0530 Subject: [PATCH 1/8] fix: await params in ModulePage via Server Component wrapper (Next.js 15 compat) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ModulePage was a Client Component destructuring params synchronously. In Next.js 15, params is a Promise. Since React 18 doesn't have use(), wrap the client logic in a thin async Server Component that awaits params and passes them as plain props to the inner Client Component. No other files in the app/ tree destructure params or searchParams — this was the only instance. --- .../[moduleId]/module-page-content.tsx | 25 +++++++++++++++++ .../[trackId]/modules/[moduleId]/page.tsx | 27 +++---------------- 2 files changed, 29 insertions(+), 23 deletions(-) create mode 100644 apps/web/src/app/app/tracks/[trackId]/modules/[moduleId]/module-page-content.tsx diff --git a/apps/web/src/app/app/tracks/[trackId]/modules/[moduleId]/module-page-content.tsx b/apps/web/src/app/app/tracks/[trackId]/modules/[moduleId]/module-page-content.tsx new file mode 100644 index 0000000..9522e5f --- /dev/null +++ b/apps/web/src/app/app/tracks/[trackId]/modules/[moduleId]/module-page-content.tsx @@ -0,0 +1,25 @@ +"use client"; + +import { PageHeader } from "@/components/app/page-header"; +import { LoadingPanel } from "@/components/app/loading-panel"; +import { Badge } from "@/components/ui/badge"; +import { ModulePlayer } from "@/components/features/module-player"; +import { useModuleQuery } from "@/lib/mock-data/hooks"; + +export function ModulePageContent({ trackId, moduleId }: { trackId: string; moduleId: string }) { + const { data, isLoading } = useModuleQuery(trackId, moduleId); + + if (isLoading || !data) return ; + + return ( + <> + {data.module.concepts.map((item) => {item})}} + /> + + + ); +} diff --git a/apps/web/src/app/app/tracks/[trackId]/modules/[moduleId]/page.tsx b/apps/web/src/app/app/tracks/[trackId]/modules/[moduleId]/page.tsx index 2e7d080..e26890c 100644 --- a/apps/web/src/app/app/tracks/[trackId]/modules/[moduleId]/page.tsx +++ b/apps/web/src/app/app/tracks/[trackId]/modules/[moduleId]/page.tsx @@ -1,25 +1,6 @@ -"use client"; +import { ModulePageContent } from "./module-page-content"; -import { PageHeader } from "@/components/app/page-header"; -import { LoadingPanel } from "@/components/app/loading-panel"; -import { Badge } from "@/components/ui/badge"; -import { ModulePlayer } from "@/components/features/module-player"; -import { useModuleQuery } from "@/lib/mock-data/hooks"; - -export default function ModulePage({ params }: { params: { trackId: string; moduleId: string } }) { - const { data, isLoading } = useModuleQuery(params.trackId, params.moduleId); - - if (isLoading || !data) return ; - - return ( - <> - {data.module.concepts.map((item) => {item})}} - /> - - - ); +export default async function ModulePage({ params }: { params: Promise<{ trackId: string; moduleId: string }> }) { + const { trackId, moduleId } = await params; + return ; } From 6e0d3928fa8488c7a7c459f286bc1448a789450e Mon Sep 17 00:00:00 2001 From: SourabhX16 <146323884+SourabhX16@users.noreply.github.com> Date: Thu, 2 Jul 2026 19:38:43 +0530 Subject: [PATCH 2/8] fix: prevent dark-mode flash on light-mode load Remove hardcoded className="dark" from . Add blocking inline script that reads localStorage("unvibe-theme") and sets the class before first paint, matching the Zustand store's persistence strategy. Add suppressHydrationWarning to to silence the false-positive mismatch warning since the DOM is intentionally mutated before hydration. --- apps/web/src/app/layout.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx index eb595a6..9adcb50 100644 --- a/apps/web/src/app/layout.tsx +++ b/apps/web/src/app/layout.tsx @@ -26,10 +26,15 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - + +