diff --git a/src/renderer/components/chat-area.ts b/src/renderer/components/chat-area.ts index bc53990..8048e76 100644 --- a/src/renderer/components/chat-area.ts +++ b/src/renderer/components/chat-area.ts @@ -183,11 +183,13 @@ export function appendMessageDOM(msg: ChatMessage, index: number): void { contentHtml += ''; } - if ((msg as any)._videoFrames && (msg as any)._videoFrames.length > 0) { + if ((msg as any)._videos && (msg as any)._videos.length > 0) { + for (const v of (msg as any)._videos) { + contentHtml += `
🎬 ${v.fileName} · ${v.frameCount} 帧 · 1fps
`; + } + } else if ((msg as any)._videoFrames && (msg as any)._videoFrames.length > 0) { const n = (msg as any)._videoFrames.length; - const name = (msg as any)._videoMeta?.fileName || ''; - const label = name ? `${name} · ` : ''; - contentHtml += `
🎬 ${label}${n} 帧 · 1fps
`; + contentHtml += `
🎬 ${n} 帧 · 1fps
`; } if (msg.files && msg.files.length > 0) { diff --git a/src/renderer/components/input-area.ts b/src/renderer/components/input-area.ts index 4700030..2691014 100644 --- a/src/renderer/components/input-area.ts +++ b/src/renderer/components/input-area.ts @@ -1032,11 +1032,7 @@ async function sendMessageWithAgentLoop(text: string, currentSession: ChatSessio if (allVids.length > 0) { const totalFrames = allVids.flatMap(v => v.frames); msg._videoFrames = totalFrames; - msg._videoMeta = { - fileName: allVids.length === 1 ? allVids[0].name : `${allVids.length}个视频`, - duration: allVids[0].dur, - frameCount: totalFrames.length - }; + msg._videos = allVids.map(v => ({ fileName: v.name, frameCount: v.count, duration: v.dur })); } if (userFiles.length > 0) { msg.files = userFiles; diff --git a/src/renderer/types.d.ts b/src/renderer/types.d.ts index 4b7aa76..516b7c0 100644 --- a/src/renderer/types.d.ts +++ b/src/renderer/types.d.ts @@ -114,6 +114,8 @@ export interface ChatMessage { /** 视频帧数据(用于消息卡片渲染,不走 images 缩略图) */ _videoFrames?: Array<{ name: string; base64: string; timestampSeconds: number }>; _videoMeta?: { fileName: string; duration: number; frameCount: number }; + /** 多视频独立指示牌 */ + _videos?: Array<{ fileName: string; frameCount: number; duration: number }>; stopped?: boolean; toolCalls?: ToolCallRecord[]; /** 标记此消息为 LLM 压缩摘要生成 */