From cd923cb8a4f7d6e739b9d2bb18dee0aa8187a029 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Sun, 17 May 2026 18:46:16 -0400 Subject: [PATCH] Fix floating terminal toggle overlap (#2167) Co-authored-by: Orca --- src/renderer/src/App.tsx | 28 +++++++++++-------- .../FloatingTerminalToggleButton.tsx | 7 +++-- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index fcbafa82b..422dd9538 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -275,6 +275,9 @@ function App(): React.JSX.Element { (s) => s.settings?.floatingTerminalTriggerLocation ?? 'floating-button' ) const statusBarVisible = useAppStore((s) => s.statusBarVisible) + const showFloatingTerminalButton = + floatingTerminalEnabled && + (floatingTerminalTriggerLocation === 'floating-button' || !statusBarVisible) // Why: the floating terminal is a transient overlay; hotkey minimize should // return keyboard focus to the surface the user was working in before it. const floatingTerminalReturnFocusRef = useRef(null) @@ -1454,6 +1457,15 @@ function App(): React.JSX.Element { {activeView === 'terminal' && !activeWorktreeId ? : null} + {showFloatingTerminalButton ? ( + setFloatingTerminalOpenWithFocus((open) => !open)} + /> + ) : null} @@ -1465,18 +1477,10 @@ function App(): React.JSX.Element { {showRightSidebarControls ? : null} {floatingTerminalEnabled ? ( - <> - - {floatingTerminalTriggerLocation === 'floating-button' || !statusBarVisible ? ( - setFloatingTerminalOpenWithFocus((open) => !open)} - /> - ) : null} - + ) : null} {/* Why: root overlays can render Radix s; keep them inside diff --git a/src/renderer/src/components/floating-terminal/FloatingTerminalToggleButton.tsx b/src/renderer/src/components/floating-terminal/FloatingTerminalToggleButton.tsx index 986f16126..14a05e4c4 100644 --- a/src/renderer/src/components/floating-terminal/FloatingTerminalToggleButton.tsx +++ b/src/renderer/src/components/floating-terminal/FloatingTerminalToggleButton.tsx @@ -1,21 +1,24 @@ import { TerminalSquare } from 'lucide-react' import { Button } from '@/components/ui/button' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' +import { cn } from '@/lib/utils' import { FloatingTerminalIconContextMenu } from './FloatingTerminalIconContextMenu' export function FloatingTerminalToggleButton({ open, - onToggle + onToggle, + className }: { open: boolean onToggle: () => void + className?: string }): React.JSX.Element { const shortcutLabel = typeof navigator !== 'undefined' && navigator.userAgent.includes('Mac') ? '⌘⌥T' : 'Ctrl+Alt+T' return (