feat(ui): OLED dark mode variant (#1560)

This commit is contained in:
Alex
2026-05-29 06:56:04 +01:00
committed by GitHub
parent e4bf4c5659
commit 5e0eac5764
19 changed files with 156 additions and 49 deletions
@@ -1,32 +1,12 @@
import {describe, expect, expectTypeOf, it} from 'vitest';
import {describe, expect, it} from 'vitest';
import {
APP_THEME_OPTIONS,
AppearancePreference,
AppState,
AppTheme,
CustomPrimary,
DEFAULT_APP_THEME,
THEME_REGISTRY,
} from './app-state.model';
describe('app-state.model', () => {
it('supports partially specified visual theme state', () => {
const appState: AppState = {
themePreference: DEFAULT_APP_THEME,
appearancePreference: 'system',
};
expect(appState.themePreference).toBe(DEFAULT_APP_THEME);
expect(appState.appearancePreference).toBe('system');
});
it('keeps each field optional and constrained to supported values', () => {
expectTypeOf<AppState['themePreference']>().toEqualTypeOf<AppTheme | undefined>();
expectTypeOf<AppState['appearancePreference']>().toEqualTypeOf<AppearancePreference | undefined>();
expectTypeOf<AppState['customPrimary']>().toEqualTypeOf<CustomPrimary | undefined>();
});
it('derives theme options from the registry', () => {
expect(APP_THEME_OPTIONS).toBe(THEME_REGISTRY);
expect(APP_THEME_OPTIONS.some(option => option.name === DEFAULT_APP_THEME)).toBe(true);
@@ -12,7 +12,8 @@ export {
export type {AppTheme, CustomPrimary} from './theme-registry';
export interface AppState {
themePreference?: AppTheme;
appearancePreference?: AppearancePreference;
customPrimary?: CustomPrimary;
themePreference: AppTheme;
appearancePreference: AppearancePreference;
customPrimary: CustomPrimary;
oledDarkMode: boolean;
}