Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
Restore terminal drawer header toggle
Julius Marminge1b4317ec35da
diff --git a/apps/web/src/components/ChatView.browser.tsx b/apps/web/src/components/ChatView.browser.tsxindex 11d1ea121..81b9c7423 100644--- a/apps/web/src/components/ChatView.browser.tsx+++ b/apps/web/src/components/ChatView.browser.tsx@@ -23,7 +23,6 @@ import {ServerConfig as ServerConfigSchema,} from "@t3tools/contracts";import { scopedThreadKey, scopeThreadRef } from "@t3tools/client-runtime";-import { DEFAULT_RESOLVED_KEYBINDINGS } from "@t3tools/shared/keybindings";import { createModelCapabilities, createModelSelection } from "@t3tools/shared/model";import { RouterProvider, createMemoryHistory } from "@tanstack/react-router";import * as Option from "effect/Option";@@ -2065,26 +2064,15 @@ describe("ChatView timeline estimator parity (full app)", () => {targetMessageId: "msg-user-open-empty-terminal-drawer" as MessageId,targetText: "open empty terminal drawer",}),- configureFixture: (nextFixture) => {- nextFixture.serverConfig = {- ...nextFixture.serverConfig,- keybindings: DEFAULT_RESOLVED_KEYBINDINGS.filter(- (binding) => binding.command === "terminal.toggle",- ),- };- },});try {- window.dispatchEvent(- new KeyboardEvent("keydown", {- key: "j",- metaKey: isMacPlatform(navigator.platform),- ctrlKey: !isMacPlatform(navigator.platform),- bubbles: true,- cancelable: true,- }),+ const terminalToggle = await waitForElement(+ () =>+ document.querySelector<HTMLButtonElement>('button[aria-label="Toggle terminal drawer"]'),+ "Unable to find terminal drawer toggle.",);+ terminalToggle.click();await vi.waitFor(() => {@@ -2116,28 +2104,14 @@ describe("ChatView timeline estimator parity (full app)", () => {targetMessageId: "msg-user-open-inline-terminal-panel" as MessageId,targetText: "open inline terminal panel",}),- configureFixture: (nextFixture) => {- nextFixture.serverConfig = {- ...nextFixture.serverConfig,- keybindings: DEFAULT_RESOLVED_KEYBINDINGS.filter(- (binding) =>- binding.command === "rightPanel.toggle" || binding.command === "terminal.toggle",- ),- };- },});try {- window.dispatchEvent(- new KeyboardEvent("keydown", {- key: "b",- altKey: true,- metaKey: isMacPlatform(navigator.platform),- ctrlKey: !isMacPlatform(navigator.platform),- bubbles: true,- cancelable: true,- }),+ const rightPanelToggle = await waitForElement(+ () => document.querySelector<HTMLButtonElement>('button[aria-label="Toggle right panel"]'),+ "Unable to find right panel toggle.",);+ rightPanelToggle.click();const addSurface = await waitForElement(() => document.querySelector<HTMLButtonElement>('button[aria-label="Add panel surface"]'),@@ -2213,15 +2187,12 @@ describe("ChatView timeline estimator parity (full app)", () => {{ timeout: 8_000, interval: 16 },);- window.dispatchEvent(- new KeyboardEvent("keydown", {- key: "j",- metaKey: isMacPlatform(navigator.platform),- ctrlKey: !isMacPlatform(navigator.platform),- bubbles: true,- cancelable: true,- }),+ const drawerToggle = await waitForElement(+ () =>+ document.querySelector<HTMLButtonElement>('button[aria-label="Toggle terminal drawer"]'),+ "Unable to find terminal drawer toggle.",);+ drawerToggle.click();await vi.waitFor(() => {expect(diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsxindex 9b99cc827..bfeff47de 100644--- a/apps/web/src/components/ChatView.tsx+++ b/apps/web/src/components/ChatView.tsx@@ -4501,6 +4501,8 @@ export default function ChatView(props: ChatViewProps) {}keybindings={keybindings}availableEditors={availableEditors}+ terminalAvailable={Boolean(activeProject)}+ terminalOpen={Boolean(terminalUiState.terminalOpen)}rightPanelAvailable={Boolean(activeProject)}rightPanelOpen={rightPanelOpen}gitCwd={gitCwd}@@ -4508,6 +4510,7 @@ export default function ChatView(props: ChatViewProps) {onAddProjectScript={saveProjectScript}onUpdateProjectScript={updateProjectScript}onDeleteProjectScript={deleteProjectScript}+ onToggleTerminal={toggleTerminalVisibility}onToggleRightPanel={toggleRightPanel}/></header>diff --git a/apps/web/src/components/chat/ChatHeader.tsx b/apps/web/src/components/chat/ChatHeader.tsxindex 8421fc184..787913e7b 100644--- a/apps/web/src/components/chat/ChatHeader.tsx+++ b/apps/web/src/components/chat/ChatHeader.tsx@@ -9,7 +9,7 @@ import { scopeThreadRef } from "@t3tools/client-runtime";import { memo } from "react";import GitActionsControl from "../GitActionsControl";import { type DraftId } from "~/composerDraftStore";-import { PanelRightIcon } from "lucide-react";+import { PanelBottomIcon, PanelRightIcon } from "lucide-react";import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";import ProjectScriptsControl, { type NewProjectScriptInput } from "../ProjectScriptsControl";import { Toggle } from "../ui/toggle";@@ -29,6 +29,8 @@ interface ChatHeaderProps {preferredScriptId: string | null;keybindings: ResolvedKeybindingsConfig;availableEditors: ReadonlyArray<EditorId>;+ terminalAvailable: boolean;+ terminalOpen: boolean;rightPanelAvailable: boolean;rightPanelOpen: boolean;gitCwd: string | null;@@ -36,6 +38,7 @@ interface ChatHeaderProps {onAddProjectScript: (input: NewProjectScriptInput) => Promise<void>;onUpdateProjectScript: (scriptId: string, input: NewProjectScriptInput) => Promise<void>;onDeleteProjectScript: (scriptId: string) => Promise<void>;+ onToggleTerminal: () => void;onToggleRightPanel: () => void;}@@ -62,6 +65,8 @@ export const ChatHeader = memo(function ChatHeader({preferredScriptId,keybindings,availableEditors,+ terminalAvailable,+ terminalOpen,rightPanelAvailable,rightPanelOpen,gitCwd,@@ -69,6 +74,7 @@ export const ChatHeader = memo(function ChatHeader({onAddProjectScript,onUpdateProjectScript,onDeleteProjectScript,+ onToggleTerminal,onToggleRightPanel,}: ChatHeaderProps) {const primaryEnvironmentId = usePrimaryEnvironmentId();@@ -77,6 +83,7 @@ export const ChatHeader = memo(function ChatHeader({activeThreadEnvironmentId,primaryEnvironmentId,});+ const terminalShortcutLabel = shortcutLabelForCommand(keybindings, "terminal.toggle");const rightPanelShortcutLabel = shortcutLabelForCommand(keybindings, "rightPanel.toggle");return (@@ -123,6 +130,28 @@ export const ChatHeader = memo(function ChatHeader({{...(draftId ? { draftId } : {})}/>)}+ <Tooltip>+ <TooltipTrigger+ render={+ <Toggle+ className="shrink-0"+ pressed={terminalOpen}+ onPressedChange={onToggleTerminal}+ aria-label="Toggle terminal drawer"+ variant="ghost"+ size="xs"+ disabled={!terminalAvailable}+ >+ <PanelBottomIcon className="size-3.5" />+ </Toggle>+ }+ />+ <TooltipPopup side="bottom">+ {terminalAvailable+ ? `Toggle terminal drawer${terminalShortcutLabel ? ` (${terminalShortcutLabel})` : ""}`+ : "Terminal drawer is unavailable"}+ </TooltipPopup>+ </Tooltip><Tooltip><TooltipTriggerrender={