feat(theme): optional CRT light theme - #361
Conversation
Adds a persisted theme setting (default | crt-light) with a Settings row, following the existing picker-setting pattern end to end. The crt-light palette lifts the app background, surfaces, bottom bar, and modal panels, and brightens unselected list-row titles: the stock near-black palette reads far too dark on analog CRT output, and once the surfaces lighten the mid-grey unselected titles lose their contrast. Default is unchanged; the theme switches live via the existing Theme singleton bindings, no restart needed. The setting is a string rather than a boolean so future palettes slot in without a settings migration.
|
Warning Review limit reached
Next review available in: 59 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds a persisted ChangesTheme setting
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant SettingsScreen
participant Main
participant BrowseSettings
participant Theme
SettingsScreen->>Main: Open theme picker
Main->>BrowseSettings: Set selected theme
BrowseSettings->>Theme: Update current theme
Theme-->>SettingsScreen: Display selected theme
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
rust/zaparoo-core/src/config.rs (1)
1019-1182: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd round-trip assertions for
themein the three mirror tests.
save_settings_mirror_creates_sections,save_settings_mirror_preserves_other_sections, andsave_settings_mirror_normalizes_autoeach setthemein theSettingsMirrorliteral, but none of them assert the persisted or reloaded value. Every other field inSettingsMirror(orientation,clock_format,browse_layout,system_logo_style,button_layout, and so on) has a matchingassert_eq!oncfg.settings.*afterload_config. Add the same check forthemein each test so a persistence regression for the new setting is caught.♻️ Proposed assertion additions
#[test] fn save_settings_mirror_creates_sections() { ... let cfg = load_config(&path); ... assert_eq!(cfg.settings.system_logo_style.as_deref(), Some("color")); + assert_eq!(cfg.settings.theme.as_deref(), Some("crt-light")); assert_eq!(cfg.settings.button_layout.as_deref(), Some("b"));#[test] fn save_settings_mirror_preserves_other_sections() { ... assert_eq!(cfg.settings.system_logo_style.as_deref(), Some("tinted")); + assert_eq!(cfg.settings.theme.as_deref(), Some("default")); assert_eq!(cfg.settings.button_layout.as_deref(), Some("a"));#[test] fn save_settings_mirror_normalizes_auto() { ... assert!(written.contains("system_logo_style = \"color\"")); + assert!(written.contains("theme = \"crt-light\"")); assert!(written.contains("button_layout = \"c\"")); ... assert_eq!(cfg.settings.system_logo_style.as_deref(), Some("color")); + assert_eq!(cfg.settings.theme.as_deref(), Some("crt-light")); assert_eq!(cfg.settings.button_layout.as_deref(), Some("c"));🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@rust/zaparoo-core/src/config.rs` around lines 1019 - 1182, Add round-trip assertions for cfg.settings.theme in save_settings_mirror_creates_sections, save_settings_mirror_preserves_other_sections, and save_settings_mirror_normalizes_auto, matching each test’s SettingsMirror theme value after load_config.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@rust/zaparoo-core/src/persist.rs`:
- Around line 114-117: Update the doc comment above the theme field in the
persist configuration to use the American English spelling “color” instead of
“colour”; leave the surrounding documentation and #[serde(default =
"default_theme")] behavior unchanged.
---
Nitpick comments:
In `@rust/zaparoo-core/src/config.rs`:
- Around line 1019-1182: Add round-trip assertions for cfg.settings.theme in
save_settings_mirror_creates_sections,
save_settings_mirror_preserves_other_sections, and
save_settings_mirror_normalizes_auto, matching each test’s SettingsMirror theme
value after load_config.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2dcb3c5f-5702-44d9-b3af-67912f1c4136
📒 Files selected for processing (24)
rust/frontend/src/models/settings.rsrust/zaparoo-core/src/config.rsrust/zaparoo-core/src/persist.rssrc/ui/app/Main.qmlsrc/ui/app/MainLayout.qmlsrc/ui/components/BrowseList.qmlsrc/ui/screens/SettingsScreen.qmlsrc/ui/theme/Theme.qmlsrc/ui/translations/frontend_ar.tssrc/ui/translations/frontend_de.tssrc/ui/translations/frontend_el.tssrc/ui/translations/frontend_en.tssrc/ui/translations/frontend_es.tssrc/ui/translations/frontend_eu.tssrc/ui/translations/frontend_he.tssrc/ui/translations/frontend_hi.tssrc/ui/translations/frontend_it.tssrc/ui/translations/frontend_ja.tssrc/ui/translations/frontend_ko.tssrc/ui/translations/frontend_nl.tssrc/ui/translations/frontend_ro.tssrc/ui/translations/frontend_sk.tssrc/ui/translations/frontend_uk.tssrc/ui/translations/frontend_zh_CN.ts
Summary
Adds a persisted
themesetting (default|crt-light) with a Settings row, following the existing picker-setting pattern end to end. The crt-light palette lifts the app background, surfaces, bottom bar and modal panels, and brightens unselected list-row titles — the stock near-black palette reads far too dark on analog CRT output, and once the surfaces lighten, the mid-grey unselected titles lose their contrast against them.Default is unchanged and remains the default. The theme switches live through the existing Theme singleton bindings, no restart needed. The setting is a string rather than a boolean so future palettes slot in without a settings migration.
Translations: catalogues refreshed for the new labels.
Related: the CRT sizing fix in #348 and the MiSTer performance work in #360 — this rounds out the CRT experience but is independent of both.
Summary by CodeRabbit
New Features
Localization