From 8f687f77a6c5a650dfa7d2367d91421362742180 Mon Sep 17 00:00:00 2001 From: thzxx Date: Sat, 27 Jun 2026 22:05:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=B3=E4=BE=A7=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=92=8C=E9=97=B4=E8=B7=9D=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - TraceViewer: 移除底部重复的 Token/Provider 摘要(与TokenUsage重复) - TraceViewer: height:100% → flexShrink+maxHeight 避免撑破布局 - TokenUsage: StatCard/SummaryRow 增加内边距和间距 --- src/components/layout/StatusBar.tsx | 5 +++-- src/components/trace/TokenUsage.tsx | 6 +++--- src/components/trace/TraceViewer.tsx | 19 ++----------------- 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/components/layout/StatusBar.tsx b/src/components/layout/StatusBar.tsx index c95d4a5..8b22ae0 100644 --- a/src/components/layout/StatusBar.tsx +++ b/src/components/layout/StatusBar.tsx @@ -27,11 +27,12 @@ export function StatusBar(): React.JSX.Element { - + {AGENT_STATUS_LABELS[agentStatus]} diff --git a/src/components/trace/TokenUsage.tsx b/src/components/trace/TokenUsage.tsx index 6a552f8..6fef015 100644 --- a/src/components/trace/TokenUsage.tsx +++ b/src/components/trace/TokenUsage.tsx @@ -64,17 +64,17 @@ export function TokenUsage(): React.JSX.Element { function StatCard({ label, value, color }: { label: string; value: string; color: string }) { return ( - + {label} - {value} + {value} ); } function SummaryRow({ label, value, highlight, color }: { label: string; value: string; highlight?: boolean; color?: string }) { return ( - + {label} {value} diff --git a/src/components/trace/TraceViewer.tsx b/src/components/trace/TraceViewer.tsx index a84508a..43d1dae 100644 --- a/src/components/trace/TraceViewer.tsx +++ b/src/components/trace/TraceViewer.tsx @@ -6,16 +6,13 @@ import { Box, Typography, Stack } from '@mui/material'; import { Activity } from 'lucide-react'; import { useAgentStore } from '@renderer/stores/agent-store'; import { TraceStep } from './TraceStep'; -import { formatTokens } from '@renderer/lib/formatters'; export function TraceViewer(): React.JSX.Element { const traceSteps = useAgentStore((s) => s.traceSteps); - const tokenUsage = useAgentStore((s) => s.tokenUsage); const agentStatus = useAgentStore((s) => s.agentStatus); - const provider = useAgentStore((s) => s.provider); return ( - + @@ -23,25 +20,13 @@ export function TraceViewer(): React.JSX.Element { - + {traceSteps.length === 0 ? ( 等待 Agent 活动... ) : traceSteps.map((step, i) => ( ))} - - {tokenUsage.totalTokens > 0 && ( - - - Token: - 入 {formatTokens(tokenUsage.inputTokens)} | 出 {formatTokens(tokenUsage.outputTokens)} | 总 {formatTokens(tokenUsage.totalTokens)} - - - Provider:{provider} - - - )} ); }