From 669168d08aa36c3b41f05d78605cdedb0bb1fce1 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sat, 14 Feb 2026 23:31:20 -0800 Subject: [PATCH] Polish action button icons and hover tooltips - Standardize quick action icon sizing and label spacing in chat and git controls - Replace manual popover hover state handling with `openOnHover` triggers - Add reusable terminal action button wrapper with hover tooltips for split/new/close controls --- apps/web/src/components/ChatView.tsx | 4 +- apps/web/src/components/GitActionsControl.tsx | 50 ++++------- .../src/components/ThreadTerminalDrawer.tsx | 85 ++++++++++++------- 3 files changed, 73 insertions(+), 66 deletions(-) diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index dbb646c2b17f085311fc549c7412ecd1723987dc..8fc32d360f12b37f735cc9738603f3495960b32b 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -1476,8 +1476,8 @@ function OpenInPicker() { return ( diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx index 604736ce741a52b146ba9edaf34e067b7af7cf34..b68ce2b50b3095bea60c0642a2845b6f88dcdc93 100644 --- a/apps/web/src/components/GitActionsControl.tsx +++ b/apps/web/src/components/GitActionsControl.tsx @@ -122,15 +122,16 @@ function GitActionItemIcon({ icon }: { icon: GitActionIconName }) { } function GitQuickActionIcon({ quickAction }: { quickAction: GitQuickAction }) { - if (quickAction.kind === "open_pr") return ; - if (quickAction.kind === "run_pull") return ; + const iconClassName = "size-3.5"; + if (quickAction.kind === "open_pr") return ; + if (quickAction.kind === "run_pull") return ; if (quickAction.kind === "run_action") { - if (quickAction.action === "commit") return ; - if (quickAction.action === "commit_push") return ; - return ; + if (quickAction.action === "commit") return ; + if (quickAction.action === "commit_push") return ; + return ; } - if (quickAction.label === "Commit") return ; - return ; + if (quickAction.label === "Commit") return ; + return ; } function buildGitActionProgressStages(input: { @@ -192,10 +193,6 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp const quickActionDisabledReason = quickAction.disabled ? (quickAction.hint ?? "This action is currently unavailable.") : null; - const [isQuickActionPopoverOpen, setIsQuickActionPopoverOpen] = useState(false); - const [openDisabledMenuItemId, setOpenDisabledMenuItemId] = useState< - GitActionMenuItem["id"] | null - >(null); const refreshGitStatus = useCallback(async () => { if (!api || !gitCwd) return; @@ -451,21 +448,20 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp ) : ( {quickActionDisabledReason ? ( - + setIsQuickActionPopoverOpen(true)} - onMouseLeave={() => setIsQuickActionPopoverOpen(false)} /> } > - {quickAction.label} + {quickAction.label} {quickActionDisabledReason} @@ -479,16 +475,11 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp onClick={runQuickAction} > - {quickAction.label} + {quickAction.label} )} - { - if (open) void refreshGitStatus(); - if (!open) setOpenDisabledMenuItemId(null); - }} - > + } disabled={isGitActionRunning} @@ -504,19 +495,10 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp ); if (item.disabled && disabledReason) { return ( - setOpenDisabledMenuItemId(open ? item.id : null)} - > + setOpenDisabledMenuItemId(item.id)} - onMouseLeave={() => setOpenDisabledMenuItemId(null)} - /> - } + openOnHover + render={} > diff --git a/apps/web/src/components/ThreadTerminalDrawer.tsx b/apps/web/src/components/ThreadTerminalDrawer.tsx index 03b057b2ed76b5e843d8c9c5d63cf6598eade5c1..eaa8b97fdc4a1df39362ebbc90dda0b8dd434544 100644 --- a/apps/web/src/components/ThreadTerminalDrawer.tsx +++ b/apps/web/src/components/ThreadTerminalDrawer.tsx @@ -4,12 +4,14 @@ import { type NativeApi } from "@t3tools/contracts"; import { Terminal, type ITheme } from "@xterm/xterm"; import { type PointerEvent as ReactPointerEvent, + type ReactNode, useCallback, useEffect, useMemo, useRef, useState, } from "react"; +import { Popover, PopoverPopup, PopoverTrigger } from "~/components/ui/popover"; import { extractTerminalLinks, isTerminalLinkActivation, @@ -419,6 +421,41 @@ interface ThreadTerminalDrawerProps { onHeightChange: (height: number) => void; } +interface TerminalActionButtonProps { + label: string; + className: string; + onClick: () => void; + children: ReactNode; +} + +function TerminalActionButton({ label, className, onClick, children }: TerminalActionButtonProps) { + return ( + + + } + > + {children} + + + {label} + + + ); +} + export default function ThreadTerminalDrawer({ api, threadId, @@ -654,35 +691,29 @@ export default function ThreadTerminalDrawer({ {!hasTerminalSidebar && (
- +
- +
- +
)} @@ -745,33 +776,27 @@ export default function ThreadTerminalDrawer({