@@ -21,6 +21,7 @@ import { useStableReference, compareMaps } from "./hooks/useStableReference";
2121import { CommandRegistryProvider , useCommandRegistry } from "./contexts/CommandRegistryContext" ;
2222import type { CommandAction } from "./contexts/CommandRegistryContext" ;
2323import { ModeProvider } from "./contexts/ModeContext" ;
24+ import { ThemeProvider , useTheme , type ThemeMode } from "./contexts/ThemeContext" ;
2425import { ThinkingProvider } from "./contexts/ThinkingContext" ;
2526import { CommandPalette } from "./components/CommandPalette" ;
2627import { buildCoreSources , type BuildSourcesParams } from "./utils/commands/sources" ;
@@ -48,6 +49,13 @@ function AppInner() {
4849 beginWorkspaceCreation,
4950 clearPendingWorkspaceCreation,
5051 } = useWorkspaceContext ( ) ;
52+ const { theme, setTheme, toggleTheme } = useTheme ( ) ;
53+ const setThemePreference = useCallback (
54+ ( nextTheme : ThemeMode ) => {
55+ setTheme ( nextTheme ) ;
56+ } ,
57+ [ setTheme ]
58+ ) ;
5159 const {
5260 projects,
5361 removeProject,
@@ -392,6 +400,7 @@ function AppInner() {
392400 projects,
393401 workspaceMetadata,
394402 selectedWorkspace,
403+ theme,
395404 getThinkingLevel : getThinkingLevelForWorkspace ,
396405 onSetThinkingLevel : setThinkingLevelFromPalette ,
397406 onStartWorkspaceCreation : openNewWorkspaceFromPalette ,
@@ -404,6 +413,8 @@ function AppInner() {
404413 onToggleSidebar : toggleSidebarFromPalette ,
405414 onNavigateWorkspace : navigateWorkspaceFromPalette ,
406415 onOpenWorkspaceInTerminal : openWorkspaceInTerminal ,
416+ onToggleTheme : toggleTheme ,
417+ onSetTheme : setThemePreference ,
407418 } ;
408419
409420 useEffect ( ( ) => {
@@ -586,7 +597,7 @@ function AppInner() {
586597 } ) ( )
587598 ) : (
588599 < div
589- className = "[&_p]:text-muted mx-auto w-full max-w-3xl text-center [&_h2]:mb-4 [&_h2]:font-bold [&_h2]:tracking-tight [&_h2]:text-white [&_p]:leading-[1.6]"
600+ className = "[&_p]:text-muted mx-auto w-full max-w-3xl text-center [&_h2]:mb-4 [&_h2]:font-bold [&_h2]:tracking-tight [&_h2]:text-foreground [&_p]:leading-[1.6]"
590601 style = { {
591602 padding : "clamp(40px, 10vh, 100px) 20px" ,
592603 fontSize : "clamp(14px, 2vw, 16px)" ,
@@ -618,9 +629,11 @@ function AppInner() {
618629
619630function App ( ) {
620631 return (
621- < CommandRegistryProvider >
622- < AppInner />
623- </ CommandRegistryProvider >
632+ < ThemeProvider >
633+ < CommandRegistryProvider >
634+ < AppInner />
635+ </ CommandRegistryProvider >
636+ </ ThemeProvider >
624637 ) ;
625638}
626639
0 commit comments