Skip to content

fix(settings): use app config dir for app settings#2573

Open
keta1 wants to merge 1 commit intofarion1231:mainfrom
keta1:codex/fix-app-settings-dir-override
Open

fix(settings): use app config dir for app settings#2573
keta1 wants to merge 1 commit intofarion1231:mainfrom
keta1:codex/fix-app-settings-dir-override

Conversation

@keta1
Copy link
Copy Markdown

@keta1 keta1 commented May 4, 2026

Summary

  • Store AppSettings in the app config directory instead of hard-coding ~/.cc-switch/settings.json
  • Update the settings-path helper to return a concrete app-config path
  • Keep the documentation comment aligned with the actual storage location

Migration Note

The current implementation changes where local AppSettings are read and written. Users who previously used a custom CC Switch config directory may temporarily lose their local settings because the app will start reading <app_config_dir>/settings.json instead of the old ~/.cc-switch/settings.json location.

Those users need to manually migrate their existing settings.json into the active app config directory.

Copy link
Copy Markdown
Owner

@codex review
@claude review

@claude
Copy link
Copy Markdown

claude Bot commented May 5, 2026

Claude finished @farion1231's task in 1m 33s —— View job


Claude PR Review

  • Read the PR diff and changed files
  • Check for related code that may rely on old path
  • Verify cross-platform implications
  • Post review feedback

LGTM. No blocking issues.

The change correctly aligns AppSettings storage with get_app_config_dir(), including its override path. I traced the touchpoints:

  • get_app_config_dir_override (in app_store.rs) is sourced from a separate Tauri Store (app_paths.json), not from settings.json, so there is no chicken-and-egg between the override and the new settings location.
  • app_store::refresh_app_config_dir_override runs in lib.rs:286 before any caller of crate::settings::* (all other callers are behind window events, commands, or post-setup callbacks), so the lazy OnceLock init in settings_store() will see the correct override.
  • AppSettings::settings_path() is only used inside src-tauri/src/settings.rs, so widening it to pub(crate) is harmless.
  • The on-disk filename is unchanged (settings.json), so users on the default config dir keep their data without any migration.

One observation worth confirming, already called out in the PR description: users who previously set a custom app-config-dir override will silently leave their old ~/.cc-switch/settings.json orphaned (no auto-import, no fallback read). That is an explicit choice per the PR body — flagging only so the migration note makes it into release notes / upgrade docs.
• Branch: codex/fix-app-settings-dir-override

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

2 participants