@devries-cameron20 / t3code Mirror · read-only / commits / a96bb81049
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, 12:15 UTC

perf(right panel): normalize pr tab target once (#37002)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

Rohan Godha committed Nov 14, 2026 at 21:10 UTC a96bb8104973a8eb81904b67c5be2eb2fb920785
2 files changed +9 -14
apps/web/src/components/RightPanelTabs.tsx
+3 -8
@@ -739,18 +739,13 @@ export function resolvePullRequestTabLink(
739 reference: { repository: string; number: number },
740 ) {
741 if (environmentId === null || host === null) return undefined;
742 + // Keys are cached per object, so one target normalizes once instead of once per link.
743 + const target = { host, repository: reference.repository, number: reference.number };
744 let newest: EnvironmentThreadShell["pullRequests"][number] | undefined;
745 for (const thread of threads) {
746 if (thread.environmentId !== environmentId) continue;
747 for (const link of visibleThreadPullRequests(thread.pullRequests)) {
746 - if (
747 - !threadPullRequestKeysEqual(link, {
748 - host,
749 - repository: reference.repository,
750 - number: reference.number,
751 - })
752 - )
753 - continue;
748 + if (!threadPullRequestKeysEqual(link, target)) continue;
749 if (
750 newest === undefined ||
751 (link.snapshot?.syncedAt ?? "") > (newest.snapshot?.syncedAt ?? "")
apps/web/src/components/pullRequest/pullRequestDetail.logic.ts
+6 -6
@@ -201,13 +201,13 @@ export function pullRequestPanelContext(
201 const links = visibleThreadPullRequests(thread.pullRequests ?? []);
202 if (links.length > 0) {
203 const repository = surface.repository.toLowerCase();
204 + const target =
205 + surface.host === undefined
206 + ? null
207 + : { host: surface.host, repository: surface.repository, number: surface.number };
208 return links.some((link) =>
205 - surface.host !== undefined
206 - ? threadPullRequestKeysEqual(link, {
207 - host: surface.host,
208 - repository: surface.repository,
209 - number: surface.number,
210 - })
209 + target !== null
210 + ? threadPullRequestKeysEqual(link, target)
211 : link.number === surface.number && link.repository.toLowerCase() === repository,
212 )
213 ? "thread"