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 && ( - - )} - {/* Tool use cards */} {visibleTools.length > 0 && (
@@ -442,36 +436,6 @@ function MessageBubble({ ); } -// ── Thinking Block ────────────────────────────────────────────── - -function ThinkingBlock({ content }: { content: string }) { - const [expanded, setExpanded] = useState(false); - - return ( -
- - {expanded && ( -
-
- - {normalizeLatexDelimiters(content)} - -
-
- )} -
- ); -} - // ── File Card (for user-uploaded non-image files) ─────────────── function formatFileSize(bytes: number): string { diff --git a/src/pages/Chat/index.tsx b/src/pages/Chat/index.tsx index 3daaf61..e15a54b 100644 --- a/src/pages/Chat/index.tsx +++ b/src/pages/Chat/index.tsx @@ -174,16 +174,14 @@ export function Chat() { : 0; const streamText = streamMsg ? extractText(streamMsg) : (typeof streamingMessage === 'string' ? streamingMessage : ''); const hasStreamText = streamText.trim().length > 0; - const streamThinking = streamMsg ? extractThinking(streamMsg) : null; - const hasStreamThinking = !!streamThinking && streamThinking.trim().length > 0; const streamTools = streamMsg ? extractToolUse(streamMsg) : []; const hasStreamTools = streamTools.length > 0; const streamImages = streamMsg ? extractImages(streamMsg) : []; const hasStreamImages = streamImages.length > 0; const hasStreamToolStatus = streamingTools.length > 0; const hasRunningStreamToolStatus = streamingTools.some((tool) => tool.status === 'running'); - const shouldRenderStreaming = sending && (hasStreamText || hasStreamThinking || hasStreamTools || hasStreamImages || hasStreamToolStatus); - const hasAnyStreamContent = hasStreamText || hasStreamThinking || hasStreamTools || hasStreamImages || hasStreamToolStatus; + const shouldRenderStreaming = sending && (hasStreamText || hasStreamTools || hasStreamImages || hasStreamToolStatus); + const hasAnyStreamContent = hasStreamText || hasStreamTools || hasStreamImages || hasStreamToolStatus; const isEmpty = messages.length === 0 && !sending; const subagentCompletionInfos = messages.map((message) => parseSubagentCompletionInfo(message));