@@ -14,15 +14,7 @@ import { ChatContent } from './ChatContent';
1414import { getApp } from "../../helpers/app" ;
1515import 'reflect-metadata' ;
1616import { parseArguments } from '../../planner/plannerActions' ;
17-
18- import { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter' ;
19- import python from 'react-syntax-highlighter/dist/esm/languages/prism/python' ;
20- import sql from 'react-syntax-highlighter/dist/esm/languages/prism/sql' ;
21- import vsd from 'react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus' ;
22- import { getPlatformLanguage } from '../../helpers/utils' ;
23-
24- SyntaxHighlighter . registerLanguage ( 'python' , python ) ;
25- SyntaxHighlighter . registerLanguage ( 'sql' , sql ) ;
17+ import { CodeBlock } from './CodeBlock' ;
2618
2719function removeThinkingTags ( input : string ) : string {
2820 return input ? input . replace ( / < t h i n k i n g > [ \s \S ] * ?< \/ t h i n k i n g > / g, '' ) : input ;
@@ -42,18 +34,8 @@ export const ActionStack: React.FC<{status: string, actions: Array<ActionStatusV
4234 latency
4335} ) => {
4436 const [ isExpanded , setIsExpanded ] = useState ( false ) ;
45- const [ controller , setController ] = useState < any > ( null ) ;
4637 const currentTool = useSelector ( ( state : RootState ) => state . settings . iframeInfo . tool )
47-
48- useEffect ( ( ) => {
49- const fetchController = async ( ) => {
50- const app = await getApp ( ) ;
51- setController ( app . actionController ) ;
52- } ;
53-
54- fetchController ( ) ;
55- } , [ ] ) ;
56-
38+ const controller = getApp ( ) . actionController
5739 const getActionLabels = ( action : string , attr : string ) => {
5840 if ( controller ) {
5941 const metadata = Reflect . getMetadata ( 'actionMetadata' , controller , action ) ;
@@ -88,8 +70,9 @@ export const ActionStack: React.FC<{status: string, actions: Array<ActionStatusV
8870 const toggleExpand = ( ) => {
8971 setIsExpanded ( ! isExpanded )
9072 }
73+
9174 return (
92- < HStack aria-label = { title } className = { 'action-stack' } justifyContent = { 'start' } maxWidth = { "100%" } >
75+ < HStack aria-label = { title } className = { 'action-stack' } justifyContent = { 'start' } maxWidth = { "100%" } width = { isExpanded ? "100%" : "" } >
9376 < Box
9477 bg = { 'minusxGreen.800' }
9578 // bg={'minusxBW.600'}
@@ -101,7 +84,7 @@ export const ActionStack: React.FC<{status: string, actions: Array<ActionStatusV
10184 color = { 'minusxBW.50' }
10285 // color={'minusxGreen.800'}
10386 border = { '1px' }
104- maxWidth = { '100%' }
87+ width = { '100%' }
10588 position = "relative"
10689 >
10790 { content && < >
@@ -149,9 +132,7 @@ export const ActionStack: React.FC<{status: string, actions: Array<ActionStatusV
149132 </ HStack >
150133
151134 { code && < Box width = { "100%" } p = { 2 } bg = { "#1e1e1e" } borderRadius = { 5 } >
152- < SyntaxHighlighter language = { getPlatformLanguage ( currentTool ) } style = { vsd } >
153- { code || "" }
154- </ SyntaxHighlighter >
135+ < CodeBlock code = { code || "" } tool = { currentTool } />
155136 </ Box >
156137 }
157138
@@ -218,7 +199,7 @@ const scrollUp = keyframes`
218199 ` ;
219200
220201const PlanningActionStack : React . FC = ( ) => {
221- const planningActions = [ 'Planning' , 'Understanding App state ' , 'Thinking ' , 'Finalizing Actions' , 'Validating Answers' ]
202+ const planningActions = [ 'Planning next steps ' , 'Thinking about the question ' , 'Understanding App state ' , 'Finalizing Actions' , 'Validating Answers' ]
222203 const [ currentTitleIndex , setCurrentTitleIndex ] = useState ( 0 ) ;
223204 useEffect ( ( ) => {
224205 const intervalId = setInterval ( ( ) => {
@@ -235,7 +216,8 @@ const PlanningActionStack: React.FC = () => {
235216 borderRadius = { 5 }
236217 color = { 'minusxBW.50' }
237218 width = { "100%" }
238- position = "relative"
219+ display = { "flex" }
220+ justifyContent = { "center" }
239221 >
240222 < HStack >
241223 < Box >
@@ -245,4 +227,4 @@ const PlanningActionStack: React.FC = () => {
245227 </ HStack >
246228 </ Box >
247229 </ HStack >
248- ) }
230+ ) }
0 commit comments