Remove colour themes (vibe-kanban) (#805)

* Perfect! The backend changes are now complete. Here's a summary of what I've accomplished:

1. **Created new config version v7.rs**:
   - Defined new `ThemeMode` enum with only `Light`, `Dark`, `System`
   - Implemented proper migration from v6 that maps all color themes (Purple, Green, Blue, Orange, Red) to `System`
   - Added logging to inform users about the theme migration
   - Maintains all other config fields unchanged

2. **Updated config module system**:
   - Updated `mod.rs` to use v7 as the current config version
   - Added v7 module to the versions module
   - All config type aliases now point to v7 implementations

3. **Type generation**:
   - No changes needed to `generate_types.rs` - it automatically picks up the new v7 types
   - Successfully generated new TypeScript types
   - Verified that `shared/types.ts` now contains `ThemeMode` enum with only `LIGHT`, `DARK`, `SYSTEM`

4. **Migration behavior**:
   - Existing users with color themes will be automatically migrated to `System` theme on next app startup
   - Migration respects the established config versioning pattern
   - No data loss - users get a sensible default that respects their OS preference

The backend is now ready and the TypeScript types have been updated. All users with color themes will be gracefully migrated to System theme, which will respect their operating system's light/dark preference.

Ready for the frontend changes when you are!

Perfect! The TypeScript types are correctly updated to only contain the 3 theme modes.

I have successfully completed all the frontend changes to remove color theme support:

1. ** Updated theme-provider.tsx**:
   - Removed color theme classes (`'purple'`, `'green'`, `'blue'`, `'orange'`, `'red'`) from `classList.remove()`
   - Now only removes `'light'`, `'dark'` classes
   - Prettier formatting applied

2. ** Simplified theme.ts**:
   - Removed outdated comment about color themes mapping to dark
   - Updated logic to explicitly handle only `ThemeMode.DARK` instead of catch-all "other themes"
   - Function now cleanly handles only Light, Dark, and System modes

3. ** Settings UI automatically updated**:
   - The dropdown in `GeneralSettings.tsx` automatically populates from `Object.values(ThemeMode)`
   - Since the backend enum was updated to only include Light/Dark/System, the UI now shows only 3 options
   - No manual changes were needed - the architecture handled this automatically

- ** TypeScript compilation**: `npx tsc --noEmit` - No errors
- ** Linting**: `npm run lint` - 0 errors, 97 pre-existing warnings (unchanged)
- ** Formatting**: `npm run format:check` - All files properly formatted

1. **Theme switching** works seamlessly between Light/Dark/System only
2. **Settings UI** shows exactly 3 theme options instead of the previous 8
3. **CSS class cleanup** - no orphaned color theme classes remain on document root
4. **System theme** continues to properly detect OS preference
5. **User migration** - existing users with color themes will be automatically migrated to System theme on backend startup

The frontend changes are minimal, clean, and leverage the TypeScript type system to automatically update the UI. All functionality is preserved for the remaining Light/Dark/System themes while completely removing support for color themes.

**Ready for testing or deployment!** 🎉

* Format
This commit is contained in:
Alex Netsch
2025-09-22 17:01:02 +01:00
committed by GitHub
parent 798bcb80a3
commit eaed5ca7bf
6 changed files with 143 additions and 19 deletions

View File

@@ -90,7 +90,7 @@ export type Config = { config_version: string, theme: ThemeMode, executor_profil
export type NotificationConfig = { sound_enabled: boolean, push_enabled: boolean, sound_file: SoundFile, };
export enum ThemeMode { LIGHT = "LIGHT", DARK = "DARK", SYSTEM = "SYSTEM", PURPLE = "PURPLE", GREEN = "GREEN", BLUE = "BLUE", ORANGE = "ORANGE", RED = "RED" }
export enum ThemeMode { LIGHT = "LIGHT", DARK = "DARK", SYSTEM = "SYSTEM" }
export type EditorConfig = { editor_type: EditorType, custom_command: string | null, };