673 Commits

Author SHA1 Message Date
Jason
464ca70d7b feat(init): only import from live when providers are empty; create a single 'default' entry and set as current
- Remove special handling for 'current' entry
- Import default only when manager.providers is empty
- Name/id the initial entry 'default' and mark it current
2025-09-05 15:07:00 +08:00
Jason
2dca85c881 refactor(migration): run dedupe only during first-time migration; remove startup dedupe
- Remove per-startup dedupe; keep it limited to migration
- Call dedupe at end of migrate_copies_into_config, then write marker
- Avoid unintended changes on every app launch
2025-09-05 14:48:03 +08:00
Jason
837435223a chore(migration): remove legacy copy files after successful archive
- During copies→config migration, delete original legacy files only if archived
- Applies to Claude settings-* and Codex auth-*/config-* pairs
- Keep archive_file non-destructive for live backups
2025-09-05 14:29:16 +08:00
Jason
79ad0b9368 fix(provider): prevent case-insensitive name + key duplicates; migrate and startup dedupe
- Use case-insensitive compare for name + API key in migration
- Add runtime uniqueness checks in add/update commands
- Startup dedupe prefers current provider; archives others
- Keep original display casing; only normalize for comparisons
- Validate Codex config.toml as before; archive before overwrite
2025-09-05 14:26:11 +08:00
Jason
5624a2d11a feat(tauri): sync current provider edits to live config and archive before overwrite\n\n- Update: when editing the current provider, persist changes to live files (Claude settings.json; Codex auth.json + config.toml) and archive previous versions first.\n- Align add_provider behavior: archive live files before overwriting if the added provider is current.\n- Hardening: when deleting a Claude provider, also attempt removing legacy copy path by id (settings-{id}.json).\n\nThis keeps switching, adding and editing consistent with SSOT design and improves safety via archival. 2025-09-05 11:00:53 +08:00
Jason
29367ff576 refactor(rust): remove unused code/imports to silence warnings\n\n- Drop unused backup/import helpers and redundant imports\n- Remove unnecessary mut parameter\n- Remove unused ProviderManager::add_provider\n 2025-09-05 10:19:14 +08:00
Jason
64c94804ee chore(rust): revert Cargo edition to 2021\n\n- Lower edition from "2024" to "2021" for broader toolchain compatibility\n- Keep rust-version and deps unchanged\n 2025-09-05 10:19:14 +08:00
Jason
1d9fb7bf26 fix(tauri): correct window config and CSP\n\n- Set titleBarStyle to "Transparent" to match v2 schema\n- Add ipc: and http://ipc.localhost to connect-src for IPC\n- Add label: "main" for the primary window\n 2025-09-05 10:19:14 +08:00
Jason
30a441d9ec refactor(migration): dedupe by (name + raw key) without hashing\n\n- Compare API key strings directly for Claude/Codex during migration\n- Remove sha2/hex deps and hashing helpers\n- Keep O(N^2) matching acceptable for small provider sets 2025-09-04 23:00:16 +08:00
Jason
33753c72cd docs: update plan to use 'current' instead of 'default' for initial import\n\n- Aligns documentation with implementation across migration and import flows 2025-09-04 22:39:03 +08:00
Jason
02d7eca2ad refactor(import): rename default imported provider to 'current'\n\n- import_default_config now creates provider id/name 'current'\n- Avoid duplicate import by checking 'current' key\n- Set manager.current to 'current' when empty 2025-09-04 21:38:35 +08:00
Jason
2c6fe6c31a chore(migration): use 'current' as the name for live-imported providers\n\n- Rename live-imported provider name from 'default' to 'current' for Claude/Codex\n- Keeps current selection logic intact when setting manager.current 2025-09-04 21:35:51 +08:00
Jason
ab71b11532 feat(migration-live): import current live settings on first run and set as current if empty\n\n- Read Claude ~/.claude/settings.json and Codex ~/.codex/auth.json + config.toml\n- Merge with priority: live > copies > existing\n- Set manager.current to the live-imported provider when empty 2025-09-04 21:33:19 +08:00
Jason
a858596fa2 feat(edit-current): allow editing current provider and sync to live on save\n\n- Enable Edit button for current provider in UI\n- On update_provider, if updating current provider, write changes to live config (Claude/Codex)\n- Maintain SSOT in cc-switch/config.json with atomic writes 2025-09-04 16:34:47 +08:00
Jason
5176134c28 feat(migration): import provider copy files into cc-switch config on first run\n\n- Scan Claude settings-*.json and Codex auth-*.json/config-*.toml\n- Merge into ~/.cc-switch/config.json, de-dupe by provider name (override with copies)\n- Backup old config.json and archive all scanned copy files\n- Add migration marker to avoid re-importing\n- Stop writing provider copy files in ProviderManager::add_provider 2025-09-04 16:16:51 +08:00
Jason
79370dd8a1 feat(backup): archive current live config before switching\n\n- Archive Claude settings.json and Codex auth.json/config.toml to ~/.cc-switch/archive/<ts>\n- Preserve user edits while centralizing SSOT in cc-switch config.json\n- Uses atomic writes for all subsequent updates 2025-09-04 16:07:38 +08:00
Jason
3c32f12152 refactor(ssot): stop writing per-provider backup files on add/update/import\n\n- Add/update no longer write vendor copy files for Claude and Codex\n- Keep all state in memory (persisted via app config) to enforce SSOT\n- Import default provider now only reads from live config 2025-09-04 16:00:45 +08:00
Jason
64f7e47b20 feat(fs): atomic writes for JSON and TOML saves\n\n- Introduce atomic_write utility and use it in write_json_file\n- Add write_text_file for TOML/strings and use in Codex paths\n- Reduce risk of partial writes and ensure directory creation 2025-09-04 16:00:19 +08:00
Jason
25c112856d feat(ssot): backfill live config and write from in-memory settings during switch\n\n- Stop relying on provider backup files for switching (Claude/Codex)\n- Backfill current live config into the active provider before switching\n- Write target provider settings directly to app main config\n- Avoid writing provider copies when importing default provider 2025-09-04 15:59:28 +08:00
farion1231
3665a79e50 chore: bump version to v3.1.1
- Update version in package.json, Cargo.toml, and tauri.conf.json
- Add CHANGELOG entries for v3.1.0 and v3.1.1
v3.1.1
2025-09-03 16:43:29 +08:00
farion1231
4dce31aff7 Fix the default codex config.toml to match the latest modifications. 2025-09-03 16:33:12 +08:00
Jason
451ca949ec feat(ui): improve provider configuration UX with custom option
- Add explicit "Custom" button in preset selection
- Set "Custom" as default selection when adding new provider
- Update label from "One-click import" to "Choose configuration type"
- Add contextual hints for different configuration modes:
  - Custom mode: "Manually configure provider, complete configuration required"
  - Official preset: "Official login, no API Key required"
  - Other presets: "Use preset configuration, only API Key required"
