会话部分文本表达优化

This commit is contained in:
xintaofei
2026-03-25 00:46:13 +08:00
parent f6a9da79df
commit ba64b2224b
14 changed files with 30 additions and 20 deletions

View File

@@ -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"

View File

@@ -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}

View File

@@ -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}

View File

@@ -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([])

View File

@@ -1362,7 +1362,7 @@
},
"chatInput": {
"connecting": "جارٍ الاتصال...",
"agentResponding": "الوكيل يرد...",
"agentResponding": "{agent} يرد...",
"sendMessage": "أرسل رسالة..."
},
"messageInput": {

View File

@@ -1362,7 +1362,7 @@
},
"chatInput": {
"connecting": "Verbinden...",
"agentResponding": "Agent antwortet...",
"agentResponding": "{agent} antwortet...",
"sendMessage": "Nachricht senden..."
},
"messageInput": {

View File

@@ -1362,7 +1362,7 @@
},
"chatInput": {
"connecting": "Connecting...",
"agentResponding": "Agent is responding...",
"agentResponding": "{agent} is responding...",
"sendMessage": "Send a message..."
},
"messageInput": {

View File

@@ -1362,7 +1362,7 @@
},
"chatInput": {
"connecting": "Conectando...",
"agentResponding": "El agente está respondiendo...",
"agentResponding": "{agent} está respondiendo...",
"sendMessage": "Enviar un mensaje..."
},
"messageInput": {

View File

@@ -1362,7 +1362,7 @@
},
"chatInput": {
"connecting": "Connexion...",
"agentResponding": "L'agent répond...",
"agentResponding": "{agent} répond...",
"sendMessage": "Envoyer un message..."
},
"messageInput": {

View File

@@ -1362,7 +1362,7 @@
},
"chatInput": {
"connecting": "接続中...",
"agentResponding": "エージェントが応答中...",
"agentResponding": "{agent} が応答中...",
"sendMessage": "メッセージを送信..."
},
"messageInput": {

View File

@@ -1362,7 +1362,7 @@
},
"chatInput": {
"connecting": "연결 중...",
"agentResponding": "에이전트가 응답 중...",
"agentResponding": "{agent} 응답 중...",
"sendMessage": "메시지 보내기..."
},
"messageInput": {

View File

@@ -1362,7 +1362,7 @@
},
"chatInput": {
"connecting": "Conectando...",
"agentResponding": "O agente está respondendo...",
"agentResponding": "{agent} está respondendo...",
"sendMessage": "Envie uma mensagem..."
},
"messageInput": {

View File

@@ -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": {

View File

@@ -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": {