@@ -12,17 +12,10 @@ interface ReasoningBlockProps {
1212 metadata ?: Record < string , any >
1313}
1414
15- function formatDuration ( ms : number ) : string {
16- const totalSeconds = Math . max ( 0 , Math . floor ( ms / 1000 ) )
17- const minutes = Math . floor ( totalSeconds / 60 )
18- const seconds = totalSeconds % 60
19- return `${ minutes } :${ seconds . toString ( ) . padStart ( 2 , "0" ) } `
20- }
21-
2215/**
2316 * Render reasoning with a heading and a persistent timer.
2417 * - Heading uses i18n key chat:reasoning.thinking
25- * - Timer persists via message.metadata.reasoning { startedAt, elapsedMs }
18+ * - Timer shown as "(⟲ 24s)" beside the heading and persists via message.metadata.reasoning { startedAt, elapsedMs }
2619 */
2720export const ReasoningBlock = ( { content, ts, isStreaming, isLast, metadata } : ReasoningBlockProps ) => {
2821 const { t } = useTranslation ( )
@@ -75,14 +68,19 @@ export const ReasoningBlock = ({ content, ts, isStreaming, isLast, metadata }: R
7568 return persisted . elapsedMs ?? elapsed
7669 } , [ elapsed , isLast , isStreaming , persisted . elapsedMs ] )
7770
71+ const seconds = Math . max ( 0 , Math . floor ( ( displayMs || 0 ) / 1000 ) )
72+ const secondsLabel = t ( "chat:reasoning.seconds" , { count : seconds } )
73+
7874 return (
7975 < div className = "px-3 py-1" >
80- < div className = "flex items-center justify-between mb-1" >
81- < div className = "flex items-center gap-2" >
82- < span className = "codicon codicon-light-bulb text-muted-foreground" />
83- < span className = "font-medium text-vscode-foreground" > { t ( "chat:reasoning.thinking" ) } </ span >
84- </ div >
85- < span className = "text-xs text-muted-foreground tabular-nums" > { formatDuration ( displayMs ) } </ span >
76+ < div className = "flex items-center gap-2 mb-1" >
77+ < span className = "codicon codicon-light-bulb text-muted-foreground" />
78+ < span className = "font-medium text-vscode-foreground" > { t ( "chat:reasoning.thinking" ) } </ span >
79+ < span className = "text-xs text-muted-foreground tabular-nums" >
80+ (
81+ < span className = "codicon codicon-history mr-1" />
82+ { secondsLabel } )
83+ </ span >
8684 </ div >
8785 < div className = "italic text-muted-foreground" >
8886 < MarkdownBlock markdown = { content } />
0 commit comments