@devries-cameron20 / t3code Mirror · read-only / commits / a8f5237a3c
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 21, 03:37 UTC

fix(web): repository and loading-header PR links honor 'Open links in' (#39926)

Co-authored-by: angrojo <angel.rojo24@estudiantes.uva.es>

Julius Marminge committed Nov 20, 2026 at 15:55 UTC a8f5237a3c85a04b43cf12fe5d43644f41ae5eaf
3 files changed +18 -5
apps/web/src/components/pullRequest/PullRequestDetailCrumbs.tsx
+8 -2
@@ -6,7 +6,6 @@ import type { MouseEvent as ReactMouseEvent } from "react";
6
7 import { useOpenLink } from "~/browser/useOpenLink";
8 import { cn } from "~/lib/utils";
9 -import { readLocalApi } from "~/localApi";
9 import { Button } from "../ui/button";
10 import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
11 import { openOnHostLabel, showPullRequestLinkContextMenu } from "./pullRequestLinkContextMenu";
@@ -132,6 +131,7 @@ export function PullRequestDetailCrumbs({
131 onBack: (() => void) | undefined;
132 }) {
133 const gt = useGT();
134 + const openLink = useOpenLink(threadRef);
135 const ready = detail !== null && toneClassName !== null;
136 return (
137 <div className="pl-4 grid h-7 min-w-0 items-center overflow-hidden">
@@ -155,7 +155,13 @@ export function PullRequestDetailCrumbs({
155 repositoryUrl ? (
156 <button
157 type="button"
158 - onClick={() => void readLocalApi()?.shell.openExternal(repositoryUrl)}
158 + onClick={(event) =>
159 + void openLink(repositoryUrl, { event }).catch(console.error)
160 + }
161 + onAuxClick={(event) => {
162 + if (event.button === 1)
163 + void openLink(repositoryUrl, { event }).catch(console.error);
164 + }}
165 className="min-w-0 cursor-pointer truncate text-left font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline"
166 >
167 {detail.repository}
apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx
+1
@@ -1529,6 +1529,7 @@ export function PullRequestDetailPanel({
1529 number={reference.number}
1530 tabs={visibleTabs}
1531 activeTab={tab}
1532 + threadRef={threadRef}
1533 {...(onBack ? { onBack } : {})}
1534 {...(onClose ? { onClose } : {})}
1535 actions={
apps/web/src/components/pullRequest/PullRequestGhosts.tsx
+9 -3
@@ -1,4 +1,4 @@
1 -import type { PullRequestListEntry, PullRequestSummary } from "@t3tools/contracts";
1 +import type { PullRequestListEntry, PullRequestSummary, ScopedThreadRef } from "@t3tools/contracts";
2 import {
3 ArrowLeftIcon,
4 ChevronRightIcon,
@@ -16,7 +16,7 @@ import {
16 type ChangeRequestTerminology,
17 } from "@t3tools/client-runtime/source-control-clients";
18
19 -import { readLocalApi } from "~/localApi";
19 +import { useOpenLink } from "~/browser/useOpenLink";
20 import { cn } from "~/lib/utils";
21 import { RelativeTime } from "~/components/RelativeTime";
22
@@ -93,6 +93,7 @@ export function PullRequestDetailGhost({
93 onBack,
94 onClose,
95 onCheckoutError,
96 + threadRef = null,
97 }: {
98 seed?: PullRequestListEntry | null;
99 summary?: PullRequestSummary | null;
@@ -104,9 +105,11 @@ export function PullRequestDetailGhost({
105 onBack?: (() => void) | undefined;
106 onClose?: (() => void) | undefined;
107 onCheckoutError?: ((error: Error) => void) | undefined;
108 + threadRef?: ScopedThreadRef | null | undefined;
109 }) {
110 const gt = useGT();
111 const resolve = useMessages();
112 + const openLink = useOpenLink(threadRef);
113 const tabs = requestedTabs ?? resolveFilterOptions(DEFAULT_DETAIL_TABS, resolve);
114 const seed = summary
115 ? {
@@ -165,7 +168,10 @@ export function PullRequestDetailGhost({
168 <>
169 <span className="min-w-0 truncate font-medium">{seed.repository}</span>
170 <InlineButton
168 - onClick={() => void readLocalApi()?.shell.openExternal(seed.url)}
171 + onClick={(event) => void openLink(seed.url, { event }).catch(console.error)}
172 + onAuxClick={(event) => {
173 + if (event.button === 1) void openLink(seed.url, { event }).catch(console.error);
174 + }}
175 aria-label={gt(
176 "Open {term, select, mr {merge request} cr {change request} other {pull request}} #{number} on host",
177 {