feat(settings): add 'Apply to Claude Code extension' toggle

- Apply immediately on save (write or remove primaryApiKey)
- Honor setting on provider switch (enabled: write for non-official, remove for official; disabled: no auto writes)
- Remove per-provider Claude plugin buttons from ProviderList
- Upsert primaryApiKey=any preserving other fields; respect override dir
- Add zh/en i18n for the new setting
This commit is contained in:
Jason
2025-10-10 16:35:21 +08:00
parent 70d8d2cc43
commit c350e64687
8 changed files with 87 additions and 87 deletions

View File

@@ -183,9 +183,14 @@ function App() {
});
};
// 同步 Claude 插件配置(写入/移除固定 JSON
// 同步 Claude 插件配置(按设置决定是否联动;开启时:非官方写入,官方移除
const syncClaudePlugin = async (providerId: string, silent = false) => {
try {
const settings = await window.api.getSettings();
if (!(settings as any)?.enableClaudePluginIntegration) {
// 未开启联动:不执行写入/移除
return;
}
const provider = providers[providerId];
if (!provider) return;
const isOfficial = provider.category === "official";