authorgravatar for maria@kuuro.netmaria <maria@kuuro.net> 2026-09-11 00:13:23-03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-11 00:13:23-03:00
log0a37240a87bb2fed8f48cf20dc8312ee3b94eba6
treeb487ec92882344b12871fcffe968d55f5875d22e
parent4d06156dd7821851007e61489105f33dbb241a7f
signature Signed by PGP key B5690EEEBB952194

fix(web): remove sidebar pull request link icon (#11179)


3 files changed, 2 insertions(+), 85 deletions(-)

apps/web/src/components/LegacySidebar.tsx+1-11
......@@ -1,10 +1,6 @@
11import { useSupportsMultiplePullRequests } from "~/hooks/useSupportsMultiplePullRequests";
22import { GitPullRequestIcon } from "lucide-react";
3import { LinkBranchPullRequestButton } from "./pullRequest/LinkBranchPullRequestButton";
4import {
5 resolveThreadCurrentPullRequestLink,
6 visibleThreadPullRequests,
7} from "@t3tools/shared/threadPullRequests";
3import { resolveThreadCurrentPullRequestLink } from "@t3tools/shared/threadPullRequests";
84import { Spinner } from "~/components/ui/spinner";
95import {
106 ArchiveIcon,
......@@ -764,12 +760,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
764760 <GitPullRequestIcon className="size-3" />
765761 </a>
766762 ) : null}
767 {pr &&
768 (supportsMultiplePullRequests
769 ? visibleThreadPullRequests(thread.pullRequests).length === 0
770 : thread.linkedPullRequest == null) ? (
771 <LinkBranchPullRequestButton threadRef={threadRef} url={pr.url} />
772 ) : null}
773763 {threadStatus && <ThreadStatusLabel status={threadStatus} />}
774764 {renamingThreadKey === threadKey ? (
775765 <input
apps/web/src/components/Sidebar.tsx+1-20
......@@ -1,9 +1,5 @@
11import { useSupportsMultiplePullRequests } from "~/hooks/useSupportsMultiplePullRequests";
2import { LinkBranchPullRequestButton } from "./pullRequest/LinkBranchPullRequestButton";
3import {
4 resolveThreadCurrentPullRequestLink,
5 visibleThreadPullRequests,
6} from "@t3tools/shared/threadPullRequests";
2import { resolveThreadCurrentPullRequestLink } from "@t3tools/shared/threadPullRequests";
73import { useAtomValue } from "@effect/atom-react";
84import * as Schema from "effect/Schema";
95import {
......@@ -1617,14 +1613,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
16171613 remain visible AND clickable while the row is hovered. Only
16181614 the time/jump label yields to the settle affordance. */}
16191615 {prBadge}
1620 {prBadge &&
1621 variantAction !== "unsettle" &&
1622 pr &&
1623 (supportsMultiplePullRequests
1624 ? visibleThreadPullRequests(thread.pullRequests).length === 0
1625 : thread.linkedPullRequest == null) ? (
1626 <LinkBranchPullRequestButton threadRef={threadRef} url={pr.url} />
1627 ) : null}
16281616 {sortable?.isDragging ? (
16291617 dragDestination
16301618 ) : (
......@@ -1925,13 +1913,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
19251913 )}
19261914 {terminalStatusIcon}
19271915 {prBadge}
1928 {prBadge &&
1929 pr &&
1930 (supportsMultiplePullRequests
1931 ? visibleThreadPullRequests(thread.pullRequests).length === 0
1932 : thread.linkedPullRequest == null) ? (
1933 <LinkBranchPullRequestButton threadRef={threadRef} url={pr.url} />
1934 ) : null}
19351916 {diff ? (
19361917 <span className="shrink-0 font-mono">
19371918 <span className="text-diff-addition-foreground">+{diff.insertions}</span>{" "}
apps/web/src/components/pullRequest/LinkBranchPullRequestButton.tsx deleted-54
......@@ -1,54 +0,0 @@
1import type { ScopedThreadRef } from "@t3tools/contracts";
2import { Link2 } from "lucide-react";
3import { useState } from "react";
4import { usePullRequestLinking } from "~/hooks/usePullRequestLinking";
5import { Button } from "../ui/button";
6import { toastManager } from "../ui/toast";
7import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
8
9/** Adopts a branch discovery as a durable link, even after the thread changes branches. */
10export function LinkBranchPullRequestButton({
11 threadRef,
12 url,
13}: {
14 threadRef: ScopedThreadRef;
15 url: string;
16}) {
17 const linking = usePullRequestLinking(threadRef.environmentId);
18 const [pending, setPending] = useState(false);
19 if (!linking.canLink(url)) return null;
20 return (
21 <Tooltip>
22 <TooltipTrigger
23 render={
24 <Button
25 size="icon-tiny"
26 variant="ghost-muted"
27 aria-label="Link this PR"
28 disabled={pending}
29 onPointerDown={(event) => event.stopPropagation()}
30 onClick={async (event) => {
31 event.preventDefault();
32 event.stopPropagation();
33 setPending(true);
34 try {
35 await linking.changeLink(threadRef, url, true);
36 } catch (error) {
37 toastManager.add({
38 type: "error",
39 title: "Could not link pull request",
40 description: error instanceof Error ? error.message : String(error),
41 });
42 } finally {
43 setPending(false);
44 }
45 }}
46 >
47 <Link2 className="size-3" />
48 </Button>
49 }
50 />
51 <TooltipPopup>Link this PR to keep it with this thread</TooltipPopup>
52 </Tooltip>
53 );
54}