@@ -1777,6 +1777,53 @@ export default function ThreadTerminalDrawer({
17771777 ) ;
17781778 }
17791779
1780+ // The single-terminal row and the split sidebar header share these controls,
1781+ // so neither layout floats them over terminal text.
1782+ const terminalActions = (
1783+ < div className = "inline-flex h-full items-stretch" >
1784+ < TerminalActionButton
1785+ disabled = { ! canOperateTerminal }
1786+ className = { `inline-flex h-full items-center px-1 text-foreground/90 transition-colors ${
1787+ hasReachedSplitLimit
1788+ ? "cursor-not-allowed opacity-64 hover:bg-transparent"
1789+ : "hover:bg-accent/70"
1790+ } `}
1791+ onClick = { onSplitTerminalAction }
1792+ label = { splitTerminalActionLabel }
1793+ >
1794+ < SquareSplitHorizontal className = "size-3.25" />
1795+ </ TerminalActionButton >
1796+ < TerminalActionButton
1797+ disabled = { ! canOperateTerminal }
1798+ className = { `inline-flex h-full items-center border-l border-border/70 px-1 text-foreground/90 transition-colors ${
1799+ hasReachedSplitLimit
1800+ ? "cursor-not-allowed opacity-64 hover:bg-transparent"
1801+ : "hover:bg-accent/70"
1802+ } `}
1803+ onClick = { onSplitTerminalVerticalAction }
1804+ label = { splitTerminalVerticalActionLabel }
1805+ >
1806+ < SquareSplitVertical className = "size-3.25" />
1807+ </ TerminalActionButton >
1808+ < TerminalActionButton
1809+ disabled = { ! canOperateTerminal }
1810+ className = "inline-flex h-full items-center border-l border-border/70 px-1 text-foreground/90 transition-colors hover:bg-accent/70"
1811+ onClick = { onNewTerminalAction }
1812+ label = { newTerminalActionLabel }
1813+ >
1814+ < Plus className = "size-3.25" />
1815+ </ TerminalActionButton >
1816+ < TerminalActionButton
1817+ disabled = { ! canOperateTerminal }
1818+ className = "inline-flex h-full items-center border-l border-border/70 px-1 text-foreground/90 transition-colors hover:bg-accent/70"
1819+ onClick = { ( ) => confirmCloseTerminal ( resolvedActiveTerminalId ) }
1820+ label = { closeTerminalActionLabel }
1821+ >
1822+ < Trash2 className = "size-3.25" />
1823+ </ TerminalActionButton >
1824+ </ div >
1825+ ) ;
1826+
17801827 return (
17811828 < aside
17821829 ref = { drawerRef }
@@ -1801,52 +1848,14 @@ export default function ThreadTerminalDrawer({
18011848 ) : null }
18021849
18031850 { ! hasTerminalSidebar && (
1804- < div className = "pointer-events-none absolute right-2 top-2 z-20" >
1805- < div className = "pointer-events-auto inline-flex items-center overflow-hidden rounded-md border border-border/80 bg-background shadow-xs" >
1806- < TerminalActionButton
1807- disabled = { ! canOperateTerminal }
1808- className = { `p-1 text-foreground/90 transition-colors ${
1809- hasReachedSplitLimit
1810- ? "cursor-not-allowed opacity-64 hover:bg-transparent"
1811- : "hover:bg-accent"
1812- } `}
1813- onClick = { onSplitTerminalAction }
1814- label = { splitTerminalActionLabel }
1815- >
1816- < SquareSplitHorizontal className = "size-3.25" />
1817- </ TerminalActionButton >
1818- < div className = "h-4 w-px bg-border/80" />
1819- < TerminalActionButton
1820- disabled = { ! canOperateTerminal }
1821- className = { `p-1 text-foreground/90 transition-colors ${
1822- hasReachedSplitLimit
1823- ? "cursor-not-allowed opacity-64 hover:bg-transparent"
1824- : "hover:bg-accent"
1825- } `}
1826- onClick = { onSplitTerminalVerticalAction }
1827- label = { splitTerminalVerticalActionLabel }
1828- >
1829- < SquareSplitVertical className = "size-3.25" />
1830- </ TerminalActionButton >
1831- < div className = "h-4 w-px bg-border/80" />
1832- < TerminalActionButton
1833- disabled = { ! canOperateTerminal }
1834- className = "p-1 text-foreground/90 transition-colors hover:bg-accent"
1835- onClick = { onNewTerminalAction }
1836- label = { newTerminalActionLabel }
1837- >
1838- < Plus className = "size-3.25" />
1839- </ TerminalActionButton >
1840- < div className = "h-4 w-px bg-border/80" />
1841- < TerminalActionButton
1842- disabled = { ! canOperateTerminal }
1843- className = "p-1 text-foreground/90 transition-colors hover:bg-accent"
1844- onClick = { ( ) => confirmCloseTerminal ( resolvedActiveTerminalId ) }
1845- label = { closeTerminalActionLabel }
1846- >
1847- < Trash2 className = "size-3.25" />
1848- </ TerminalActionButton >
1849- </ div >
1851+ < div
1852+ className = { cn (
1853+ "flex shrink-0 items-stretch justify-end border-b border-border/70" ,
1854+ // The drawer's resize strip covers its top 6px; keep the buttons below it.
1855+ isPanel ? "h-[22px]" : "h-7 pt-1.5" ,
1856+ ) }
1857+ >
1858+ { terminalActions }
18501859 </ div >
18511860 ) }
18521861
@@ -1878,48 +1887,7 @@ export default function ThreadTerminalDrawer({
18781887 { hasTerminalSidebar && (
18791888 < aside className = "flex w-36 min-w-36 flex-col border border-border/70 bg-muted/10" >
18801889 < div className = "flex h-[22px] items-stretch justify-end border-b border-border/70" >
1881- < div className = "inline-flex h-full items-stretch" >
1882- < TerminalActionButton
1883- disabled = { ! canOperateTerminal }
1884- className = { `inline-flex h-full items-center px-1 text-foreground/90 transition-colors ${
1885- hasReachedSplitLimit
1886- ? "cursor-not-allowed opacity-64 hover:bg-transparent"
1887- : "hover:bg-accent/70"
1888- } `}
1889- onClick = { onSplitTerminalAction }
1890- label = { splitTerminalActionLabel }
1891- >
1892- < SquareSplitHorizontal className = "size-3.25" />
1893- </ TerminalActionButton >
1894- < TerminalActionButton
1895- disabled = { ! canOperateTerminal }
1896- className = { `inline-flex h-full items-center border-l border-border/70 px-1 text-foreground/90 transition-colors ${
1897- hasReachedSplitLimit
1898- ? "cursor-not-allowed opacity-64 hover:bg-transparent"
1899- : "hover:bg-accent/70"
1900- } `}
1901- onClick = { onSplitTerminalVerticalAction }
1902- label = { splitTerminalVerticalActionLabel }
1903- >
1904- < SquareSplitVertical className = "size-3.25" />
1905- </ TerminalActionButton >
1906- < TerminalActionButton
1907- disabled = { ! canOperateTerminal }
1908- className = "inline-flex h-full items-center border-l border-border/70 px-1 text-foreground/90 transition-colors hover:bg-accent/70"
1909- onClick = { onNewTerminalAction }
1910- label = { newTerminalActionLabel }
1911- >
1912- < Plus className = "size-3.25" />
1913- </ TerminalActionButton >
1914- < TerminalActionButton
1915- disabled = { ! canOperateTerminal }
1916- className = "inline-flex h-full items-center border-l border-border/70 px-1 text-foreground/90 transition-colors hover:bg-accent/70"
1917- onClick = { ( ) => confirmCloseTerminal ( resolvedActiveTerminalId ) }
1918- label = { closeTerminalActionLabel }
1919- >
1920- < Trash2 className = "size-3.25" />
1921- </ TerminalActionButton >
1922- </ div >
1890+ { terminalActions }
19231891 </ div >
19241892
19251893 < div className = "min-h-0 flex-1 overflow-y-auto px-1 py-1" >
0 commit comments