From ba64b2224b9eec6f5f04ba828f7b42c4ab28cac1 Mon Sep 17 00:00:00 2001 From: xintaofei Date: Wed, 25 Mar 2026 00:46:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E8=AF=9D=E9=83=A8=E5=88=86=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E8=A1=A8=E8=BE=BE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/chat/chat-input.tsx | 4 +++- src/components/chat/conversation-shell.tsx | 3 +++ .../conversations/conversation-detail-panel.tsx | 15 +++++++++------ src/contexts/conversation-runtime-context.tsx | 4 +++- src/i18n/messages/ar.json | 2 +- src/i18n/messages/de.json | 2 +- src/i18n/messages/en.json | 2 +- src/i18n/messages/es.json | 2 +- src/i18n/messages/fr.json | 2 +- src/i18n/messages/ja.json | 2 +- src/i18n/messages/ko.json | 2 +- src/i18n/messages/pt.json | 2 +- src/i18n/messages/zh-CN.json | 4 ++-- src/i18n/messages/zh-TW.json | 4 ++-- 14 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/components/chat/chat-input.tsx b/src/components/chat/chat-input.tsx index e5454e3..f143fa4 100644 --- a/src/components/chat/chat-input.tsx +++ b/src/components/chat/chat-input.tsx @@ -17,6 +17,7 @@ interface ChatInputProps { status: ConnectionStatus | null promptCapabilities: PromptCapabilitiesInfo defaultPath?: string + agentName?: string onFocus?: () => void onSend: (draft: PromptDraft, modeId?: string | null) => void onCancel: () => void @@ -48,6 +49,7 @@ export function ChatInput({ status, promptCapabilities, defaultPath, + agentName, onFocus, onSend, onCancel, @@ -123,7 +125,7 @@ export function ChatInput({ isConnecting ? t("connecting") : isPrompting - ? t("agentResponding") + ? t("agentResponding", { agent: agentName ?? "Agent" }) : t("sendMessage") } className="min-h-28 max-h-60" diff --git a/src/components/chat/conversation-shell.tsx b/src/components/chat/conversation-shell.tsx index 9b0e917..d8383a8 100644 --- a/src/components/chat/conversation-shell.tsx +++ b/src/components/chat/conversation-shell.tsx @@ -20,6 +20,7 @@ interface ConversationShellProps { status: ConnectionStatus | null promptCapabilities: PromptCapabilitiesInfo defaultPath?: string + agentName?: string error: string | null pendingPermission: PendingPermission | null pendingQuestion: PendingQuestion | null @@ -58,6 +59,7 @@ export function ConversationShell({ status, promptCapabilities, defaultPath, + agentName, error, pendingPermission, pendingQuestion, @@ -107,6 +109,7 @@ export function ConversationShell({ status={status} promptCapabilities={promptCapabilities} defaultPath={defaultPath} + agentName={agentName} onFocus={onFocus} onSend={onSend} onCancel={onCancel} diff --git a/src/components/conversations/conversation-detail-panel.tsx b/src/components/conversations/conversation-detail-panel.tsx index 6aca41b..4c0056d 100644 --- a/src/components/conversations/conversation-detail-panel.tsx +++ b/src/components/conversations/conversation-detail-panel.tsx @@ -39,12 +39,13 @@ import { extractUserResourcesFromDraft, getPromptDraftDisplayText, } from "@/lib/prompt-draft" -import type { - AcpEvent, - AgentType, - ContentBlock, - MessageTurn, - PromptDraft, +import { + AGENT_LABELS, + type AcpEvent, + type AgentType, + type ContentBlock, + type MessageTurn, + type PromptDraft, } from "@/lib/types" import { buildConversationDraftStorageKey, @@ -836,6 +837,7 @@ const ConversationTabView = memo(function ConversationTabView({ status={connStatus} promptCapabilities={conn.promptCapabilities} defaultPath={workingDirForConnection} + agentName={AGENT_LABELS[selectedAgent]} error={conn.error} pendingPermission={conn.pendingPermission} pendingQuestion={conn.pendingQuestion} @@ -910,6 +912,7 @@ const ConversationTabView = memo(function ConversationTabView({ status={connStatus} promptCapabilities={conn.promptCapabilities} defaultPath={workingDirForConnection} + agentName={AGENT_LABELS[selectedAgent]} onFocus={handleFocus} onSend={handleSend} onCancel={handleCancel} diff --git a/src/contexts/conversation-runtime-context.tsx b/src/contexts/conversation-runtime-context.tsx index 33dfe66..504d7b2 100644 --- a/src/contexts/conversation-runtime-context.tsx +++ b/src/contexts/conversation-runtime-context.tsx @@ -174,7 +174,9 @@ function buildStreamingTurnsFromLiveMessage( for (const block of liveMessage.content) { const isContentBlock = - block.type === "text" || block.type === "thinking" || block.type === "plan" + block.type === "text" || + block.type === "thinking" || + block.type === "plan" if (isContentBlock && currentGroupHasCompletedTool) { groups.push([]) diff --git a/src/i18n/messages/ar.json b/src/i18n/messages/ar.json index 46684e8..271d160 100644 --- a/src/i18n/messages/ar.json +++ b/src/i18n/messages/ar.json @@ -1362,7 +1362,7 @@ }, "chatInput": { "connecting": "جارٍ الاتصال...", - "agentResponding": "الوكيل يرد...", + "agentResponding": "{agent} يرد...", "sendMessage": "أرسل رسالة..." }, "messageInput": { diff --git a/src/i18n/messages/de.json b/src/i18n/messages/de.json index dc5f956..c114375 100644 --- a/src/i18n/messages/de.json +++ b/src/i18n/messages/de.json @@ -1362,7 +1362,7 @@ }, "chatInput": { "connecting": "Verbinden...", - "agentResponding": "Agent antwortet...", + "agentResponding": "{agent} antwortet...", "sendMessage": "Nachricht senden..." }, "messageInput": { diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json index 7addaa5..942843e 100644 --- a/src/i18n/messages/en.json +++ b/src/i18n/messages/en.json @@ -1362,7 +1362,7 @@ }, "chatInput": { "connecting": "Connecting...", - "agentResponding": "Agent is responding...", + "agentResponding": "{agent} is responding...", "sendMessage": "Send a message..." }, "messageInput": { diff --git a/src/i18n/messages/es.json b/src/i18n/messages/es.json index bf20e5f..f786038 100644 --- a/src/i18n/messages/es.json +++ b/src/i18n/messages/es.json @@ -1362,7 +1362,7 @@ }, "chatInput": { "connecting": "Conectando...", - "agentResponding": "El agente está respondiendo...", + "agentResponding": "{agent} está respondiendo...", "sendMessage": "Enviar un mensaje..." }, "messageInput": { diff --git a/src/i18n/messages/fr.json b/src/i18n/messages/fr.json index a02261d..22e2ef1 100644 --- a/src/i18n/messages/fr.json +++ b/src/i18n/messages/fr.json @@ -1362,7 +1362,7 @@ }, "chatInput": { "connecting": "Connexion...", - "agentResponding": "L'agent répond...", + "agentResponding": "{agent} répond...", "sendMessage": "Envoyer un message..." }, "messageInput": { diff --git a/src/i18n/messages/ja.json b/src/i18n/messages/ja.json index 6379498..c6c797f 100644 --- a/src/i18n/messages/ja.json +++ b/src/i18n/messages/ja.json @@ -1362,7 +1362,7 @@ }, "chatInput": { "connecting": "接続中...", - "agentResponding": "エージェントが応答中...", + "agentResponding": "{agent} が応答中...", "sendMessage": "メッセージを送信..." }, "messageInput": { diff --git a/src/i18n/messages/ko.json b/src/i18n/messages/ko.json index 08a4ad5..27525b7 100644 --- a/src/i18n/messages/ko.json +++ b/src/i18n/messages/ko.json @@ -1362,7 +1362,7 @@ }, "chatInput": { "connecting": "연결 중...", - "agentResponding": "에이전트가 응답 중...", + "agentResponding": "{agent} 응답 중...", "sendMessage": "메시지 보내기..." }, "messageInput": { diff --git a/src/i18n/messages/pt.json b/src/i18n/messages/pt.json index a7a6a9f..36821af 100644 --- a/src/i18n/messages/pt.json +++ b/src/i18n/messages/pt.json @@ -1362,7 +1362,7 @@ }, "chatInput": { "connecting": "Conectando...", - "agentResponding": "O agente está respondendo...", + "agentResponding": "{agent} está respondendo...", "sendMessage": "Envie uma mensagem..." }, "messageInput": { diff --git a/src/i18n/messages/zh-CN.json b/src/i18n/messages/zh-CN.json index 3cb4f23..260421c 100644 --- a/src/i18n/messages/zh-CN.json +++ b/src/i18n/messages/zh-CN.json @@ -1362,7 +1362,7 @@ }, "chatInput": { "connecting": "连接中...", - "agentResponding": "Agent 正在响应...", + "agentResponding": "{agent} 正在响应...", "sendMessage": "发送消息..." }, "messageInput": { @@ -1395,7 +1395,7 @@ "openAgentsSettings": "打开 Agents 设置" }, "agentPlanOverlay": { - "title": "Agent 计划", + "title": "计划任务", "collapsePlanAria": "折叠计划", "collapsedSummary": "计划 {completed}/{total}", "status": { diff --git a/src/i18n/messages/zh-TW.json b/src/i18n/messages/zh-TW.json index af8514b..d16b372 100644 --- a/src/i18n/messages/zh-TW.json +++ b/src/i18n/messages/zh-TW.json @@ -1362,7 +1362,7 @@ }, "chatInput": { "connecting": "連線中...", - "agentResponding": "Agent 正在回應...", + "agentResponding": "{agent} 正在回應...", "sendMessage": "傳送訊息..." }, "messageInput": { @@ -1395,7 +1395,7 @@ "openAgentsSettings": "開啟 Agents 設定" }, "agentPlanOverlay": { - "title": "Agent 計畫", + "title": "計畫任務", "collapsePlanAria": "摺疊計畫", "collapsedSummary": "計畫 {completed}/{total}", "status": {