@devries-cameron20 / t3code Mirror · read-only / commits / 0a37240a87
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 02:45 UTC

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

maria committed Sep 11, 2026 at 00:13 UTC 0a37240a87bb2fed8f48cf20dc8312ee3b94eba6
3 files changed +2 -85
apps/web/src/components/LegacySidebar.tsx
+1 -11
@@ -1,10 +1,6 @@
1 import { useSupportsMultiplePullRequests } from "~/hooks/useSupportsMultiplePullRequests";
2 import { GitPullRequestIcon } from "lucide-react";
3 -import { LinkBranchPullRequestButton } from "./pullRequest/LinkBranchPullRequestButton";
4 -import {
5 - resolveThreadCurrentPullRequestLink,
6 - visibleThreadPullRequests,
7 -} from "@t3tools/shared/threadPullRequests";
3 +import { resolveThreadCurrentPullRequestLink } from "@t3tools/shared/threadPullRequests";
4 import { Spinner } from "~/components/ui/spinner";
5 import {
6 ArchiveIcon,
@@ -764,12 +760,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
760 <GitPullRequestIcon className="size-3" />
761 </a>
762 ) : null}
767 - {pr &&
768 - (supportsMultiplePullRequests
769 - ? visibleThreadPullRequests(thread.pullRequests).length === 0
770 - : thread.linkedPullRequest == null) ? (
771 - <LinkBranchPullRequestButton threadRef={threadRef} url={pr.url} />
772 - ) : null}
763 {threadStatus && <ThreadStatusLabel status={threadStatus} />}
764 {renamingThreadKey === threadKey ? (
765 <input
apps/web/src/components/Sidebar.tsx
+1 -20
@@ -1,9 +1,5 @@
1 import { useSupportsMultiplePullRequests } from "~/hooks/useSupportsMultiplePullRequests";
2 -import { LinkBranchPullRequestButton } from "./pullRequest/LinkBranchPullRequestButton";
3 -import {
4 - resolveThreadCurrentPullRequestLink,
5 - visibleThreadPullRequests,
6 -} from "@t3tools/shared/threadPullRequests";
2 +import { resolveThreadCurrentPullRequestLink } from "@t3tools/shared/threadPullRequests";
3 import { useAtomValue } from "@effect/atom-react";
4 import * as Schema from "effect/Schema";
5 import {
@@ -1617,14 +1613,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
1613 remain visible AND clickable while the row is hovered. Only
1614 the time/jump label yields to the settle affordance. */}
1615 {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}
1616 {sortable?.isDragging ? (
1617 dragDestination
1618 ) : (
@@ -1925,13 +1913,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
1913 )}
1914 {terminalStatusIcon}
1915 {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}
1916 {diff ? (
1917 <span className="shrink-0 font-mono">
1918 <span className="text-diff-addition-foreground">+{diff.insertions}</span>{" "}
apps/web/src/components/pullRequest/LinkBranchPullRequestButton.tsx deleted
-54
@@ -1,54 +0,0 @@
1 -import type { ScopedThreadRef } from "@t3tools/contracts";
2 -import { Link2 } from "lucide-react";
3 -import { useState } from "react";
4 -import { usePullRequestLinking } from "~/hooks/usePullRequestLinking";
5 -import { Button } from "../ui/button";
6 -import { toastManager } from "../ui/toast";
7 -import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
8 -
9 -/** Adopts a branch discovery as a durable link, even after the thread changes branches. */
10 -export 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 -}