diff --git a/web/src/app/globals.css b/web/src/app/globals.css index 1e91509..fb69f19 100644 --- a/web/src/app/globals.css +++ b/web/src/app/globals.css @@ -14,7 +14,7 @@ html { body { margin: 0; min-height: 100vh; - background: linear-gradient(180deg, var(--nl-bg-canvas) 0%, #0b1020 100%); + background: linear-gradient(180deg, var(--nl-bg-canvas) 0%, color-mix(in srgb, var(--nl-bg-canvas) 70%, black) 100%); color: var(--nl-text-primary); font-family: var(--nl-font-body); -webkit-font-smoothing: antialiased; diff --git a/web/src/app/layout.tsx b/web/src/app/layout.tsx index 617a5d8..f0b1280 100644 --- a/web/src/app/layout.tsx +++ b/web/src/app/layout.tsx @@ -24,7 +24,10 @@ export const metadata: Metadata = { export const viewport: Viewport = { width: "device-width", initialScale: 1, - themeColor: "#06070A", + themeColor: [ + { media: "(prefers-color-scheme: dark)", color: "#06070A" }, + { media: "(prefers-color-scheme: light)", color: "#F8FAFC" }, + ], }; export default function RootLayout({ diff --git a/web/src/app/providers.tsx b/web/src/app/providers.tsx index 913fb80..6fa0f80 100644 --- a/web/src/app/providers.tsx +++ b/web/src/app/providers.tsx @@ -6,12 +6,16 @@ import { Toaster } from "sonner"; import { AuthProvider } from "@/lib/auth"; import { initDiagnostics } from "@/lib/diagnostics"; import { initTelemetry } from "@/lib/telemetry"; +import { initFeatureFlags } from "@/lib/feature-flags"; +import { checkKillSwitch } from "@/lib/kill-switch"; import { flushOfflineQueue } from "@/lib/offline-queue"; export function Providers({ children }: { children: ReactNode }) { useEffect(() => { initTelemetry(); initDiagnostics(); + initFeatureFlags().catch(() => {}); + checkKillSwitch().catch(() => {}); flushOfflineQueue().catch(() => {}); }, []); diff --git a/web/src/lib/use-theme.ts b/web/src/lib/use-theme.ts index cc21048..de93574 100644 --- a/web/src/lib/use-theme.ts +++ b/web/src/lib/use-theme.ts @@ -1,14 +1,16 @@ 'use client'; import { useState, useEffect, useCallback } from 'react'; +import { PRODUCT_ID } from '@/lib/product-config'; type Theme = 'dark' | 'light'; +const STORAGE_KEY = `${PRODUCT_ID}_theme`; export function useTheme() { const [theme, setThemeState] = useState('dark'); useEffect(() => { - const stored = localStorage.getItem('theme') as Theme | null; + const stored = localStorage.getItem(STORAGE_KEY) as Theme | null; const initial = stored ?? 'dark'; setThemeState(initial); document.documentElement.setAttribute('data-theme', initial); @@ -16,7 +18,7 @@ export function useTheme() { const setTheme = useCallback((t: Theme) => { setThemeState(t); - localStorage.setItem('theme', t); + localStorage.setItem(STORAGE_KEY, t); document.documentElement.setAttribute('data-theme', t); }, []);