diff --git a/src/pages/Chat/ChatMessage.tsx b/src/pages/Chat/ChatMessage.tsx index a7d8e35..c7975a1 100644 --- a/src/pages/Chat/ChatMessage.tsx +++ b/src/pages/Chat/ChatMessage.tsx @@ -1,7 +1,8 @@ /** * Chat Message Component * Renders user / assistant / system / toolresult messages - * with markdown, thinking sections, images, and tool cards. + * with markdown, images, and tool cards. Thinking output is + * surfaced via ExecutionGraphCard, not inside message bubbles. */ import { useState, useCallback, useEffect, memo } from 'react'; import { Sparkles, Copy, Check, ChevronDown, ChevronRight, Wrench, FileText, Film, Music, FileArchive, File, X, FolderOpen, ZoomIn, Loader2, CheckCircle2, AlertCircle } from 'lucide-react'; @@ -14,7 +15,7 @@ import { Button } from '@/components/ui/button'; import { cn } from '@/lib/utils'; import { invokeIpc } from '@/lib/api-client'; import type { RawMessage, AttachedFileMeta } from '@/stores/chat'; -import { extractText, extractThinking, extractImages, extractToolUse, formatTimestamp } from './message-utils'; +import { extractText, extractImages, extractToolUse, formatTimestamp } from './message-utils'; interface ChatMessageProps { message: RawMessage; @@ -98,13 +99,11 @@ export const ChatMessage = memo(function ChatMessage({ // original content without surfacing the bubble. const hideAssistantText = suppressAssistantText && !isUser; const hasText = !hideAssistantText && text.trim().length > 0; - const visibleThinkingRaw = extractThinking(message); - const visibleThinking = hideAssistantText ? null : visibleThinkingRaw; const images = extractImages(message); const tools = extractToolUse(message); const visibleTools = suppressToolCards ? [] : tools; const shouldHideProcessAttachments = suppressProcessAttachments - && (hasText || !!visibleThinking || images.length > 0 || visibleTools.length > 0); + && (hasText || images.length > 0 || visibleTools.length > 0); const attachedFiles = shouldHideProcessAttachments ? (message._attachedFiles || []).filter((file) => file.source !== 'tool-result') @@ -115,7 +114,7 @@ export const ChatMessage = memo(function ChatMessage({ if (isToolResult) return null; const hasStreamingToolStatus = isStreaming && streamingTools.length > 0; - if (!hasText && !visibleThinking && images.length === 0 && visibleTools.length === 0 && attachedFiles.length === 0 && !hasStreamingToolStatus) return null; + if (!hasText && images.length === 0 && visibleTools.length === 0 && attachedFiles.length === 0 && !hasStreamingToolStatus) return null; return (
)} - {/* Thinking section */} - {visibleThinking && ( -