diff --git a/apps/web/src/components/ThreadTerminalDrawer.tsx b/apps/web/src/components/ThreadTerminalDrawer.tsx index 751deffbd..a50f7c013 100644 --- a/apps/web/src/components/ThreadTerminalDrawer.tsx +++ b/apps/web/src/components/ThreadTerminalDrawer.tsx @@ -1,5 +1,5 @@ import { FitAddon } from "@xterm/addon-fit"; -import { Plus, SquareSplitHorizontal, TerminalSquare, Trash2, XIcon } from "lucide-react"; +import { ChevronDown, Plus, SquareSplitHorizontal, TerminalSquare, Trash2, XIcon } from "lucide-react"; import { type ThreadId } from "@okcode/contracts"; import { Terminal, type ITheme } from "@xterm/xterm"; import { @@ -12,6 +12,7 @@ import { useRef, useState, } from "react"; +import { Menu, MenuItem, MenuPopup, MenuSeparator, MenuShortcut, MenuTrigger } from "~/components/ui/menu"; import { Popover, PopoverPopup, PopoverTrigger } from "~/components/ui/popover"; import { type TerminalContextSelection } from "~/lib/terminalContext"; import { openInPreferredEditor } from "../editorPreferences"; @@ -837,6 +838,71 @@ function TerminalActionButton({ label, className, onClick, children }: TerminalA ); } +interface TerminalDropdownMenuProps { + onSplitTerminal: () => void; + onNewTerminal: () => void; + onCloseTerminal: () => void; + splitDisabled: boolean; + splitLabel: string; + newLabel: string; + closeLabel: string; + splitShortcutLabel?: string | undefined; + newShortcutLabel?: string | undefined; + closeShortcutLabel?: string | undefined; + triggerClassName: string; +} + +function TerminalDropdownMenu({ + onSplitTerminal, + onNewTerminal, + onCloseTerminal, + splitDisabled, + splitLabel, + newLabel, + closeLabel, + splitShortcutLabel, + newShortcutLabel, + closeShortcutLabel, + triggerClassName, +}: TerminalDropdownMenuProps) { + return ( +
+ ); +} + export default function ThreadTerminalDrawer({ threadId, cwd, @@ -1097,33 +1163,19 @@ export default function ThreadTerminalDrawer({ {!hasTerminalSidebar && (