diff --git a/src/pages/chat/components/messages/MessageItem.tsx b/src/pages/chat/components/messages/MessageItem.tsx
index c7da77e..2771204 100644
--- a/src/pages/chat/components/messages/MessageItem.tsx
+++ b/src/pages/chat/components/messages/MessageItem.tsx
@@ -139,12 +139,15 @@ export default function MessageItem(props: {
)}
- {/* 展示 RAG 和 工具调用 */}
+ {/* 底部 Meta 信息展示 (RAG / Tool) */}
{!isMobile && message.meta && !isUser && (
-
- {!!message.meta.reasoning &&
}
- {!!message.meta.retrieved?.length &&
}
- {!!message.meta.toolCalls?.length &&
}
+
+ {message.meta.retrieved && message.meta.retrieved.length > 0 && (
+
+ )}
+ {message.meta.toolCalls && message.meta.toolCalls.length > 0 && (
+
+ )}
)}
diff --git a/src/pages/chat/components/messages/MetaViews.css b/src/pages/chat/components/messages/MetaViews.css
new file mode 100644
index 0000000..f70fc15
--- /dev/null
+++ b/src/pages/chat/components/messages/MetaViews.css
@@ -0,0 +1,124 @@
+.reasoning-container {
+ margin: 4px 0;
+ transition: all 0.3s ease;
+}
+
+.reasoning-header {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ cursor: pointer;
+ user-select: none;
+ padding: 4px 0;
+ border-radius: 4px;
+ transition: background-color 0.2s;
+}
+
+.reasoning-header:hover {
+ background-color: var(--color-surface-2);
+}
+
+.reasoning-label {
+ font-size: 12px;
+ color: var(--color-text-tertiary);
+ font-weight: 500;
+}
+
+.reasoning-toggle-icon {
+ font-size: 10px;
+ color: var(--color-text-tertiary);
+ transition: transform 0.2s;
+}
+
+.reasoning-container.is-expanded .reasoning-toggle-icon {
+ transform: rotate(90deg);
+}
+
+.reasoning-content {
+ font-size: 13px;
+ color: var(--color-text-secondary);
+ line-height: 1.6;
+ overflow: auto;
+ border-left: 2px solid var(--color-border-light);
+ padding-left: 12px;
+ margin-left: 4px;
+ margin-top: 8px;
+ animation: reasoningFadeIn 0.3s ease-out;
+}
+
+@keyframes reasoningFadeIn {
+ from {
+ opacity: 0;
+ transform: translateY(-4px);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+/* RAG View Styles */
+.retrieved-label {
+ font-size: 12px;
+ color: #6366f1;
+}
+
+.retrieved-list {
+ font-size: 12px;
+}
+
+.retrieved-item {
+ padding: 8px;
+ background: #f6f8ff;
+ border-radius: 6px;
+ margin-bottom: 6px;
+ border-left: 3px solid #6366f1;
+}
+
+.retrieved-item-header {
+ color: #6366f1;
+ font-weight: 600;
+ margin-bottom: 4px;
+}
+
+.retrieved-item-preview {
+ color: #374151;
+ white-space: pre-wrap;
+}
+
+/* Tool Call View Styles */
+.tool-call-label {
+ font-size: 12px;
+ color: #f97316;
+}
+
+.tool-call-list {
+ font-size: 12px;
+}
+
+.tool-call-item {
+ padding: 8px;
+ background: #fff7ed;
+ border-radius: 6px;
+ margin-bottom: 6px;
+ border-left: 3px solid #f97316;
+}
+
+.tool-call-item-header {
+ color: #c2410c;
+ font-weight: 600;
+ margin-bottom: 4px;
+}
+
+.tool-call-item-args {
+ color: #6b7280;
+}
+
+.tool-call-item-result {
+ color: #374151;
+ margin-top: 4px;
+}
+
+.tool-call-item-result code {
+ word-break: break-all;
+}
diff --git a/src/pages/chat/components/messages/MetaViews.tsx b/src/pages/chat/components/messages/MetaViews.tsx
index 9efdfb3..f094c61 100644
--- a/src/pages/chat/components/messages/MetaViews.tsx
+++ b/src/pages/chat/components/messages/MetaViews.tsx
@@ -2,6 +2,7 @@ import { Collapse, Tag } from 'antd';
import { RightOutlined } from '@ant-design/icons';
import type { RetrievedSnippet, ToolCallTrace } from '../../../../api';
import Markdown from '../../../../components/Markdown';
+import './MetaViews.css';
export function ReasoningView({
reasoning,
@@ -14,35 +15,12 @@ export function ReasoningView({
}) {
return (
-
-
- 已深度思考
-
-
+
+ 已深度思考
+
{expanded && (
-
+
{reasoning}
)}
@@ -58,24 +36,15 @@ export function RetrievedView({ retrieved }: { retrieved: RetrievedSnippet[] })
items={[
{
key: 'rag',
- label:
🔍 RAG 命中片段 ({retrieved.length}),
+ label:
RAG 命中片段 ({retrieved.length}),
children: (
-
+
{retrieved.map((r, i) => (
-
-
+
+
📄 {r.fileName} · 切片#{r.chunkIndex} · score {r.score.toFixed(3)}
-
+
{r.preview}
{r.preview.length >= 200 ? '…' : ''}
@@ -98,35 +67,26 @@ export function ToolCallView({ calls, liveStyle }: { calls: ToolCallTrace[]; liv
items={[
{
key: 'tc',
- label:
🛠 工具调用 ({calls.length}),
+ label:
🛠 工具调用 ({calls.length}),
children: (
-
+
{calls.map((t, i) => {
const isPending = (t.result as any)?.pending;
const isFailed = t.result?.ok === false;
return (
-
-
+
+
⚙️ {t.name} {isPending && 运行中…}
{!isPending && t.result?.durationMs != null && {t.result.durationMs}ms}
{isFailed && 失败}
-
+
args: {JSON.stringify(t.args)}
{!isPending && (
-
+
result:{' '}
-
+
{JSON.stringify(t.result?.result ?? t.result?.error ?? t.result).slice(0, 500)}