- Remove redundant "(optional)" text from Codex config.toml hint
- Improve clarity for users who were confused about adding custom providers
2025-09-03 15:58:02 +08:00
Jason
a9ff8ce01c update readme 2025-09-01 15:33:24 +08:00
Jason Young
7848248df7 Merge pull request #3 from farion1231/codex-adaptation
feat(codex): 支持 Codex 供应商管理与一键切换;迁移前自动备份
v3.1.0
2025-09-01 11:41:31 +08:00
Jason
b00e8de26f feat(config): backup v1 file before v2 migration
- Add timestamped backup at `~/.cc-switch/config.v1.backup.<ts>.json`
- Keep provider files untouched; only cc-switch metadata is backed up
- Remove UI notification plan; backup only as requested
- Update CHANGELOG with migration backup notes
2025-09-01 10:49:31 +08:00
Jason
47b06b7773 feat(ui): elevate title above controls for better visual hierarchy
Move title to separate row above switcher and action buttons for cleaner layout.
2025-08-31 23:13:27 +08:00
Jason
4e66f0c105 feat(ui): center title and balance header layout
Unify title to "CC Switch" to prevent text length jumping during app switching.
Reorganize header as three-column grid with centered title.
2025-08-31 21:49:28 +08:00
Jason
84c7726940 feat(ui): implement pills-style AppSwitcher with consistent button widths
Replace segmented control with pills-style switcher for better visual consistency.
2025-08-31 21:27:58 +08:00
Jason
b8f59a4740 chore: silence non_snake_case warnings in commands.rs for legacy app/appType compatibility
- Add crate-level allow(non_snake_case) in src-tauri/src/commands.rs
- Keeps compatibility while avoiding compiler warnings
2025-08-31 19:00:09 +08:00
Jason
06a19519c5 revert: restore app/appType param compatibility and revert segmented-thumb pointer-events change
- Restore backend commands to accept app_type/app/appType with priority app_type
- Frontend invoke() now passes both { app_type, app } again
- Revert CSS change that set pointer-events: none on segmented-thumb
- Keep minor fix: open_config_folder signature uses handle + respects both names

