Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cli/src/components/thinking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const Thinking = memo(
}

const width = Math.max(10, availableWidth ?? contentMaxWidth)
// Normalize content to single line for consistent preview
// Normalize content to single line for consistent preview (but preserve in expanded mode)
const normalizedContent = content.replace(/\n+/g, ' ').trim()
// Account for "..." prefix (3 chars) when calculating line widths
const effectiveWidth = width - 3
Expand All @@ -48,6 +48,8 @@ export const Thinking = memo(
effectiveWidth,
PREVIEW_LINE_COUNT,
)
// In expanded mode, preserve original line breaks for proper markdown rendering
const expandedContent = content.replace(/\n\n+/g, '\n\n').trim()

const showFull = thinkingCollapseState === 'expanded'
const showPreview = thinkingCollapseState === 'preview' && lines.length > 0
Expand Down Expand Up @@ -94,7 +96,7 @@ export const Thinking = memo(
}}
attributes={TextAttributes.ITALIC}
>
{content}
{expandedContent}
</text>
</box>
)}
Expand Down