@@ -5,17 +5,8 @@ import { ChatHistoryItem } from "core";
55import { useEffect , useState } from "react" ;
66import styled from "styled-components" ;
77
8- import { vscBackground } from "../.." ;
98import { AnimatedEllipsis } from "../../AnimatedEllipsis" ;
109import StyledMarkdownPreview from "../../StyledMarkdownPreview" ;
11- import { ButtonContent , SpoilerButton } from "../../ui/SpoilerButton" ;
12-
13- const ThinkingTextContainer = styled . span `
14- display: inline-block;
15- min-width: fit-content;
16-
17- padding-right: 1em; /* Reserve space for the ellipsis animation */
18- ` ;
1910
2011const MarkdownWrapper = styled . div `
2112 & > div > *:first-child {
@@ -39,7 +30,6 @@ function ThinkingBlockPeek({
3930 index,
4031 prevItem,
4132 inProgress,
42- signature,
4333 tokens,
4434} : ThinkingBlockPeekProps ) {
4535 const [ open , setOpen ] = useState ( false ) ;
@@ -66,58 +56,53 @@ function ThinkingBlockPeek({
6656
6757 return duplicateRedactedThinkingBlock ? null : (
6858 < div className = "thread-message" >
69- < div className = "" style = { { backgroundColor : vscBackground } } >
70- < div
71- className = "flex items-center justify-start pl-2 text-xs text-gray-300"
72- data-testid = "thinking-block-peek"
73- >
74- < SpoilerButton onClick = { ( ) => setOpen ( ! open ) } >
75- < ButtonContent >
76- { inProgress ? (
77- < span >
78- { redactedThinking ? "Redacted Thinking" : "Thinking" }
79- < AnimatedEllipsis />
80- </ span >
81- ) : redactedThinking ? (
82- "Redacted Thinking"
83- ) : (
84- "Thought" +
85- ( elapsedTime ? ` for ${ elapsedTime } ` : "" ) +
86- ( tokens ? ` (${ tokens } tokens)` : "" )
87- ) }
88- { open ? (
89- < ChevronUpIcon className = "h-3 w-3" />
90- ) : (
91- < ChevronDownIcon className = "h-3 w-3" />
92- ) }
93- </ ButtonContent >
94- </ SpoilerButton >
59+ < div className = "mt-1 flex flex-col px-4" >
60+ < div className = "flex min-w-0 flex-row items-center justify-between gap-2" >
61+ < button
62+ type = "button"
63+ className = "text-description flex min-w-0 cursor-pointer flex-row items-center gap-1.5 text-xs transition-colors duration-200 ease-in-out hover:brightness-125"
64+ data-testid = "thinking-block-peek"
65+ aria-expanded = { open }
66+ aria-controls = { `thinking-block-content-${ index } ` }
67+ onClick = { ( ) => setOpen ( ! open ) }
68+ >
69+ { inProgress ? (
70+ < span >
71+ { redactedThinking ? "Redacted Thinking" : "Thinking" }
72+ < AnimatedEllipsis />
73+ </ span >
74+ ) : redactedThinking ? (
75+ "Redacted Thinking"
76+ ) : (
77+ "Thought" +
78+ ( elapsedTime ? ` for ${ elapsedTime } ` : "" ) +
79+ ( tokens ? ` (${ tokens } tokens)` : "" )
80+ ) }
81+ { open ? (
82+ < ChevronUpIcon className = "h-3 w-3" />
83+ ) : (
84+ < ChevronDownIcon className = "h-3 w-3" />
85+ ) }
86+ </ button >
9587 </ div >
9688 < div
97- className = { `ml-2 mt-2 overflow-y-auto transition-none duration-300 ease-in-out ${
98- open ? "mb-2 mt-5 opacity-100" : "max-h-0 border-0 opacity-0"
89+ id = { `thinking-block-content-${ index } ` }
90+ className = { `mt-2 overflow-y-auto transition-all duration-300 ease-in-out ${
91+ open ? "max-h-[50vh] opacity-100" : "max-h-0 opacity-0"
9992 } `}
100- style = { {
101- borderLeft :
102- open && ! redactedThinking
103- ? "2px solid var(--vscode-input-border, #606060)"
104- : "none" ,
105- } }
10693 >
10794 { redactedThinking ? (
108- < div className = "text-description-muted pl-4 text-xs" >
95+ < div className = "text-description pl-5 text-xs italic " >
10996 Thinking content redacted due to safety reasons.
11097 </ div >
11198 ) : (
112- < >
113- < MarkdownWrapper className = "-mt-1 px-0 pl-1" >
114- < StyledMarkdownPreview
115- isRenderingInStepContainer
116- source = { content }
117- itemIndex = { index }
118- />
119- </ MarkdownWrapper >
120- </ >
99+ < MarkdownWrapper >
100+ < StyledMarkdownPreview
101+ isRenderingInStepContainer
102+ source = { content }
103+ itemIndex = { index }
104+ />
105+ </ MarkdownWrapper >
121106 ) }
122107 </ div >
123108 </ div >
0 commit comments