mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 06:15:51 +00:00
fix: theme switching always defaults to dark mode
Root causes: 1. ThemeProvider was imported but never used in App.tsx and showSetupDialog 2. setThemeConfigCallbacks was never called to inject persistence callbacks 3. Preview/save/cancel theme lifecycle had no provider to coordinate Changes: - Export setThemeConfigCallbacks from @anthropic/ink - Wrap App.tsx children with ThemeProvider (initialState from config, onThemeSave persists) - Wrap showSetupDialog with ThemeProvider for onboarding/trust dialogs - Call setThemeConfigCallbacks in init.ts to register load/save callbacks - Update SnapshotUpdateDialog test to account for new ThemeProvider wrapper Fixes #theme-switching
This commit is contained in:
@@ -20,7 +20,12 @@ import {
|
||||
import { preconnectAnthropicApi } from '../utils/apiPreconnect.js'
|
||||
import { applyExtraCACertsFromConfig } from '../utils/caCertsConfig.js'
|
||||
import { registerCleanup } from '../utils/cleanupRegistry.js'
|
||||
import { enableConfigs, recordFirstStartTime } from '../utils/config.js'
|
||||
import {
|
||||
enableConfigs,
|
||||
getGlobalConfig,
|
||||
recordFirstStartTime,
|
||||
saveGlobalConfig,
|
||||
} from '../utils/config.js'
|
||||
import { logForDebugging } from '../utils/debug.js'
|
||||
import { detectCurrentRepository } from '../utils/detectRepository.js'
|
||||
import { logForDiagnosticsNoPII } from '../utils/diagLogs.js'
|
||||
@@ -51,6 +56,7 @@ import { setShellIfWindows } from '../utils/windowsPaths.js'
|
||||
import { initSentry } from '../utils/sentry.js'
|
||||
import { initUser } from '../utils/user.js'
|
||||
import { initLangfuse, shutdownLangfuse } from '../services/langfuse/index.js'
|
||||
import { setThemeConfigCallbacks } from '@anthropic/ink'
|
||||
|
||||
// initialize1PEventLogging is dynamically imported to defer OpenTelemetry sdk-logs/resources
|
||||
|
||||
@@ -66,6 +72,11 @@ export const init = memoize(async (): Promise<void> => {
|
||||
try {
|
||||
const configsStart = Date.now()
|
||||
enableConfigs()
|
||||
setThemeConfigCallbacks({
|
||||
loadTheme: () => getGlobalConfig().theme,
|
||||
saveTheme: setting =>
|
||||
saveGlobalConfig(current => ({ ...current, theme: setting })),
|
||||
})
|
||||
logForDiagnosticsNoPII('info', 'init_configs_enabled', {
|
||||
duration_ms: Date.now() - configsStart,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user