@@ -18,9 +18,12 @@ export const ReasoningMessage: React.FC<ReasoningMessageProps> = ({ message, cla
1818 const isStreaming = message . isStreaming ;
1919 const trimmedContent = content ?. trim ( ) ?? "" ;
2020 const hasContent = trimmedContent . length > 0 ;
21+ const summaryLine = hasContent ? ( trimmedContent . split ( / \r ? \n / ) [ 0 ] ?? "" ) : "" ;
22+ const hasAdditionalLines = hasContent && / [ \r \n ] / . test ( trimmedContent ) ;
2123 // OpenAI models often emit terse, single-line traces; surface them inline instead of hiding behind the label.
22- const isSingleLineTrace = ! isStreaming && hasContent && ! / [ \r \n ] / . test ( trimmedContent ) ;
23- const isCollapsible = ! isStreaming && hasContent && ! isSingleLineTrace ;
24+ const isSingleLineTrace = ! isStreaming && hasContent && ! hasAdditionalLines ;
25+ const isCollapsible = ! isStreaming && hasContent && hasAdditionalLines ;
26+ const showEllipsis = isCollapsible && ! isExpanded ;
2427
2528 // Auto-collapse when streaming ends
2629 useEffect ( ( ) => {
@@ -77,18 +80,26 @@ export const ReasoningMessage: React.FC<ReasoningMessageProps> = ({ message, cla
7780 < span className = "text-xs" >
7881 < Lightbulb className = { cn ( "size-3.5" , isStreaming && "animate-pulse" ) } />
7982 </ span >
80- < div className = "truncate" >
83+ < div className = "flex min-w-0 items-center gap-1 truncate" >
8184 { isStreaming ? (
8285 < Shimmer colorClass = "var(--color-thinking-mode)" > Thinking...</ Shimmer >
83- ) : isSingleLineTrace ? (
86+ ) : hasContent ? (
8487 < MarkdownRenderer
85- content = { trimmedContent }
88+ content = { summaryLine }
8689 className = "truncate [&_*]:inline [&_*]:align-baseline [&_*]:whitespace-nowrap"
8790 style = { { fontSize : 12 , lineHeight : "18px" } }
8891 />
8992 ) : (
9093 "Thought"
9194 ) }
95+ { showEllipsis && (
96+ < span
97+ className = "text-[11px] tracking-widest text-[color:var(--color-text)] opacity-70"
98+ data-testid = "reasoning-ellipsis"
99+ >
100+ ...
101+ </ span >
102+ ) }
92103 </ div >
93104 </ div >
94105 { isCollapsible && (
0 commit comments