From 15e62fb5ec86d100042a97e70928b14973b67191 Mon Sep 17 00:00:00 2001 From: ChenM0M <2895521977@qq.com> Date: Tue, 22 Sep 2026 19:50:19 +0800 Subject: [PATCH] fix(agent-profiles): report clipboard failures accurately --- src/components/agent-profiles/AgentProfilesPanel.tsx | 4 ++-- src/locales/en.json | 3 ++- src/locales/zh-TW.json | 3 ++- src/locales/zh.json | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/agent-profiles/AgentProfilesPanel.tsx b/src/components/agent-profiles/AgentProfilesPanel.tsx index d1b1352..4318ec1 100644 --- a/src/components/agent-profiles/AgentProfilesPanel.tsx +++ b/src/components/agent-profiles/AgentProfilesPanel.tsx @@ -678,7 +678,7 @@ export function AgentProfilesPanel() { await navigator.clipboard.writeText(command); setNotice({ kind: 'info', text: t('agentProfiles.notices.commandCopied', { command }) }); } catch { - setNotice({ kind: 'info', text: t('agentProfiles.notices.commandCopied', { command }) }); + setNotice({ kind: 'error', text: t('agentProfiles.errors.commandCopyFailed', { command }) }); } }; @@ -1170,7 +1170,7 @@ export function AgentProfilesPanel() { - {notice &&
{notice.kind === 'error' ? : }{notice.text}
} + {notice &&
{notice.kind === 'error' ? : }{notice.text}
} {!targetId || (!loadingProfiles && discovery && discovery.profiles.length === 0) ? (
diff --git a/src/locales/en.json b/src/locales/en.json index 969d159..9d875cc 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1795,7 +1795,8 @@ "detectUnavailable": "Could not list models from the upstream.", "detectInvalidResponse": "The upstream did not return a parseable model list.", "advancedIdentityImmutable": "Profile ID and runtime target cannot be changed in the advanced editor.", - "advancedProvidersMissing": "The advanced configuration is missing managed.providers." + "advancedProvidersMissing": "The advanced configuration is missing managed.providers.", + "commandCopyFailed": "Could not copy to the clipboard. Select and copy the command manually:\n{{command}}" }, "claudeCompatibility": { "sectionLabel": "Claude Code compatibility", diff --git a/src/locales/zh-TW.json b/src/locales/zh-TW.json index b3f0e44..f51992b 100644 --- a/src/locales/zh-TW.json +++ b/src/locales/zh-TW.json @@ -1792,7 +1792,8 @@ "detectUnavailable": "無法從上游列出模型。", "detectInvalidResponse": "上游沒有回傳可解析的模型列表。", "advancedIdentityImmutable": "Profile ID 或執行環境不能在進階編輯器中修改。", - "advancedProvidersMissing": "進階設定缺少 managed.providers。" + "advancedProvidersMissing": "進階設定缺少 managed.providers。", + "commandCopyFailed": "無法複製到剪貼簿,請選取以下命令手動複製:\n{{command}}" }, "claudeCompatibility": { "sectionLabel": "Claude Code 相容設定", diff --git a/src/locales/zh.json b/src/locales/zh.json index ab19dc5..2a8e591 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -1792,7 +1792,8 @@ "detectUnavailable": "无法从上游列出模型。", "detectInvalidResponse": "上游没有返回可解析的模型列表。", "advancedIdentityImmutable": "Profile ID 或运行环境不能在高级编辑器中修改。", - "advancedProvidersMissing": "高级配置缺少 managed.providers。" + "advancedProvidersMissing": "高级配置缺少 managed.providers。", + "commandCopyFailed": "无法复制到剪贴板,请选中以下命令手动复制:\n{{command}}" }, "claudeCompatibility": { "sectionLabel": "Claude Code 兼容配置",