fix settings being cut off - #104
Conversation
Greptile SummaryThis PR fixes clipped settings controls and replaces fixed tint/accent preferences with live-loaded JSON themes.
Confidence Score: 3/5The settings migration and failed-write synchronization defects should be fixed before merging. Existing users lose their saved tint and accent on upgrade, while a failed theme persistence operation can leave the rendered theme inconsistent with both the settings UI and disk. Files Needing Attention: src/backend/services/core_service.rs, src/views/settings.rs
What T-Rex did
Important Files Changed
|
| #[serde(default = "default_true")] | ||
| pub show_stars_background: bool, |
There was a problem hiding this comment.
Existing appearance settings are discarded
When a user upgrades with app_tint and accent_color in settings.json, deserialization ignores those removed fields and defaults theme_name to Starlight, resetting the selected tint and accent; the next settings update permanently removes the old values.
Artifacts
Repro: Rust harness exercising real settings deserialization and persistence
- Evidence file captured while the check ran.
Repro: minimal Cargo manifest for the Rust harness
- Evidence file captured while the check ran.
Repro: verbose successful Cargo execution showing default theme and discarded legacy fields
- The full command output behind this check.
Repro: legacy input settings containing violet app_tint and green accent_color without theme_name
- Evidence file captured while the check ran.
Repro: persisted output containing Starlight theme_name with both legacy appearance fields removed
- Evidence file captured while the check ran.
Ran code and verified through T-Rex
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/backend/services/core_service.rs
Line: 117-118
Comment:
**Existing appearance settings are discarded**
When a user upgrades with `app_tint` and `accent_color` in `settings.json`, deserialization ignores those removed fields and defaults `theme_name` to `Starlight`, resetting the selected tint and accent; the next settings update permanently removes the old values.
How can I resolve this? If you propose a fix, please make it concise.| }, | ||
| ); | ||
| reapply_theme(cx); | ||
| crate::theme::apply(cx, &value); |
There was a problem hiding this comment.
Failed writes desynchronize the theme
When settings.json cannot be written, app_settings::update retains the previous global value, but this unconditional call still applies the requested theme, causing the dropdown and persisted setting to disagree with the rendered UI and reverting the selection after restart.
Artifacts
Repro: executable Rust harness and forced write-failure fixture
- Evidence file captured while the check ran.
Repro: Cargo manifest for the narrow executable harness
- Evidence file captured while the check ran.
- The full command output behind this check.
Ran code and verified through T-Rex
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/views/settings.rs
Line: 190
Comment:
**Failed writes desynchronize the theme**
When `settings.json` cannot be written, `app_settings::update` retains the previous global value, but this unconditional call still applies the requested theme, causing the dropdown and persisted setting to disagree with the rendered UI and reverting the selection after restart.
How can I resolve this? If you propose a fix, please make it concise.
No description provided.