@@ -21,6 +21,7 @@ import { CommandRegistryProvider, useCommandRegistry } from "./contexts/CommandR
2121import type { CommandAction } from "./contexts/CommandRegistryContext" ;
2222import { ModeProvider } from "./contexts/ModeContext" ;
2323import { ProviderOptionsProvider } from "./contexts/ProviderOptionsContext" ;
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,
@@ -389,6 +397,7 @@ function AppInner() {
389397 projects,
390398 workspaceMetadata,
391399 selectedWorkspace,
400+ theme,
392401 getThinkingLevel : getThinkingLevelForWorkspace ,
393402 onSetThinkingLevel : setThinkingLevelFromPalette ,
394403 onStartWorkspaceCreation : openNewWorkspaceFromPalette ,
@@ -401,6 +410,8 @@ function AppInner() {
401410 onToggleSidebar : toggleSidebarFromPalette ,
402411 onNavigateWorkspace : navigateWorkspaceFromPalette ,
403412 onOpenWorkspaceInTerminal : openWorkspaceInTerminal ,
413+ onToggleTheme : toggleTheme ,
414+ onSetTheme : setThemePreference ,
404415 } ;
405416
406417 useEffect ( ( ) => {
@@ -587,7 +598,7 @@ function AppInner() {
587598 } ) ( )
588599 ) : (
589600 < div
590- 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]"
601+ 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]"
591602 style = { {
592603 padding : "clamp(40px, 10vh, 100px) 20px" ,
593604 fontSize : "clamp(14px, 2vw, 16px)" ,
@@ -619,9 +630,11 @@ function AppInner() {
619630
620631function App ( ) {
621632 return (
622- < CommandRegistryProvider >
623- < AppInner />
624- </ CommandRegistryProvider >
633+ < ThemeProvider >
634+ < CommandRegistryProvider >
635+ < AppInner />
636+ </ CommandRegistryProvider >
637+ </ ThemeProvider >
625638 ) ;
626639}
627640
0 commit comments