Skip to content

fix settings being cut off - #104

Merged
yanpla merged 5 commits into
mainfrom
fix/settings
Jul 26, 2026
Merged

fix settings being cut off#104
yanpla merged 5 commits into
mainfrom
fix/settings

Conversation

@yanpla

@yanpla yanpla commented Jul 26, 2026

Copy link
Copy Markdown
Member

No description provided.

@greptile-apps

greptile-apps Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes clipped settings controls and replaces fixed tint/accent preferences with live-loaded JSON themes.

  • Stacks wide settings fields vertically and allows cache/theme-folder controls to wrap.
  • Adds bundled Starlight JSON themes, a watched user theme directory, and a theme-name picker.
  • Converts the app palette and affected view colors from RGBA to HSLA.

Confidence Score: 3/5

The 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

T-Rex T-Rex Logs

What T-Rex did

  • Ran a focused Rust harness against the real core_service settings implementation to verify that existing appearance settings are discarded during upgrade, loading a legacy file with theme_name set to Starlight and applying a normal close_on_launch patch to confirm the persisted JSON contains theme_name Starlight and omits app_tint and accent_color (exit code 0).
  • Executed a narrow Rust harness with a forced write-failure fixture to test how writes desynchronize the theme, which started with global, active, and persisted themes at Starlight, but after switching to Dark the global and persisted themes remained Starlight while the active theme showed Dark, and reinitialization restored Starlight.
  • Attempted to open and interact with the Settings UI, but linker diagnostics prevented executable linking, so the Settings screen could not be opened, resized, or captured.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/backend/services/core_service.rs Replaces tint/accent persistence with theme_name but omits migration of existing appearance settings.
src/theme.rs Introduces bundled and watched JSON themes and projects the active component palette into the app theme.
src/views/settings.rs Fixes settings layout and adds theme controls, but applies a theme even when its settings write fails.
assets/themes/starlight.json Defines five bundled dark Starlight palettes using a common gold accent.
src/views/library_detail/mod.rs Updates danger-zone alpha handling for the HSLA theme conversion.
src/views/lobbies.rs Updates theme-derived display color types from RGBA to HSLA.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[settings.json theme_name] --> B[SettingsGlobal]
B --> C[theme::apply_saved]
D[Bundled and user JSON files] --> E[ThemeRegistry]
E --> C
C --> F[gpui-component Theme]
C --> G[App Theme projection]
F --> H[Component widgets]
G --> I[Application views]
Loading

Fix All in Codex

Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
src/backend/services/core_service.rs:117-118
**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.

### Issue 2 of 2
src/views/settings.rs:190
**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.

Reviews (1): Last reviewed commit: "fix settings being cut off" | Re-trigger Greptile

Comment on lines 117 to 118
#[serde(default = "default_true")]
pub show_stars_background: bool,

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.

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

View artifacts

T-Rex 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.

Fix in Codex

Comment thread src/views/settings.rs
},
);
reapply_theme(cx);
crate::theme::apply(cx, &value);

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.

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

Repro: verbose successful execution showing persisted/global Starlight versus active Dark and restart restoration

  • The full command output behind this check.

View artifacts

T-Rex 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.

Fix in Codex

@yanpla
yanpla merged commit d7ea8d6 into main Jul 26, 2026
2 checks passed
@yanpla
yanpla deleted the fix/settings branch July 26, 2026 11:28
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