feat: add app settings store (theme, UI state, prefs)#34
Merged
Conversation
Connections were the only persisted state, so app preferences (theme, update-check toggle, sidebar/filter UI state, editor prefs) reset on every launch. Add a SettingsStore that serializes AppSettings to settings.json in the same config dir as connections.json, mirroring ConnStore's load/flush shape but without a secret backend since nothing here is sensitive.
Load SettingsStore at startup next to ConnStore (same RDBS_STORE_DIR / mock overrides), apply the saved theme before first paint, and restore the sidebar groups the user had collapsed. The theme toggle and group-collapse handlers now write their new state back to settings.json. Filter text stays session-only for now — restoring it needs the picker FilterField to expose a settable text property; noted in a ponytail comment.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
crates/connstore/src/settings.rs:SettingsStoreserializingAppSettings(theme, update_check, last_update_check, ui_state, editor prefs) tosettings.jsonin the same config dir asconnections.json. Mirrors ConnStore's load/flush; no secret backend (nothing sensitive).app/src/main.rs: load at startup (same RDBS_STORE_DIR / mock overrides), apply saved theme before first paint, restore collapsed sidebar groups, persist on theme toggle and group collapse.Test plan
cargo test -p rdbs-connstore(round-trip, defaults-when-absent, partial-json).make lint/ workspace tests green.settings.json.