Skip to content

feat(theme): optional CRT light theme - #361

Open
giancarloerra wants to merge 2 commits into
ZaparooProject:mainfrom
giancarloerra:feat/crt-light-theme
Open

feat(theme): optional CRT light theme#361
giancarloerra wants to merge 2 commits into
ZaparooProject:mainfrom
giancarloerra:feat/crt-light-theme

Conversation

@giancarloerra

@giancarloerra giancarloerra commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

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 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

    • Added a Browsing Theme setting with Default and CRT light options.
    • CRT light mode introduces a brighter background, panels, cards, and adjusted list text.
    • Theme selection is retained between sessions and applied automatically when the app starts.
  • Localization

    • Added and synchronized theme-related labels, including “CRT light,” across supported languages.
    • Refreshed translated settings and navigation entries to match the latest interface.

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.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@giancarloerra, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dabc77cd-d9e0-4336-a7ba-d1bb01f278ec

📥 Commits

Reviewing files that changed from the base of the PR and between 250faf6 and d8ebbea.

📒 Files selected for processing (1)
  • rust/zaparoo-core/src/persist.rs
📝 Walkthrough

Walkthrough

The PR adds a persisted theme setting with default and crt-light values. Rust exposes and stores the setting, QML provides a picker, and the theme renderer applies CRT-light colors. Translation catalogs are synchronized.

Changes

Theme setting

Layer / File(s) Summary
Configuration and persistence contracts
rust/zaparoo-core/src/config.rs, rust/zaparoo-core/src/persist.rs
Configuration and persisted state now store a normalized theme with a default fallback. Round-trip tests include crt-light.
Rust settings model integration
rust/frontend/src/models/settings.rs
The settings model exposes available themes, merges configuration and persisted values, normalizes updates, persists changes, mirrors configuration, and emits QML notifications.
QML theme picker and rendering
src/ui/screens/SettingsScreen.qml, src/ui/app/Main.qml, src/ui/app/MainLayout.qml, src/ui/theme/Theme.qml, src/ui/components/BrowseList.qml
QML adds theme selection and binds the selected value to Theme. CRT-light colors and inactive list-title colors are applied conditionally.
Translation catalog synchronization
src/ui/translations/frontend_*.ts
Translation source locations are synchronized across QML files. Theme-related entries, including Theme and CRT light, are registered.

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
Loading

Possibly related PRs

Suggested reviewers: asturur, wizzomafizzo

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the feature and motivation but omits required screenshots, test plan, and checklist details. Add screenshots or recordings, document manual and automated testing, and complete the checklist, including QML performance verification.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the addition of the optional CRT light theme.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
rust/zaparoo-core/src/config.rs (1)

1019-1182: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add round-trip assertions for theme in the three mirror tests.

save_settings_mirror_creates_sections, save_settings_mirror_preserves_other_sections, and save_settings_mirror_normalizes_auto each set theme in the SettingsMirror literal, but none of them assert the persisted or reloaded value. Every other field in SettingsMirror (orientation, clock_format, browse_layout, system_logo_style, button_layout, and so on) has a matching assert_eq! on cfg.settings.* after load_config. Add the same check for theme in 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

📥 Commits

Reviewing files that changed from the base of the PR and between e206d67 and 250faf6.

📒 Files selected for processing (24)
  • rust/frontend/src/models/settings.rs
  • rust/zaparoo-core/src/config.rs
  • rust/zaparoo-core/src/persist.rs
  • src/ui/app/Main.qml
  • src/ui/app/MainLayout.qml
  • src/ui/components/BrowseList.qml
  • src/ui/screens/SettingsScreen.qml
  • src/ui/theme/Theme.qml
  • src/ui/translations/frontend_ar.ts
  • src/ui/translations/frontend_de.ts
  • src/ui/translations/frontend_el.ts
  • src/ui/translations/frontend_en.ts
  • src/ui/translations/frontend_es.ts
  • src/ui/translations/frontend_eu.ts
  • src/ui/translations/frontend_he.ts
  • src/ui/translations/frontend_hi.ts
  • src/ui/translations/frontend_it.ts
  • src/ui/translations/frontend_ja.ts
  • src/ui/translations/frontend_ko.ts
  • src/ui/translations/frontend_nl.ts
  • src/ui/translations/frontend_ro.ts
  • src/ui/translations/frontend_sk.ts
  • src/ui/translations/frontend_uk.ts
  • src/ui/translations/frontend_zh_CN.ts

Comment thread rust/zaparoo-core/src/persist.rs Outdated
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