From 4e8402fca891031158a1905282dd1bf00afcbe3d Mon Sep 17 00:00:00 2001 From: Big Drilla Date: Mon, 9 Mar 2026 03:38:45 -0400 Subject: [PATCH] feat(web): add terminal toggle button to chat header --- apps/web/src/components/ChatView.tsx | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 51b300ba8e..fcdcd4d001 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -146,6 +146,7 @@ import { CopyIcon, CheckIcon, ZapIcon, + TerminalSquareIcon, } from "lucide-react"; import { Button } from "./ui/button"; import { Input } from "./ui/input"; @@ -1298,6 +1299,10 @@ export default function ChatView({ threadId }: ChatViewProps) { () => shortcutLabelForCommand(keybindings, "terminal.split"), [keybindings], ); + const terminalToggleShortcutLabel = useMemo( + () => shortcutLabelForCommand(keybindings, "terminal.toggle"), + [keybindings], + ); const newTerminalShortcutLabel = useMemo( () => shortcutLabelForCommand(keybindings, "terminal.new"), [keybindings], @@ -3460,6 +3465,9 @@ export default function ChatView({ threadId }: ChatViewProps) { } keybindings={keybindings} availableEditors={availableEditors} + terminalAvailable={activeProject !== undefined} + terminalOpen={terminalState.terminalOpen} + terminalToggleShortcutLabel={terminalToggleShortcutLabel} diffToggleShortcutLabel={diffPanelShortcutLabel} gitCwd={gitCwd} diffOpen={diffOpen} @@ -3469,6 +3477,7 @@ export default function ChatView({ threadId }: ChatViewProps) { onAddProjectScript={saveProjectScript} onUpdateProjectScript={updateProjectScript} onDeleteProjectScript={deleteProjectScript} + onToggleTerminal={toggleTerminalVisibility} onToggleDiff={onToggleDiff} /> @@ -4105,6 +4114,9 @@ interface ChatHeaderProps { preferredScriptId: string | null; keybindings: ResolvedKeybindingsConfig; availableEditors: ReadonlyArray; + terminalAvailable: boolean; + terminalOpen: boolean; + terminalToggleShortcutLabel: string | null; diffToggleShortcutLabel: string | null; gitCwd: string | null; diffOpen: boolean; @@ -4112,6 +4124,7 @@ interface ChatHeaderProps { onAddProjectScript: (input: NewProjectScriptInput) => Promise; onUpdateProjectScript: (scriptId: string, input: NewProjectScriptInput) => Promise; onDeleteProjectScript: (scriptId: string) => Promise; + onToggleTerminal: () => void; onToggleDiff: () => void; } @@ -4125,6 +4138,9 @@ const ChatHeader = memo(function ChatHeader({ preferredScriptId, keybindings, availableEditors, + terminalAvailable, + terminalOpen, + terminalToggleShortcutLabel, diffToggleShortcutLabel, gitCwd, diffOpen, @@ -4132,6 +4148,7 @@ const ChatHeader = memo(function ChatHeader({ onAddProjectScript, onUpdateProjectScript, onDeleteProjectScript, + onToggleTerminal, onToggleDiff, }: ChatHeaderProps) { return ( @@ -4175,6 +4192,30 @@ const ChatHeader = memo(function ChatHeader({ /> )} {activeProjectName && } + + + + + } + /> + + {!terminalAvailable + ? "Terminal is unavailable until this thread has an active project." + : terminalToggleShortcutLabel + ? `Toggle terminal drawer (${terminalToggleShortcutLabel})` + : "Toggle terminal drawer"} + +