会话部分文本表达优化

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 status: ConnectionStatus | null
promptCapabilities: PromptCapabilitiesInfo promptCapabilities: PromptCapabilitiesInfo
defaultPath?: string defaultPath?: string
agentName?: string
onFocus?: () => void onFocus?: () => void
onSend: (draft: PromptDraft, modeId?: string | null) => void onSend: (draft: PromptDraft, modeId?: string | null) => void
onCancel: () => void onCancel: () => void
@@ -48,6 +49,7 @@ export function ChatInput({
status, status,
promptCapabilities, promptCapabilities,
defaultPath, defaultPath,
agentName,
onFocus, onFocus,
onSend, onSend,
onCancel, onCancel,
@@ -123,7 +125,7 @@ export function ChatInput({
isConnecting isConnecting
? t("connecting") ? t("connecting")
: isPrompting : isPrompting
? t("agentResponding") ? t("agentResponding", { agent: agentName ?? "Agent" })
: t("sendMessage") : t("sendMessage")
} }
className="min-h-28 max-h-60" className="min-h-28 max-h-60"

View File

@@ -20,6 +20,7 @@ interface ConversationShellProps {
status: ConnectionStatus | null status: ConnectionStatus | null
promptCapabilities: PromptCapabilitiesInfo promptCapabilities: PromptCapabilitiesInfo
defaultPath?: string defaultPath?: string
agentName?: string
error: string | null error: string | null
pendingPermission: PendingPermission | null pendingPermission: PendingPermission | null
pendingQuestion: PendingQuestion | null pendingQuestion: PendingQuestion | null
@@ -58,6 +59,7 @@ export function ConversationShell({
status, status,
promptCapabilities, promptCapabilities,
defaultPath, defaultPath,
agentName,
error, error,
pendingPermission, pendingPermission,
pendingQuestion, pendingQuestion,
@@ -107,6 +109,7 @@ export function ConversationShell({
status={status} status={status}
promptCapabilities={promptCapabilities} promptCapabilities={promptCapabilities}
defaultPath={defaultPath} defaultPath={defaultPath}
agentName={agentName}
onFocus={onFocus} onFocus={onFocus}
onSend={onSend} onSend={onSend}
onCancel={onCancel} onCancel={onCancel}

View File

@@ -39,12 +39,13 @@ import {
extractUserResourcesFromDraft, extractUserResourcesFromDraft,
getPromptDraftDisplayText, getPromptDraftDisplayText,
} from "@/lib/prompt-draft" } from "@/lib/prompt-draft"
import type { import {
AcpEvent, AGENT_LABELS,
AgentType, type AcpEvent,
ContentBlock, type AgentType,
MessageTurn, type ContentBlock,
PromptDraft, type MessageTurn,
type PromptDraft,
} from "@/lib/types" } from "@/lib/types"
import { import {
buildConversationDraftStorageKey, buildConversationDraftStorageKey,
@@ -836,6 +837,7 @@ const ConversationTabView = memo(function ConversationTabView({
status={connStatus} status={connStatus}
promptCapabilities={conn.promptCapabilities} promptCapabilities={conn.promptCapabilities}
defaultPath={workingDirForConnection} defaultPath={workingDirForConnection}
agentName={AGENT_LABELS[selectedAgent]}
error={conn.error} error={conn.error}
pendingPermission={conn.pendingPermission} pendingPermission={conn.pendingPermission}
pendingQuestion={conn.pendingQuestion} pendingQuestion={conn.pendingQuestion}
@@ -910,6 +912,7 @@ const ConversationTabView = memo(function ConversationTabView({
status={connStatus} status={connStatus}
promptCapabilities={conn.promptCapabilities} promptCapabilities={conn.promptCapabilities}
defaultPath={workingDirForConnection} defaultPath={workingDirForConnection}
agentName={AGENT_LABELS[selectedAgent]}
onFocus={handleFocus} onFocus={handleFocus}
onSend={handleSend} onSend={handleSend}
onCancel={handleCancel} onCancel={handleCancel}

View File

@@ -174,7 +174,9 @@ function buildStreamingTurnsFromLiveMessage(
for (const block of liveMessage.content) { for (const block of liveMessage.content) {
const isContentBlock = const isContentBlock =
block.type === "text" || block.type === "thinking" || block.type === "plan" block.type === "text" ||
block.type === "thinking" ||
block.type === "plan"
if (isContentBlock && currentGroupHasCompletedTool) { if (isContentBlock && currentGroupHasCompletedTool) {
groups.push([]) groups.push([])

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1362,7 +1362,7 @@
}, },
"chatInput": { "chatInput": {
"connecting": "连接中...", "connecting": "连接中...",
"agentResponding": "Agent 正在响应...", "agentResponding": "{agent} 正在响应...",
"sendMessage": "发送消息..." "sendMessage": "发送消息..."
}, },
"messageInput": { "messageInput": {
@@ -1395,7 +1395,7 @@
"openAgentsSettings": "打开 Agents 设置" "openAgentsSettings": "打开 Agents 设置"
}, },
"agentPlanOverlay": { "agentPlanOverlay": {
"title": "Agent 计划", "title": "计划任务",
"collapsePlanAria": "折叠计划", "collapsePlanAria": "折叠计划",
"collapsedSummary": "计划 {completed}/{total}", "collapsedSummary": "计划 {completed}/{total}",
"status": { "status": {

View File

@@ -1362,7 +1362,7 @@
}, },
"chatInput": { "chatInput": {
"connecting": "連線中...", "connecting": "連線中...",
"agentResponding": "Agent 正在回應...", "agentResponding": "{agent} 正在回應...",
"sendMessage": "傳送訊息..." "sendMessage": "傳送訊息..."
}, },
"messageInput": { "messageInput": {
@@ -1395,7 +1395,7 @@
"openAgentsSettings": "開啟 Agents 設定" "openAgentsSettings": "開啟 Agents 設定"
}, },
"agentPlanOverlay": { "agentPlanOverlay": {
"title": "Agent 計畫", "title": "計畫任務",
"collapsePlanAria": "摺疊計畫", "collapsePlanAria": "摺疊計畫",
"collapsedSummary": "計畫 {completed}/{total}", "collapsedSummary": "計畫 {completed}/{total}",
"status": { "status": {