diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index a4dc6820d518..8740949ed0bf 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -1374,7 +1374,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: { if (!showSnoozeButton) setSnoozeMenuOpen(false); }, [showSnoozeButton]); const handlePrClick = useCallback( - (event: ReactMouseEvent) => { + (event: ReactMouseEvent) => { const url = pr?.url ?? currentLinkedPr?.url; if (!url) return; const openedInRightPanel = openPrLink( diff --git a/apps/web/src/components/ThreadStatusIndicators.tsx b/apps/web/src/components/ThreadStatusIndicators.tsx index 5b2945042ac2..8b27b74fd0a5 100644 --- a/apps/web/src/components/ThreadStatusIndicators.tsx +++ b/apps/web/src/components/ThreadStatusIndicators.tsx @@ -16,7 +16,7 @@ import { } from "@t3tools/shared/threadPullRequests"; import { FolderGit2Icon, TerminalIcon } from "lucide-react"; import { useMemo, type MouseEvent } from "react"; -import { buttonVariants, InlineButton } from "./ui/button"; +import { Button, InlineButton } from "./ui/button"; import { cn } from "../lib/utils"; import { useEnvironment, usePrimaryEnvironmentId } from "../state/environments"; import { EnvironmentMachineIcon } from "./EnvironmentMachineIcon"; @@ -207,50 +207,52 @@ export function ThreadPullRequestBadgeControl({ url?: string | undefined; status: PrStatusIndicator | null; onOpenStack: () => void; - onOpenPullRequest: (event: MouseEvent) => void; + onOpenPullRequest: (event: MouseEvent) => void; }) { const presentation = resolveThreadPullRequestBadgePresentation({ badge, number, url, status }); if (presentation === null) return null; const isStack = badge?.kind === "stack"; - const className = cn( - variant === "ghost" - ? buttonVariants({ variant: "ghost", size: "xs" }) - : "inline-flex shrink-0 cursor-pointer items-center gap-0.5 whitespace-nowrap border-b border-transparent hover:border-current focus-visible:outline-2 focus-visible:outline-ring", - "text-xs tabular-nums", - variant === "ghost" && - "font-normal text-xs! active:scale-100 [--control-icon-color:currentColor]", - presentation.toneClassName, - ); const content = ( <> {presentation.text} ); + const linkProps = isStack + ? { + onClick: (event: MouseEvent) => { + event.preventDefault(); + event.stopPropagation(); + onOpenStack(); + }, + } + : { onClick: onOpenPullRequest }; + const element = isStack ? ( +