@@ -143,11 +143,11 @@ export function Thinking({
)
}
-/** 思考文本 → 行数组(空行剔除,超长行截断) */
+/** 思考文本 → 行数组(空行剔除,内容不截断;过长由容器的滚动条承担) */
export function thinkingRows(text: string): { primary: string }[] {
return text
.split('\n')
.map((l) => l.trim())
.filter(Boolean)
- .map((line) => ({ primary: line.length > 300 ? `${line.slice(0, 300)}…` : line }))
+ .map((line) => ({ primary: line }))
}
diff --git a/apps/desktop/src/renderer/src/components/ToolChips.tsx b/apps/desktop/src/renderer/src/components/ToolChips.tsx
index e7a1b3d..2972d3a 100644
--- a/apps/desktop/src/renderer/src/components/ToolChips.tsx
+++ b/apps/desktop/src/renderer/src/components/ToolChips.tsx
@@ -198,9 +198,13 @@ function buildRow(view: ToolCallView, dupIndex: number): ToolRow {
)
const resultText = extractResultText(tool.result)
if (resultText) {
- const lines = resultText.split('\n').slice(0, 10)
- for (const line of lines) detail.push({ text: line.slice(0, 160), tone: 'plain' })
- if (resultText.split('\n').length > 10) detail.push({ text: '…(结果已截断)', tone: 'plain' })
+ // 完整输出,不逐行截断;过长由展开区的滚动条承担,仅在行数超限时兜底
+ const lines = resultText.split('\n')
+ const maxLines = 400
+ for (const line of lines.slice(0, maxLines)) detail.push({ text: line, tone: 'plain' })
+ if (lines.length > maxLines) {
+ detail.push({ text: `…(共 ${lines.length} 行,已截断)`, tone: 'plain' })
+ }
}
}
const args = tool?.args ?? view.pendingApproval?.args
@@ -237,7 +241,7 @@ function buildThinkingRows(texts: string[]): ToolRow[] {
file: '',
dir: '',
chip: lines[0].length > 60 ? `${lines[0].slice(0, 60)}…` : lines[0],
- detail: lines.slice(0, 12).map((line) => ({ text: line.slice(0, 160), tone: 'plain' as const })),
+ detail: lines.map((line) => ({ text: line, tone: 'plain' as const })),
tool: undefined,
pending: false
})
@@ -336,22 +340,24 @@ export function ToolChips({ calls = [], thinking = [], className = '' }: {
{row.icon !== 'think' &&
}
- {/* 展开明细 */}
+ {/* 展开明细:完整内容不截断,过长时在滚动区里查看;收起时懒渲染不占 DOM */}
-
- {row.detail.map((line, lineIndex) => (
-
- {line.text}
-
- ))}
-
+ {rowOpen && (
+
+ {row.detail.map((line, lineIndex) => (
+
+ {line.text}
+
+ ))}
+
+ )}