MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / recomputeSystemTheme

Function recomputeSystemTheme

cli/src/utils/theme-system.ts:1127–1146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1125 * Recompute system theme and update store if it changed
1126 */
1127const recomputeSystemTheme = () => {
1128 const env = getCliEnv()
1129 // Only recompute if theme is auto-detected (not explicitly set)
1130 const envPreference = env.OPEN_TUI_THEME ?? env.OPENTUI_THEME
1131 if (envPreference && envPreference.toLowerCase() !== 'opposite') {
1132 // User explicitly set theme, don't react to system changes
1133 return
1134 }
1135
1136 if (!themeResolver) {
1137 return
1138 }
1139
1140 const newTheme = themeResolver()
1141
1142 // Always call the updater and let it decide if an update is needed
1143 if (themeStoreUpdater) {
1144 themeStoreUpdater(newTheme)
1145 }
1146}
1147
1148/**
1149 * Debounced version of recomputeSystemTheme for file watcher events

Callers 2

enableManualThemeRefreshFunction · 0.85

Calls 1

getCliEnvFunction · 0.90

Tested by

no test coverage detected