From a55ec3e330d1c4d247dba5fe49f62e90e230ae1d Mon Sep 17 00:00:00 2001 From: sim Date: Mon, 3 Aug 2026 10:37:00 +0800 Subject: [PATCH] =?UTF-8?q?refactor(coding-agent):=20Less=20Computer=20?= =?UTF-8?q?=E5=90=8E=E7=AB=AF/=E6=9D=83=E9=99=90=E6=A8=A1=E5=BC=8F/?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E9=80=89=E6=8B=A9=E6=94=B9=E7=94=A8=E5=AE=98?= =?UTF-8?q?=E6=96=B9=20SelectLite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 统一三平台下拉观感,替换原生 - void savePrefs({ - ...prefs, - codingAgentProvider: e.target.value as CodingAgentProviderId, - }) - } - style={{ ...inputStyle, maxWidth: 240, cursor: 'pointer' }} - > - - - + onChange={v => void savePrefs({ ...prefs, codingAgentProvider: v as CodingAgentProviderId })} + options={[ + { value: 'claude-code-cli', label: 'Claude Code' }, + { value: 'opencode-cli', label: 'OpenCode' }, + ]} + ariaLabel={t('settings.codingAgent.provider')} + style={{ ...inputStyle, maxWidth: 240 }} + /> {/* OpenCode 后端:提示安装/登录状态。issue #579。 */} @@ -101,38 +99,32 @@ export function CodingAgentSection() { )} - + onChange={v => void savePrefs({ ...prefs, codingAgentPermissionMode: v as CodingAgentPermissionMode })} + options={PERMISSION_MODES.map(m => ({ + value: m, + label: t(`settings.codingConsole.mode.${m}`), + }))} + ariaLabel={t('settings.codingConsole.permissionMode')} + style={{ ...inputStyle, maxWidth: 240 }} + /> - + onChange={v => void savePrefs({ ...prefs, codingAgentModel: v === '' ? null : v })} + options={[ + // 空值 = 使用 CLI 默认模型;放回选项里,避免选了具体模型后回不去默认。 + { value: '', label: t('settings.codingAgent.modelDefault') }, + { value: 'haiku', label: 'Haiku' }, + { value: 'sonnet', label: 'Sonnet' }, + { value: 'opus', label: 'Opus' }, + ]} + ariaLabel={t('settings.codingAgent.model')} + style={{ ...inputStyle, maxWidth: 240 }} + />