Files
Agent-System-Frontend/src/theme.ts
T
weichenandCursor d1ea616b08 Rebuild the workbench shell around projects and card flow
Why: The first S4 pass makes the project the navigation context, keeps deep views in one overlay, and leaves domain panels empty until a plugin declares them.
Evidence: npx tsc -b and npm test (61 passed) in modules/frontend.
Impact: Top bar, project sidebar, inbox all/todo filter, one-way scroll sync, drag-and-drop on the whole chat column, and local molv/system themes.
Refs: feature/s4-shell-overhaul
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 23:33:06 +00:00

14 lines
611 B
TypeScript

// 主题选择:深色 / 浅色 / 墨绿直接上屏;跟随系统只在深色与浅色之间解析。
export type ThemeChoice = 'dark' | 'light' | 'molv' | 'system'
export type PaintedTheme = 'dark' | 'light' | 'molv'
export function resolveTheme(choice: string, prefersDark: boolean): PaintedTheme {
if (choice === 'system') return prefersDark ? 'dark' : 'light'
if (choice === 'light' || choice === 'molv') return choice
return 'dark'
}
export function isThemeChoice(value: string): value is ThemeChoice {
return value === 'dark' || value === 'light' || value === 'molv' || value === 'system'
}