feat: Implement user theme preference settings #3160
Conversation
…e appearance handling - Introduced a new `ThemeAppearance` component to manage user theme preferences, allowing selection between 'auto', 'light', and 'dark' themes. - Updated state management to include `userThemePreference`, replacing the previous `themeAppearance` handling. - Removed deprecated theme appearance logic from various components and files, streamlining the codebase. - Added internationalization support for theme appearance settings across multiple languages. - Enhanced the UI to reflect user-selected theme preferences dynamically.
WalkthroughImplements a global user theme preference: adds persisted Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Settings as Settings UI
participant Redux as Redux Store
participant Shell as Shell Component
participant System as OS Theme
User->>Settings: Choose theme (auto / light / dark)
Settings->>Redux: Dispatch SETTINGS_USER_THEME_PREFERENCE_CHANGED
Redux->>Redux: userThemePreference reducer updates state
Redux-->>Shell: State change notification
alt userThemePreference == "auto"
Shell->>System: Query machineTheme
System-->>Shell: machineTheme
Shell->>Shell: currentTheme = machineTheme
else
Shell->>Shell: currentTheme = userThemePreference
end
Shell->>Shell: Apply currentTheme to UI
Shell-->>User: Theme updated globally
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Updated the `handleChangeTheme` function to include validation for theme preference values, ensuring only 'auto', 'light', or 'dark' are accepted. This change prevents invalid values from being dispatched, enhancing the robustness of the theme management logic.
ThemeAppearancecomponent to manage user theme preferences, allowing selection between 'auto', 'light', and 'dark' themes.userThemePreference, replacing the previousthemeAppearancehandling.CORE-1554
Summary by CodeRabbit
New Features
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.