Skip to content

feat(theme): add customizable theme system with live switching#548

Merged
echobt merged 1 commit intomasterfrom
feat/theme-system-1769998431
Feb 2, 2026
Merged

feat(theme): add customizable theme system with live switching#548
echobt merged 1 commit intomasterfrom
feat/theme-system-1769998431

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Feb 2, 2026

Summary

Add comprehensive theme support for the TUI with real-time theme switching capability.

Changes

Core Theme System

  • Add ThemeConfig struct with serde support for persistence
  • Define 4 built-in themes: dark, light, ocean_dark, monokai
  • Add ThemeColors with from_name() lookup and available_themes() list
  • Add MarkdownTheme variants for each theme with full color customization

TUI Integration

  • Add ThemeSelectorModal for interactive theme selection
  • Add 'Change Theme' command to command palette (Settings category)
  • Extend AdaptiveColors with theme support methods
  • Add theme state to AppState with set_theme() method

User Experience

  • Update rendering pipeline to use theme from state
  • Add themed markdown rendering for conversation display
  • Live switching: Theme changes apply instantly to the entire UI
  • Persistence: Last selected theme is saved and restored on startup

Files Changed

  • src/cortex-core/src/markdown/theme.rs - MarkdownTheme variants
  • src/cortex-core/src/style.rs - ThemeColors definitions
  • src/cortex-tui/src/modal/theme.rs - ThemeSelectorModal
  • src/cortex-tui/src/ui/colors.rs - AdaptiveColors theme support
  • Various rendering and state files

Testing

  • Code compiles with cargo check
  • Theme switching works in real-time
  • Theme persists across sessions

Add comprehensive theme support for the TUI with real-time theme switching:

Core:
- Add ThemeConfig struct with serde support for persistence
- Define 4 built-in themes: dark, light, ocean_dark, monokai
- Add ThemeColors with from_name() lookup and available_themes() list
- Add MarkdownTheme variants for each theme with full color customization

TUI:
- Add ThemeSelectorModal for interactive theme selection
- Add 'Change Theme' command to command palette (Settings category)
- Extend AdaptiveColors with theme support methods
- Add theme state to AppState with set_theme() method

Integration:
- Update rendering pipeline to use theme from state
- Add themed markdown rendering for conversation display
- Persist last selected theme to config file
- Load saved theme preference on app startup
@echobt echobt force-pushed the feat/theme-system-1769998431 branch from d14ffb6 to d60bd2e Compare February 2, 2026 02:17
@echobt echobt merged commit 712642f into master Feb 2, 2026
2 of 4 checks passed
@echobt echobt deleted the feat/theme-system-1769998431 branch February 2, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant