From 0a37240a87bb2fed8f48cf20dc8312ee3b94eba6 Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 11 Sep 2026 00:13:23 -0300 Subject: [PATCH] fix(web): remove sidebar pull request link icon (#11179) --- apps/web/src/components/LegacySidebar.tsx | 12 +---- apps/web/src/components/Sidebar.tsx | 21 +------- .../LinkBranchPullRequestButton.tsx | 54 ------------------- 3 files changed, 2 insertions(+), 85 deletions(-) delete mode 100644 apps/web/src/components/pullRequest/LinkBranchPullRequestButton.tsx diff --git a/apps/web/src/components/LegacySidebar.tsx b/apps/web/src/components/LegacySidebar.tsx index 3a393662327571b8c6e3c781492f1feef7e9dd2c..81fd6047f13e1ea004c1a6f8f6420f55c7acabc8 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 bbcb9e1441903a6da42a6796a247b7f9eedc9019..0000000000000000000000000000000000000000 --- 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 - - ); -} -- 2.54.0