From 89effa71a8a708d33d052dada68f6116ae49170c Mon Sep 17 00:00:00 2001 From: JOJO <1498581755@qq.com> Date: Fri, 31 Jul 2026 22:39:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E4=BF=AE=E5=A4=8D=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E5=8F=82=E6=95=B0=E6=8D=A2=E8=A1=8C=E3=80=81=E8=AE=B0?= =?UTF-8?q?=E5=BF=86=E7=89=87=E6=AE=B5=E6=BA=A2=E5=87=BA=E4=B8=8E=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E4=BE=A7=E8=BE=B9=E6=A0=8F=E6=8B=96=E6=8B=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 工具参数区补 white-space: pre-wrap,多行参数(如 run_command 指令)真实换行而非挤作一团被动折行 - 记忆搜索匹配片段改逐行渲染 + nowrap/ellipsis 截断(pre 不换行会溢出容器),悬停 title 看全文 - 恢复 resize-handle--right-panels 基础样式(b593d638 删 _left-panel.scss 时误删,手柄零宽导致 git/终端面板无法拖宽),热区扩至 10px - FilePreviewPanel 新增左缘拖拽调宽(320-860px,localStorage 持久化),此前从未有过该能力 --- .../components/chat/actions/ToolAction.vue | 14 +++++ .../components/chat/actions/toolRenderers.ts | 11 ++-- .../chat/quickdock/FilePreviewPanel.vue | 53 ++++++++++++++++++- .../components/chat/quickdock/quickdock.css | 31 ++++++++++- .../components/panels/_right-panel.scss | 26 +++++++++ 5 files changed, 129 insertions(+), 6 deletions(-) diff --git a/static/src/components/chat/actions/ToolAction.vue b/static/src/components/chat/actions/ToolAction.vue index 55556a5b..e6174549 100644 --- a/static/src/components/chat/actions/ToolAction.vue +++ b/static/src/components/chat/actions/ToolAction.vue @@ -89,6 +89,10 @@ function renderToolResult(): string { .tool-result-meta > div { margin: 4px 0; + /* 参数值中的换行符(如多行 command/content)需要真实渲染, + 否则多行内容会挤成一行仅靠容器宽度被动折行 */ + white-space: pre-wrap; + word-break: break-word; } .tool-result-content { @@ -436,6 +440,16 @@ function renderToolResult(): string { line-height: 1.5; } +/* 记忆搜索匹配片段:单行展示,过长不折行直接省略号截断(hover title 看全文) */ +.search-match-snippet { + font-family: 'Monaco', 'Menlo', 'Consolas', monospace; + font-size: 12px; + line-height: 1.5; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + /* 提取片段 */ .segment-separator { text-align: center; diff --git a/static/src/components/chat/actions/toolRenderers.ts b/static/src/components/chat/actions/toolRenderers.ts index 5dbb4ce0..8786af6a 100644 --- a/static/src/components/chat/actions/toolRenderers.ts +++ b/static/src/components/chat/actions/toolRenderers.ts @@ -1029,11 +1029,14 @@ function renderSearchProjectMemory(result: any, args: any): string { } const snippets = Array.isArray(item.snippets) ? item.snippets : []; if (snippets.length > 0) { - const snippetText = snippets - .map((snippet: any) => `L${snippet.line ?? '?'}: ${snippet.text || ''}`) - .join('\n'); + // 每条匹配片段独立成行渲染(pre 整体渲染时长行不换行会溢出容器), + // 配合 .search-match-snippet 的 nowrap + ellipsis:过长片段直接省略号截断 html += '
'; - html += `
${escapeHtml(snippetText)}
`; + snippets.forEach((snippet: any) => { + const lineText = `L${snippet.line ?? '?'}: ${snippet.text || ''}`; + const escaped = escapeHtml(lineText); + html += `
${escaped}
`; + }); html += '
'; } html += ''; diff --git a/static/src/components/chat/quickdock/FilePreviewPanel.vue b/static/src/components/chat/quickdock/FilePreviewPanel.vue index 515464a1..59adeaa6 100644 --- a/static/src/components/chat/quickdock/FilePreviewPanel.vue +++ b/static/src/components/chat/quickdock/FilePreviewPanel.vue @@ -1,6 +1,12 @@