feat(pull-requests): link multiple pull requests to threads (#10839)

This commit is contained in:
Julius Marminge authored and GitHub committed 2026-09-09 15:50:58 -07:00
1 parent 383cc40f4d
commit afb84898be
172 files changed
+12063 -914

No files matched your search

+9 -1
View File
@@ -1,3 +1,7 @@
import type { ThreadPullRequestLink } from "@t3tools/contracts";
import { resolveThreadCurrentPullRequestLink } from "./threadPullRequests.ts";
export interface ThreadReferenceCopyTarget {
readonly kind: "pull-request" | "thread";
readonly value: string;
@@ -10,10 +14,14 @@ export function resolveThreadReferenceCopyTarget(input: {
readonly threadId: string;
/** Undefined means no PR panel; null means its URL is not available yet. */
readonly openPanelPullRequestUrl?: string | null | undefined;
readonly pullRequests?: ReadonlyArray<ThreadPullRequestLink> | undefined;
readonly linkedPullRequestUrl?: string | null;
}): ThreadReferenceCopyTarget | null {
if (input.openPanelPullRequestUrl === null) return null;
const pullRequestUrl = input.openPanelPullRequestUrl ?? input.linkedPullRequestUrl;
const pullRequestUrl =
input.openPanelPullRequestUrl ??
resolveThreadCurrentPullRequestLink(input.pullRequests ?? [])?.url ??
input.linkedPullRequestUrl;
return pullRequestUrl
? {
kind: "pull-request",