- feat(vscode-sync): restore auto-sync logic and enable by default

- refactor(settings): remove the VS Code auto-sync toggle from Settings UI
- feat(provider-list): enable auto-sync after "Apply to VS Code"; disable after "Remove"
- chore(prettier): run Prettier on changed files
- verify: typecheck and renderer build pass

- Files
  - added: src/hooks/useVSCodeAutoSync.ts
  - modified: src/App.tsx
  - modified: src/components/ProviderList.tsx
  - modified: src/components/SettingsModal.tsx

- Notes
  - Auto-sync now defaults to enabled for new users (stored in localStorage; existing saved state is respected).
  - No settings toggle is shown; manual Apply/Remove in the list still works as before.
This commit is contained in:
Jason
2025-09-19 15:48:35 +08:00
parent 7522ba3e03
commit 31cdc2a5cf
3 changed files with 12 additions and 29 deletions

View File

@@ -114,7 +114,7 @@ function App() {
unlisten();
}
};
}, [activeApp, isAutoSyncEnabled]); // 依赖自动同步状态,确保拿到最新开关
}, [activeApp, isAutoSyncEnabled]);
const loadProviders = async () => {
const loadedProviders = await window.api.getProviders(activeApp);
@@ -183,7 +183,7 @@ function App() {
});
};
// 同步Codex供应商到VS Code设置
// 同步Codex供应商到VS Code设置(静默覆盖)
const syncCodexToVSCode = async (providerId: string, silent = false) => {
try {
const status = await window.api.getVSCodeSettingsStatus();