diff --git a/apps/web/src/components/LegacySidebar.tsx b/apps/web/src/components/LegacySidebar.tsx index 3a3936623275..81fd6047f13e 100644 --- a/apps/web/src/components/LegacySidebar.tsx +++ b/apps/web/src/components/LegacySidebar.tsx @@ -1,10 +1,6 @@ import { useSupportsMultiplePullRequests } from "~/hooks/useSupportsMultiplePullRequests"; import { GitPullRequestIcon } from "lucide-react"; -import { LinkBranchPullRequestButton } from "./pullRequest/LinkBranchPullRequestButton"; -import { - resolveThreadCurrentPullRequestLink, - visibleThreadPullRequests, -} from "@t3tools/shared/threadPullRequests"; +import { resolveThreadCurrentPullRequestLink } from "@t3tools/shared/threadPullRequests"; import { Spinner } from "~/components/ui/spinner"; import { ArchiveIcon, @@ -764,12 +760,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP ) : null} - {pr && - (supportsMultiplePullRequests - ? visibleThreadPullRequests(thread.pullRequests).length === 0 - : thread.linkedPullRequest == null) ? ( - - ) : null} {threadStatus && } {renamingThreadKey === threadKey ? ( - ) : null} {sortable?.isDragging ? ( dragDestination ) : ( @@ -1925,13 +1913,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: { )} {terminalStatusIcon} {prBadge} - {prBadge && - pr && - (supportsMultiplePullRequests - ? visibleThreadPullRequests(thread.pullRequests).length === 0 - : thread.linkedPullRequest == null) ? ( - - ) : null} {diff ? ( +{diff.insertions}{" "} diff --git a/apps/web/src/components/pullRequest/LinkBranchPullRequestButton.tsx b/apps/web/src/components/pullRequest/LinkBranchPullRequestButton.tsx deleted file mode 100644 index bbcb9e144190..000000000000 --- a/apps/web/src/components/pullRequest/LinkBranchPullRequestButton.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import type { ScopedThreadRef } from "@t3tools/contracts"; -import { Link2 } from "lucide-react"; -import { useState } from "react"; -import { usePullRequestLinking } from "~/hooks/usePullRequestLinking"; -import { Button } from "../ui/button"; -import { toastManager } from "../ui/toast"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; - -/** Adopts a branch discovery as a durable link, even after the thread changes branches. */ -export function LinkBranchPullRequestButton({ - threadRef, - url, -}: { - threadRef: ScopedThreadRef; - url: string; -}) { - const linking = usePullRequestLinking(threadRef.environmentId); - const [pending, setPending] = useState(false); - if (!linking.canLink(url)) return null; - return ( - - event.stopPropagation()} - onClick={async (event) => { - event.preventDefault(); - event.stopPropagation(); - setPending(true); - try { - await linking.changeLink(threadRef, url, true); - } catch (error) { - toastManager.add({ - type: "error", - title: "Could not link pull request", - description: error instanceof Error ? error.message : String(error), - }); - } finally { - setPending(false); - } - }} - > - - - } - /> - Link this PR to keep it with this thread - - ); -}