Skip to content

Theme toggle, settings refactoring - #289

Merged
insolor merged 3 commits into
mainfrom
feature/theme-toggle
Nov 23, 2026
Merged

insolor merged 3 commits into
mainfrom
feature/theme-toggle

Conversation

@insolor

@insolor insolor commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Added a theme control to switch between system, light, and dark appearance. Your choice is saved and restored when you reopen the app.
    • Binary path and selected language preferences are saved and restored between sessions.
  • Bug Fixes
    • Saving theme preferences now reports an error in the app if the save fails.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The app now stores settings separately from cached hook and dictionary metadata. Startup and shutdown use the updated persistence flow. The status bar adds a control to cycle and save the theme preference.

Changes: Settings and application startup

Layer / File(s) Summary
Settings and cache persistence contracts
src/settings.rs, src/cache.rs, src/constants.rs, .gitignore, src/persistent.rs
Settings stores the binary path, selected language, and theme in the settings file. Cache stores hook and dictionary manifests. Settings fall back to the cache file only when the settings file is missing. The previous Store implementation is removed, and the settings file is ignored by Git.
Startup and shutdown persistence
src/logic.rs
Startup reads the binary path and language from settings, loads metadata through Cache, and sends the result using StartupDataLoaded. On close, valid binary and language values are saved to settings. Metadata is saved through Cache only if settings save succeeds and the binary is valid.
Theme preference and UI integration
src/app.rs, src/main.rs
The app loads settings and applies the saved theme preference to the egui context. The status bar adds a theme control that cycles preferences and saves the selection. A save error displays a toast.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant App
  participant EguiContext
  participant SettingsFile
  App->>SettingsFile: Read settings during initialization
  SettingsFile-->>App: Return saved theme preference
  App->>EguiContext: Apply saved theme preference
  User->>App: Click theme control
  App->>EguiContext: Resolve system theme
  App->>SettingsFile: Save selected theme preference
Loading

Suggested reviewers: shevernitskiy, iwanthappiness

Merge Risk: Minimal · up to 1580c

This change adds a status-bar theme toggle and stores installer settings in their own file, separate from the cached manifest metadata. Theme choices persist across launches and existing settings are migrated from the old cache file. No merge-blocking issue was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Theme toggle, settings refactoring" matches the main changes. The PR adds a theme toggle control in src/app.rs that cycles System, Light, and Dark. It also separates installer settings into…
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.
Full details: Title check

Explanation

The title "Theme toggle, settings refactoring" matches the main changes. The PR adds a theme toggle control in src/app.rs that cycles System, Light, and Dark. It also separates installer settings into a new Settings struct (src/settings.rs) and moves manifest data into a Cache struct (src/cache.rs), replacing the persistent Store. The title is short and names both primary changes. It does not mention the removal of persistent.rs or the startup message rename, but those are secondary details.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 92c561f0-3e6e-48df-b230-1d41953bb6fe
Commits

Reviewing files that changed from the base of the PR and between 79f88b6 and 1580c17.

Files selected for processing: 8

  • .gitignore
  • src/app.rs
  • src/cache.rs
  • src/constants.rs
  • src/logic.rs
  • src/main.rs
  • src/persistent.rs
  • src/settings.rs
Files with no reviewable changes: 1

  • src/persistent.rs

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@insolor
insolor force-pushed the feature/theme-toggle branch from fe757ee to 1580c17 Compare November 23, 2026 15:28
@insolor insolor changed the title Feature/theme toggle Theme toggle, settings refactoring Nov 23, 2026
@insolor
insolor merged commit 99265f7 into main Nov 23, 2026
3 checks passed
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