@@ -90,8 +90,10 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
9090
9191 // Initialize expanded state based on the persisted setting (default to expanded if undefined)
9292 const [ isExpanded , setIsExpanded ] = useState (
93+ // This is for the history preview
9394 historyPreviewCollapsed === undefined ? true : ! historyPreviewCollapsed ,
9495 )
96+ const [ isAutoApproveMenuExpanded , setIsAutoApproveMenuExpanded ] = useState ( false ) // New state for AutoApproveMenu
9597
9698 const toggleExpanded = useCallback ( ( ) => {
9799 const newState = ! isExpanded
@@ -100,6 +102,11 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
100102 vscode . postMessage ( { type : "setHistoryPreviewCollapsed" , bool : ! newState } )
101103 } , [ isExpanded ] )
102104
105+ const toggleAutoApproveMenuExpanded = useCallback ( ( ) => {
106+ // New callback for AutoApproveMenu
107+ setIsAutoApproveMenuExpanded ( ( prev ) => ! prev )
108+ } , [ ] )
109+
103110 // Leaving this less safe version here since if the first message is not a
104111 // task, then the extension is in a bad state and needs to be debugged (see
105112 // Cline.abort).
@@ -1234,19 +1241,6 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
12341241 </ >
12351242 ) : (
12361243 < div className = "flex-1 min-h-0 overflow-y-auto flex flex-col gap-4" >
1237- { /* Moved Task Bar Header Here */ }
1238- { tasks . length !== 0 && (
1239- < div className = "flex text-vscode-descriptionForeground w-full mx-auto px-5 pt-3" >
1240- < div className = "flex items-center gap-1 cursor-pointer" onClick = { toggleExpanded } >
1241- { tasks . length < 10 && (
1242- < span className = { `font-medium text-xs ` } > { t ( "history:recentTasks" ) } </ span >
1243- ) }
1244- < span
1245- className = { `codicon ${ isExpanded ? "codicon-eye" : "codicon-eye-closed" } scale-90` }
1246- />
1247- </ div >
1248- </ div >
1249- ) }
12501244 < div
12511245 className = { ` w-full flex flex-col gap-4 m-auto ${ isExpanded && tasks . length > 0 ? "mt-0" : "" } px-3.5 min-[370px]:px-10 pt-5 transition-all duration-300` } >
12521246 < RooHero />
@@ -1286,8 +1280,21 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
12861280 // but becomes scrollable when the viewport is too small
12871281 */ }
12881282 { ! task && (
1289- < div className = "mb-[-2px] flex-initial min-h-0" >
1290- < AutoApproveMenu />
1283+ < div className = { `mb-[-2px] flex-initial min-h-0 flex items-end justify-between px-5 pt-3` } >
1284+ { ! isAutoApproveMenuExpanded && (
1285+ < div className = "flex text-vscode-descriptionForeground flex-shrink-0 mb-1 mr-2.5" >
1286+ < div className = "flex items-center gap-1 cursor-pointer" onClick = { toggleExpanded } >
1287+ < span
1288+ className = { `codicon ${ isExpanded ? "codicon-eye" : "codicon-eye-closed" } scale-90` }
1289+ />
1290+ < span className = { `font-medium text-xs ` } > { t ( "history:recentTasks" ) } </ span >
1291+ </ div >
1292+ </ div >
1293+ ) }
1294+ < AutoApproveMenu
1295+ isExpanded = { isAutoApproveMenuExpanded }
1296+ onToggleExpanded = { toggleAutoApproveMenuExpanded }
1297+ />
12911298 </ div >
12921299 ) }
12931300
@@ -1316,7 +1323,10 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
13161323 initialTopMostItemIndex = { groupedMessages . length - 1 }
13171324 />
13181325 </ div >
1319- < AutoApproveMenu />
1326+ < AutoApproveMenu
1327+ isExpanded = { isAutoApproveMenuExpanded }
1328+ onToggleExpanded = { toggleAutoApproveMenuExpanded }
1329+ />
13201330 { showScrollToBottom ? (
13211331 < div className = "flex px-[15px] pt-[10px]" >
13221332 < div
0 commit comments