Merge branch 'feat/backend' into feat/front-end

This commit is contained in:
Roe-xin
2026-02-25 10:15:50 +08:00
3 changed files with 18 additions and 2 deletions

View File

@ -543,6 +543,12 @@ export function getMessageAreaStyles(): string {
.tool-segment-content.collapsed {
max-height: 0;
}
.tool-segment-description {
margin: 2px 0 0 0px;
font-size: 12px;
color: #fff;
line-height: 1.4;
}
/* 低调显示的工具调用样式 */
.segment-tool.low-profile .tool-segment-header {
opacity: 0.65;
@ -1067,6 +1073,7 @@ export function getMessageAreaScript(): string {
const toolResult = segment.toolResult || '';
const toolCount = segment.toolCount || 1;
const countSuffix = toolCount > 1 ? \` x\${toolCount}\` : '';
const toolDescription = segment.toolDescription || '';
// 检查工具结果是否过长(超过一行显示不下)
const shouldCollapse = toolResult && toolResult.length > 60;
@ -1084,6 +1091,7 @@ export function getMessageAreaScript(): string {
\${toolResult && !shouldCollapse ? \`<span class="tool-segment-result">\${toolResult}</span>\` : ''}
</div>
\${shouldCollapse ? \`<div class="tool-segment-content\${isCollapsed ? ' collapsed' : ''}" style="max-height:\${isCollapsed ? '0' : 'none'}"><span class="tool-segment-result" style="display:block;white-space:pre-wrap;max-width:100%;margin-top:8px;margin-left:18px;">\${toolResult}</span></div>\` : ''}
\${toolDescription ? \`<p class="tool-segment-description">\${toolDescription}</p>\` : ''}
\`;
// 如果是仿真工具且成功完成,尝试添加波形预览
@ -1331,6 +1339,7 @@ export function getMessageAreaScript(): string {
const toolResult = segment.toolResult || '';
const toolCount = segment.toolCount || 1;
const countSuffix = toolCount > 1 ? \` x\${toolCount}\` : '';
const toolDescription = segment.toolDescription || '';
// 检查工具结果是否过长(超过一行显示不下)
const shouldCollapse = toolResult && toolResult.length > 60;
@ -1342,6 +1351,7 @@ export function getMessageAreaScript(): string {
\${toolResult && !shouldCollapse ? \`<span class="tool-segment-result">\${toolResult}</span>\` : ''}
</div>
\${shouldCollapse ? \`<div class="tool-segment-content collapsed"><span class="tool-segment-result" style="display:block;white-space:pre-wrap;max-width:100%;margin-top:8px;margin-left:18px;">\${toolResult}</span></div>\` : ''}
\${toolDescription ? \`<p class="tool-segment-description">\${toolDescription}</p>\` : ''}
\`;
// 如果是仿真工具且成功完成,尝试添加波形预览