@@ -1641,7 +1641,8 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
16411641 vscode . postMessage ( { type : "condenseTaskContextRequest" , text : taskId } )
16421642 }
16431643
1644- const areButtonsVisible = showScrollToBottom || primaryButtonText || secondaryButtonText
1644+ const hasApprovalButtons = Boolean ( primaryButtonText || secondaryButtonText )
1645+ const areButtonsVisible = showScrollToBottom || hasApprovalButtons
16451646 const currentTaskAggregatedCosts = currentTaskId ? aggregatedCostsMap . get ( currentTaskId ) : undefined
16461647
16471648 return (
@@ -1735,17 +1736,23 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
17351736 className = { `flex h-9 items-center mb-1 px-[15px] ${
17361737 showScrollToBottom ? "opacity-100" : enableButtons ? "opacity-100" : "opacity-50"
17371738 } `} >
1738- { showScrollToBottom ? (
1739+ { showScrollToBottom && (
17391740 < >
17401741 < StandardTooltip content = { t ( "chat:scrollToBottom" ) } >
17411742 < Button
17421743 variant = "secondary"
1743- className = { hasLatestCheckpoint ? "flex-1 mr-[6px]" : "flex-[2]" }
1744+ className = {
1745+ hasApprovalButtons
1746+ ? "w-9 shrink-0 mr-[6px]"
1747+ : hasLatestCheckpoint
1748+ ? "flex-1 mr-[6px]"
1749+ : "flex-[2]"
1750+ }
17441751 onClick = { handleScrollToBottomAndResetCheckpointCursor } >
17451752 < span className = "codicon codicon-chevron-down" > </ span >
17461753 </ Button >
17471754 </ StandardTooltip >
1748- { hasLatestCheckpoint && (
1755+ { hasLatestCheckpoint && ! hasApprovalButtons && (
17491756 < StandardTooltip content = { t ( "chat:scrollToLatestCheckpoint" ) } >
17501757 < Button
17511758 variant = "secondary"
@@ -1757,63 +1764,61 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
17571764 </ StandardTooltip >
17581765 ) }
17591766 </ >
1760- ) : (
1761- < >
1762- { primaryButtonText && (
1763- < StandardTooltip
1764- content = {
1765- primaryButtonText === t ( "chat:retry.title" )
1766- ? t ( "chat:retry.tooltip" )
1767- : primaryButtonText === t ( "chat:save.title" )
1768- ? t ( "chat:save.tooltip" )
1769- : primaryButtonText === t ( "chat:approve.title" )
1770- ? t ( "chat:approve.tooltip" )
1771- : primaryButtonText === t ( "chat:runCommand.title" )
1772- ? t ( "chat:runCommand.tooltip" )
1773- : primaryButtonText === t ( "chat:startNewTask.title" )
1774- ? t ( "chat:startNewTask.tooltip" )
1775- : primaryButtonText === t ( "chat:resumeTask.title" )
1776- ? t ( "chat:resumeTask.tooltip" )
1777- : primaryButtonText ===
1778- t ( "chat:proceedAnyways.title" )
1779- ? t ( "chat:proceedAnyways.tooltip" )
1780- : primaryButtonText ===
1781- t ( "chat:proceedWhileRunning.title" )
1782- ? t ( "chat:proceedWhileRunning.tooltip" )
1783- : undefined
1784- } >
1785- < Button
1786- variant = "primary"
1787- disabled = { ! enableButtons }
1788- className = { secondaryButtonText ? "flex-1 mr-[6px]" : "flex-[2] mr-0" }
1789- onClick = { ( ) => handlePrimaryButtonClick ( inputValue , selectedImages ) } >
1790- { primaryButtonText }
1791- </ Button >
1792- </ StandardTooltip >
1793- ) }
1794- { secondaryButtonText && (
1795- < StandardTooltip
1796- content = {
1797- secondaryButtonText === t ( "chat:startNewTask.title" )
1798- ? t ( "chat:startNewTask.tooltip" )
1799- : secondaryButtonText === t ( "chat:reject.title" )
1800- ? t ( "chat:reject.tooltip" )
1801- : secondaryButtonText === t ( "chat:terminate.title" )
1802- ? t ( "chat:terminate.tooltip" )
1803- : secondaryButtonText === t ( "chat:killCommand.title" )
1804- ? t ( "chat:killCommand.tooltip" )
1805- : undefined
1806- } >
1807- < Button
1808- variant = "secondary"
1809- disabled = { ! enableButtons }
1810- className = "flex-1 ml-[6px]"
1811- onClick = { ( ) => handleSecondaryButtonClick ( inputValue , selectedImages ) } >
1812- { secondaryButtonText }
1813- </ Button >
1814- </ StandardTooltip >
1815- ) }
1816- </ >
1767+ ) }
1768+ { primaryButtonText && (
1769+ < StandardTooltip
1770+ content = {
1771+ primaryButtonText === t ( "chat:retry.title" )
1772+ ? t ( "chat:retry.tooltip" )
1773+ : primaryButtonText === t ( "chat:save.title" )
1774+ ? t ( "chat:save.tooltip" )
1775+ : primaryButtonText === t ( "chat:approve.title" )
1776+ ? t ( "chat:approve.tooltip" )
1777+ : primaryButtonText === t ( "chat:runCommand.title" )
1778+ ? t ( "chat:runCommand.tooltip" )
1779+ : primaryButtonText === t ( "chat:startNewTask.title" )
1780+ ? t ( "chat:startNewTask.tooltip" )
1781+ : primaryButtonText === t ( "chat:resumeTask.title" )
1782+ ? t ( "chat:resumeTask.tooltip" )
1783+ : primaryButtonText === t ( "chat:proceedAnyways.title" )
1784+ ? t ( "chat:proceedAnyways.tooltip" )
1785+ : primaryButtonText ===
1786+ t ( "chat:proceedWhileRunning.title" )
1787+ ? t ( "chat:proceedWhileRunning.tooltip" )
1788+ : primaryButtonText
1789+ } >
1790+ < Button
1791+ variant = "primary"
1792+ disabled = { ! enableButtons }
1793+ className = {
1794+ secondaryButtonText ? "min-w-0 flex-1 mr-[6px]" : "min-w-0 flex-[2] mr-0"
1795+ }
1796+ onClick = { ( ) => handlePrimaryButtonClick ( inputValue , selectedImages ) } >
1797+ < span className = "min-w-0 truncate" > { primaryButtonText } </ span >
1798+ </ Button >
1799+ </ StandardTooltip >
1800+ ) }
1801+ { secondaryButtonText && (
1802+ < StandardTooltip
1803+ content = {
1804+ secondaryButtonText === t ( "chat:startNewTask.title" )
1805+ ? t ( "chat:startNewTask.tooltip" )
1806+ : secondaryButtonText === t ( "chat:reject.title" )
1807+ ? t ( "chat:reject.tooltip" )
1808+ : secondaryButtonText === t ( "chat:terminate.title" )
1809+ ? t ( "chat:terminate.tooltip" )
1810+ : secondaryButtonText === t ( "chat:killCommand.title" )
1811+ ? t ( "chat:killCommand.tooltip" )
1812+ : secondaryButtonText
1813+ } >
1814+ < Button
1815+ variant = "secondary"
1816+ disabled = { ! enableButtons }
1817+ className = "min-w-0 flex-1 ml-[6px]"
1818+ onClick = { ( ) => handleSecondaryButtonClick ( inputValue , selectedImages ) } >
1819+ < span className = "min-w-0 truncate" > { secondaryButtonText } </ span >
1820+ </ Button >
1821+ </ StandardTooltip >
18171822 ) }
18181823 </ div >
18191824 ) }
0 commit comments