Note: warnings for non_snake_case (appType) are expected for compatibility.
2025-08-31 18:14:31 +08:00
Jason
b4ebb7c9e5 docs(codex): document Codex config directory, fields (OPENAI_API_KEY), empty config.toml behavior, and switching strategy in README 2025-08-31 17:17:22 +08:00
Jason
5edc3e07a4 feat(codex): validate non-empty config.toml with toml crate (syntax check in save/import) 2025-08-31 17:13:25 +08:00
Jason
417dcc1d37 feat(codex): require OPENAI_API_KEY when non-official preset selected; keep config.toml optional 2025-08-31 17:07:35 +08:00
Jason
72f6068e86 Revert "feat(ui): enhance Codex provider list display by extracting base_url/model_provider from config.toml; plumb appType into ProviderList"
This reverts commit 97e7f34260.
2025-08-31 17:02:15 +08:00
Jason
97e7f34260 feat(ui): enhance Codex provider list display by extracting base_url/model_provider from config.toml; plumb appType into ProviderList 2025-08-31 16:55:55 +08:00
Jason
74babf9730 refactor(api): unify Tauri command app param as app_type with backward-compatible app/appType; update front-end invocations accordingly 2025-08-31 16:43:33 +08:00
Jason
30fe800ebe fix(codex): correct config path reporting and folder opening; allow empty config.toml; unify API key field as OPENAI_API_KEY; front-end invoke uses app_type/app fallback for Tauri commands 2025-08-31 16:39:38 +08:00
Jason
c98a724935 feat(ui): 优化首页切换为分段控件;精简 Banner 间距;标题在上切换在下 2025-08-31 00:03:22 +08:00
Jason
0cb89c8f67 chore(codex): 调整 Codex 预设模板与占位符(auth.json/config.toml 与表单占位) 2025-08-30 23:02:49 +08:00
Jason
7b5d5c6ce1 refactor(codex): 选择 Codex 预设时清空 API Key 输入,避免误保存占位符 2025-08-30 22:09:19 +08:00
Jason
eea5e4123b feat(codex): 增加 Codex 预设供应商(官方、PackyCode);在添加供应商时支持一键预设与 API Key 自动写入 auth.json;UI 同步 Codex 预设按钮与字段 2025-08-30 22:08:41 +08:00
Jason
c10ace7a84 - feat(codex): 引入 Codex 应用与供应商切换(管理 auth.json/config.toml,支持备份与恢复)
- feat(core): 多应用配置 v2(claude/codex)与 ProviderManager;支持 v1→v2 自动迁移
- feat(ui): 新增 Codex 页签与双编辑器表单;统一 window.api 支持 app 参数
- feat(tauri): 新增 get_config_status/open_config_folder/open_external 命令并适配 Codex
- fix(codex): 主配置缺失时不执行默认导入(对齐 Claude 行为)
- chore: 配置目录展示与重启提示等细节优化
2025-08-30 21:54:52 +08:00
farion1231
0e803b53d8 update readme 2025-08-29 15:37:26 +08:00
Jason
49d8787ab9 ci(release): generate macOS zip, Windows installer + portable, Linux deb; split per-OS build and asset steps v3.0.1 2025-08-29 14:57:33 +08:00
Jason
a05fefb54c feat: optimize release workflow for better distribution
- Configure GitHub Actions to generate platform-specific releases:
  - macOS: zip package only (avoids signing issues)
  - Windows: installer (NSIS) and portable version
  - Linux: AppImage and deb packages
- Update Tauri config to build all available targets
- Add documentation for macOS signature workarounds
2025-08-29 14:40:40 +08:00
Jason
3574fa07cb ci(workflows): restore tag-only release; keep Linux deps 2025-08-29 12:11:16 +08:00
Jason Young
b64b86f3ca Merge pull request #2 from farion1231/tauri-migration
feat: migrate from Electron to Tauri 2.0 (v3.0.0)
v3.0.0
2025-08-29 11:56:31 +08:00
Jason
2cf116280f feat: add prettier formatter and MIT license
- Add prettier dev dependency for code formatting
- Create MIT LICENSE file
- Format TypeScript files with prettier
- Update provider order in README (Qwen coder first)
- Update add provider screenshot with new UI
2025-08-29 11:35:17 +08:00
Jason
73cf337c42 fix(config): create settings.json on first run; keep legacy claude.json read compatibility 2025-08-29 10:50:10 +08:00
Jason
fa2d64b692 feat: add official preset orange theme and disabled API input
- Add Anthropic orange theme styling for official preset buttons
- Auto-disable API Key input field when official preset is selected
- Add isOfficial field for precise official preset identification
- Enhance UX: official login requires no manual API Key input
2025-08-29 09:03:11 +08:00