GeezerVison is showing github.com — fix(web): PR links jump to the comment, diff line, checks or commits … · pingdotgg/t3code@694903b
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/PullRequestDiscussionScreen.tsx +30-2Lines changed: 30 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +import { | | 2 | + parsePullRequestAnchor, | | 3 | + pullRequestAnchorMatchesUrl, | | 4 | +} from "@t3tools/shared/pullRequestAnchor"; | 1 | 5 | import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator"; | 2 | 6 | import { useAtomRefresh } from "@effect/atom-react"; | 3 | 7 | import { useFocusEffect, useNavigation, type StaticScreenProps } from "@react-navigation/native"; | @@ -8,7 +12,7 @@ import { | 8 | 12 | import { AsyncResult } from "effect/reactivity"; | 9 | 13 | import type { PullRequestThreadComment } from "@t3tools/contracts"; | 10 | 14 | import { useRef, useState } from "react"; | 11 | | -import { ScrollView, View } from "react-native"; | | 15 | +import { ScrollView, View, type ScrollViewInstance } from "react-native"; | 12 | 16 | import { KeyboardAvoidingView, useKeyboardState } from "react-native-keyboard-controller"; | 13 | 17 | import { NativeScrollViewMarker as ScrollViewMarker } from "../../native/NativeScrollViewMarker"; | 14 | 18 | import { useSafeAreaInsets } from "react-native-safe-area-context"; | @@ -138,6 +142,10 @@ function Discussion({ params }: { params: PullRequestParams & { readonly discuss | 138 | 142 | [...extra, ...(thread?.comments ?? [])].map((comment) => [comment.id, comment]), | 139 | 143 | ).values(), | 140 | 144 | ].sort((left, right) => left.createdAt.localeCompare(right.createdAt)); | | 145 | + const scrollRef = useRef<ScrollViewInstance>(null); | | 146 | + const pendingTop = useRef<number | null>(null); | | 147 | + const positionedComment = useRef<string | null>(null); | | 148 | + const anchor = parsePullRequestAnchor(params.navigationUrl); | 141 | 149 | const canReply = permissions.canReply && Boolean(thread); | 142 | 150 | const resolveLabel = thread?.isResolved ? "Unresolve" : "Resolve"; | 143 | 151 | return ( | @@ -162,6 +170,12 @@ function Discussion({ params }: { params: PullRequestParams & { readonly discuss | 162 | 170 | /> | 163 | 171 | <ScrollViewMarker style={{ flex: 1 }}> | 164 | 172 | <ScrollView | | 173 | + ref={scrollRef} | | 174 | + onContentSizeChange={() => { | | 175 | + if (pendingTop.current === null) return; | | 176 | + scrollRef.current?.scrollTo({ y: pendingTop.current, animated: false }); | | 177 | + pendingTop.current = null; | | 178 | + }} | 165 | 179 | className="flex-1" | 166 | 180 | contentInsetAdjustmentBehavior="automatic" | 167 | 181 | keyboardShouldPersistTaps="handled" | @@ -192,7 +206,21 @@ function Discussion({ params }: { params: PullRequestParams & { readonly discuss | 192 | 206 | <Text>This discussion is no longer available.</Text> | 193 | 207 | ) : null} | 194 | 208 | {comments.map((comment) => ( | 195 | | - <View key={comment.id} className="gap-3 border-b border-border-subtle py-4"> | | 209 | + <View | | 210 | + key={comment.id} | | 211 | + onLayout={(event) => { | | 212 | + if ( | | 213 | + anchor?.kind !== "timeline" || | | 214 | + !pullRequestAnchorMatchesUrl(anchor.anchor, comment.url) || | | 215 | + positionedComment.current === comment.id | | 216 | + ) | | 217 | + return; | | 218 | + positionedComment.current = comment.id; | | 219 | + pendingTop.current = event.nativeEvent.layout.y; | | 220 | + scrollRef.current?.scrollTo({ y: pendingTop.current, animated: false }); | | 221 | + }} | | 222 | + className="gap-3 border-b border-border-subtle py-4" | | 223 | + > | 196 | 224 | <View className="flex-row items-center gap-2"> | 197 | 225 | <PullRequestAvatar actor={comment.author} size={28} /> | 198 | 226 | <Text className="min-w-0 flex-1 text-sm font-t3-medium"> | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx +113-7Lines changed: 113 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +import { | | 2 | + parsePullRequestAnchor, | | 3 | + pullRequestAnchorMatchesUrl, | | 4 | + pullRequestDiffPathMatches, | | 5 | + pullRequestLinkCommit, | | 6 | +} from "@t3tools/shared/pullRequestAnchor"; | 1 | 7 | import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator"; | 2 | 8 | import { Chip } from "../../components/ui/Chip"; | 3 | 9 | import { pullRequestTabOffset } from "./pullRequestTabScroll"; | @@ -154,8 +160,25 @@ function usePullRequestActivityRows(params: PullRequestParams, filter: ActivityF | 154 | 160 | }); | 155 | 161 | return rows; | 156 | 162 | })(); | | 163 | + const location = parsePullRequestAnchor(params.navigationUrl); | | 164 | + const anchor = location?.kind === "timeline" ? location.anchor : null; | | 165 | + const targetComment = anchor | | 166 | + ? result.data?.comments.find((comment) => pullRequestAnchorMatchesUrl(anchor, comment.url)) | | 167 | + : null; | | 168 | + const targetThread = anchor | | 169 | + ? result.data?.reviewThreads.find((thread) => | | 170 | + thread.comments.some((comment) => pullRequestAnchorMatchesUrl(anchor, comment.url)), | | 171 | + ) | | 172 | + : null; | | 173 | + const targetKey = targetThread | | 174 | + ? `discussion:${targetThread.id}` | | 175 | + : targetComment | | 176 | + ? `comment:${targetComment.id}` | | 177 | + : null; | 157 | 178 | return { | 158 | 179 | rows, | | 180 | + targetKey, | | 181 | + targetThread, | 159 | 182 | hiddenCount: filtered?.hiddenCount ?? 0, | 160 | 183 | pending: result.isPending && !result.data, | 161 | 184 | error: result.error, | @@ -334,7 +357,10 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP | 334 | 357 | const params = route.params; | 335 | 358 | usePullRequestEnvironmentFallback(params); | 336 | 359 | const connected = usePullRequestConnected(params.environmentId); | 337 | | - const [chosenSection, setSection] = useState<"overview" | "activity" | "guide">("overview"); | | 360 | + const [chosenSection, setSection] = useState<"overview" | "activity" | "guide">(() => { | | 361 | + const kind = parsePullRequestAnchor(params.navigationUrl)?.kind; | | 362 | + return kind === "timeline" || kind === "commits" ? "activity" : "overview"; | | 363 | + }); | 338 | 364 | const requestedSection = useRef(chosenSection); | 339 | 365 | const [listAnimationsReady, setListAnimationsReady] = useState(false); | 340 | 366 | const [descriptionExpanded, setDescriptionExpanded] = useState(false); | @@ -345,7 +371,14 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP | 345 | 371 | const shown = (tab: typeof chosenSection) => | 346 | 372 | !guidesEnabled && tab === "guide" ? "overview" : tab; | 347 | 373 | const section = shown(chosenSection); | 348 | | - const [activityFilter, setActivityFilter] = useState<ActivityFilter>(DEFAULT_ACTIVITY_FILTER); | | 374 | + const [activityFilter, setActivityFilter] = useState<ActivityFilter>(() => { | | 375 | + const kind = parsePullRequestAnchor(params.navigationUrl)?.kind; | | 376 | + return kind === "timeline" | | 377 | + ? { ...DEFAULT_ACTIVITY_FILTER, bots: true, resolved: true } | | 378 | + : kind === "commits" | | 379 | + ? { ...DEFAULT_ACTIVITY_FILTER, kind: "commits" } | | 380 | + : DEFAULT_ACTIVITY_FILTER; | | 381 | + }); | 349 | 382 | const activityContent = usePullRequestActivityRows(params, activityFilter); | 350 | 383 | const scrollOffsets = useRef<Record<string, number>>({}); | 351 | 384 | // The offset of the tab last shown, and which tab that was: a tab standing in for a hidden guide | @@ -386,6 +419,58 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP | 386 | 419 | scrollViews.current[next]?.scrollToOffset({ offset, animated: false }); | 387 | 420 | setSection(next); | 388 | 421 | }; | | 422 | + const followLink = useEffectEvent(() => { | | 423 | + const target = parsePullRequestAnchor(params.navigationUrl); | | 424 | + if (target?.kind === "diff" || target?.kind === "code") { | | 425 | + const commit = pullRequestLinkCommit(params.navigationUrl); | | 426 | + navigation.navigate("PullRequestFile", { | | 427 | + ...params, | | 428 | + path: "", | | 429 | + ...(commit ? { commit } : {}), | | 430 | + }); | | 431 | + } else if (target?.kind === "timeline") { | | 432 | + selectSection("activity"); | | 433 | + setActivityFilter((filter) => ({ ...filter, kind: "all", bots: true, resolved: true })); | | 434 | + } else if (target?.kind === "commits") { | | 435 | + selectSection("activity"); | | 436 | + setActivityFilter((filter) => ({ ...filter, kind: "commits" })); | | 437 | + } else if (target?.kind === "checks" || target?.kind === "summary") { | | 438 | + selectSection("overview"); | | 439 | + } | | 440 | + }); | | 441 | + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- a link selects its native PR section or diff even when the route is reused | | 442 | + useEffect(() => { | | 443 | + // oxlint-disable-next-line react/set-state-in-effect -- URL navigation selects the PR section and makes its target visible | | 444 | + followLink(); | | 445 | + // oxlint-disable-next-line react/exhaustive-effect-dependencies -- each clicked URL is a fresh navigation request | | 446 | + }, [params.navigationUrl, params.navigationId]); | | 447 | + | | 448 | + const activityTargetIndex = activityContent.rows.findIndex( | | 449 | + (row) => row.key === activityContent.targetKey, | | 450 | + ); | | 451 | + const openedDiscussion = useRef<string | null>(null); | | 452 | + const revealActivity = useEffectEvent(() => { | | 453 | + const key = `${params.navigationUrl}:${params.navigationId ?? 0}`; | | 454 | + if (activityContent.targetThread && openedDiscussion.current !== key) { | | 455 | + openedDiscussion.current = key; | | 456 | + navigation.navigate("PullRequestDiscussion", { | | 457 | + ...params, | | 458 | + discussionId: activityContent.targetThread.id, | | 459 | + }); | | 460 | + return; | | 461 | + } | | 462 | + if (activityTargetIndex >= 0) | | 463 | + void scrollViews.current.activity?.scrollToIndex({ | | 464 | + index: activityTargetIndex + 1, | | 465 | + viewPosition: 0.5, | | 466 | + animated: false, | | 467 | + }); | | 468 | + }); | | 469 | + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- reveals the requested activity once its asynchronous rows arrive | | 470 | + useEffect(() => { | | 471 | + revealActivity(); | | 472 | + // oxlint-disable-next-line react/exhaustive-effect-dependencies -- repositions when asynchronous activity resolves the URL target | | 473 | + }, [params.navigationUrl, params.navigationId, activityTargetIndex]); | 389 | 474 | const tabContent = activityContent; | 390 | 475 | const filesY = useRef(0); | 391 | 476 | const descriptionY = useRef(0); | @@ -848,9 +933,15 @@ function PullRequestFileRouteContent({ route }: PullRequestFileRouteProps) { | 848 | 933 | (detail.data ?? route.params.initialSummary)?.provider, | 849 | 934 | ).changeRequest; | 850 | 935 | const result = usePullRequestDiff(route.params, terminology); | | 936 | + const linkAnchor = parsePullRequestAnchor(route.params.navigationUrl); | | 937 | + const linkPath = | | 938 | + linkAnchor?.kind === "diff" && result.parsed.kind === "files" | | 939 | + ? result.parsed.files.find((file) => pullRequestDiffPathMatches(linkAnchor.digest, file.path)) | | 940 | + ?.path | | 941 | + : undefined; | 851 | 942 | const filter = usePullRequestFileFilter( | 852 | 943 | result.parsed, | 853 | | - route.params.focus ? route.params.path : undefined, | | 944 | + linkPath ?? (route.params.focus ? route.params.path : undefined), | 854 | 945 | ); | 855 | 946 | const { refresh: refreshDetail } = detail; | 856 | 947 | useFocusEffect(refreshDetail); | @@ -922,15 +1013,30 @@ function PullRequestFileRouteContent({ route }: PullRequestFileRouteProps) { | 922 | 1013 | code: row.content ?? "", | 923 | 1014 | }); | 924 | 1015 | }; | 925 | | - const [jumpPath, setJumpPath] = useState(route.params.path); | | 1016 | + const [pickedPath, setJumpPath] = useState<string | null>(null); | | 1017 | + const jumpPath = pickedPath ?? linkPath ?? route.params.path; | 926 | 1018 | const requestedFile = | 927 | 1019 | result.parsed.kind === "files" | 928 | 1020 | ? result.parsed.files.find((file) => file.path === jumpPath) | 929 | 1021 | : undefined; | 930 | 1022 | const targetFile = | 931 | 1023 | data.files.find((file) => file.path === jumpPath) ?? | 932 | | - (!jumpPath || requestedFile ? data.files[0] : undefined); | 933 | | - const focus = route.params.focus; | | 1024 | + (linkAnchor?.kind === "diff" && !linkPath | | 1025 | + ? undefined | | 1026 | + : !jumpPath || requestedFile | | 1027 | + ? data.files[0] | | 1028 | + : undefined); | | 1029 | + const range = pickedPath === null && linkAnchor?.kind === "diff" ? linkAnchor.range : null; | | 1030 | + const focus = | | 1031 | + route.params.focus ?? | | 1032 | + (range | | 1033 | + ? { | | 1034 | + side: range.side === "left" ? ("old" as const) : ("new" as const), | | 1035 | + start: range.start, | | 1036 | + end: range.end, | | 1037 | + endSide: range.endSide === "left" ? ("old" as const) : ("new" as const), | | 1038 | + } | | 1039 | + : undefined); | 934 | 1040 | const focusedRows = guideFocusedRows(data.rows, targetFile?.id, focus); | 935 | 1041 | const focusIndex = focusedRows.length | 936 | 1042 | ? data.rows.findIndex((row) => row.id === focusedRows[0]?.id) | @@ -941,7 +1047,7 @@ function PullRequestFileRouteContent({ route }: PullRequestFileRouteProps) { | 941 | 1047 | // The filter the current jump was made under. Hiding or showing test files replaces the rows, | 942 | 1048 | // so a jump made under the other filter has to run again. Native applies the entry | 943 | 1049 | // destination before its first viewport, so the first one counts as made. | 944 | | - const jumpedUnder = useRef<boolean | null>(filter.hideTestFiles); | | 1050 | + const jumpedUnder = useRef<boolean | null>(targetFile ? filter.hideTestFiles : null); | 945 | 1051 | const hasTestFiles = | 946 | 1052 | result.parsed.kind === "files" && | 947 | 1053 | result.parsed.files.some((file) => isTestChangedFile(file.path)); | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/PullRequestStatusRows.tsx +8-1Lines changed: 8 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +import { parsePullRequestAnchor } from "@t3tools/shared/pullRequestAnchor"; | 1 | 2 | import { usePullRequestConnected } from "./usePullRequestConnected"; | 2 | 3 | import { useAtomValue } from "@effect/atom-react"; | 3 | 4 | import { useNavigation } from "@react-navigation/native"; | @@ -102,7 +103,13 @@ export function PullRequestStatusMenu(props: RowProps) { | 102 | 103 | } | 103 | 104 |
| 104 | 105 | export function PullRequestChecksRow(props: RowProps) { | 105 | | - const [expanded, setExpanded] = useState(false); | | 106 | + const linked = parsePullRequestAnchor(props.params.navigationUrl)?.kind === "checks"; | | 107 | + const [expanded, setExpanded] = useState(linked); | | 108 | + const [seenNavigation, setSeenNavigation] = useState(props.params.navigationId); | | 109 | + if (props.params.navigationId !== seenNavigation) { | | 110 | + setSeenNavigation(props.params.navigationId); | | 111 | + if (linked) setExpanded(true); | | 112 | + } | 106 | 113 | const checks = pullRequestChecksSummary(props.pr); | 107 | 114 | const action = usePullRequestAction(props.params, props.pr); | 108 | 115 | const definition = sourceControlClients.get(props.pr.provider); | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/PullRequestTimeline.tsx +22-2Lines changed: 22 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +import { | | 2 | + parsePullRequestAnchor, | | 3 | + pullRequestAnchorMatchesUrl, | | 4 | +} from "@t3tools/shared/pullRequestAnchor"; | 1 | 5 | import { PullRequestEntryRow } from "./PullRequestEntryRow"; | 2 | 6 | import Svg, { Defs, LinearGradient, Rect, Stop } from "react-native-svg"; | 3 | 7 | import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider"; | @@ -74,7 +78,10 @@ function TimelineComment({ | 74 | 78 | params: PullRequestParams; | 75 | 79 | actions: CommentActions; | 76 | 80 | }) { | 77 | | - const [expanded, setExpanded] = useState(false); | | 81 | + const [expanded, setExpanded] = useState(() => { | | 82 | + const target = parsePullRequestAnchor(params.navigationUrl); | | 83 | + return target?.kind === "timeline" && pullRequestAnchorMatchesUrl(target.anchor, comment.url); | | 84 | + }); | 78 | 85 | const { themeVariables: colors } = useAppearancePreferences(); | 79 | 86 | const long = comment.body.length > 450 || comment.body.split("\n").length > 8; | 80 | 87 | const content = useMemo( | @@ -202,6 +209,7 @@ export function pullRequestTimelineRows( | 202 | 209 | navigation: Pick<NavigationProp<ReactNavigation.RootParamList>, "navigate" | "dispatch">, | 203 | 210 | actions: CommentActions, | 204 | 211 | ) { | | 212 | + const linkTarget = parsePullRequestAnchor(params.navigationUrl); | 205 | 213 | const discussionIds = new Set( | 206 | 214 | activity.reviewThreads.flatMap((thread) => thread.comments.map((comment) => comment.id)), | 207 | 215 | ); | @@ -211,7 +219,19 @@ export function pullRequestTimelineRows( | 211 | 219 | .map((comment) => ({ | 212 | 220 | key: `comment:${comment.id}`, | 213 | 221 | date: comment.createdAt, | 214 | | - content: <TimelineComment comment={comment} params={params} actions={actions} />, | | 222 | + content: ( | | 223 | + <TimelineComment | | 224 | + key={ | | 225 | + linkTarget?.kind === "timeline" && | | 226 | + pullRequestAnchorMatchesUrl(linkTarget.anchor, comment.url) | | 227 | + ? `${comment.id}:${params.navigationId ?? params.navigationUrl}` | | 228 | + : comment.id | | 229 | + } | | 230 | + comment={comment} | | 231 | + params={params} | | 232 | + actions={actions} | | 233 | + /> | | 234 | + ), | 215 | 235 | })), | 216 | 236 | ...activity.reviewThreads.map((thread) => ({ | 217 | 237 | key: `discussion:${thread.id}`, | |
Collapse file Copy file name to clipboard +30Lines changed: 30 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +import { expect, it } from "vite-plus/test"; | | 2 | +import type { NativeReviewDiffRow } from "../../diffs/nativeReviewDiffSurface"; | | 3 | +import { guideFocusedRows } from "./guideDiffFocus"; | | 4 | + | | 5 | +it("focuses a range that crosses diff sides in either direction", () => { | | 6 | + const rows: NativeReviewDiffRow[] = [ | | 7 | + { kind: "file", id: "file", fileId: "f" }, | | 8 | + { kind: "line", id: "a", fileId: "f", oldLineNumber: 12 }, | | 9 | + { kind: "line", id: "b", fileId: "f", oldLineNumber: 13 }, | | 10 | + { kind: "line", id: "c", fileId: "f", newLineNumber: 12 }, | | 11 | + { kind: "line", id: "d", fileId: "f", newLineNumber: 13 }, | | 12 | + { kind: "line", id: "other", fileId: "other", newLineNumber: 13 }, | | 13 | + ]; | | 14 | + expect( | | 15 | + guideFocusedRows(rows, "f", { side: "old", start: 12, endSide: "new", end: 13 }).map( | | 16 | + (row) => row.id, | | 17 | + ), | | 18 | + ).toEqual(["a", "b", "c", "d"]); | | 19 | + expect( | | 20 | + guideFocusedRows(rows, "f", { side: "new", start: 13, endSide: "old", end: 12 }).map( | | 21 | + (row) => row.id, | | 22 | + ), | | 23 | + ).toEqual(["a", "b", "c", "d"]); | | 24 | + expect( | | 25 | + guideFocusedRows(rows, "f", { side: "old", start: 12, end: 13 }).map((row) => row.id), | | 26 | + ).toEqual(["a", "b"]); | | 27 | + expect(guideFocusedRows(rows, "f", { side: "old", start: 99, endSide: "new", end: 13 })).toEqual( | | 28 | + [], | | 29 | + ); | | 30 | +}); |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/guide/guideDiffFocus.ts +18Lines changed: 18 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,6 +2,7 @@ import type { NativeReviewDiffRow } from "../../diffs/nativeReviewDiffSurface"; | 2 | 2 |
| 3 | 3 | export type GuideDiffFocus = { | 4 | 4 | readonly side: "old" | "new"; | | 5 | + readonly endSide?: "old" | "new"; | 5 | 6 | readonly start: number; | 6 | 7 | readonly end: number; | 7 | 8 | }; | @@ -12,6 +13,23 @@ export function guideFocusedRows( | 12 | 13 | focus: GuideDiffFocus | undefined, | 13 | 14 | ) { | 14 | 15 | if (!fileId || !focus) return []; | | 16 | + if (focus.endSide && focus.endSide !== focus.side) { | | 17 | + const start = rows.findIndex( | | 18 | + (row) => | | 19 | + row.fileId === fileId && | | 20 | + (focus.side === "old" ? row.oldLineNumber : row.newLineNumber) === focus.start, | | 21 | + ); | | 22 | + const end = rows.findIndex( | | 23 | + (row) => | | 24 | + row.fileId === fileId && | | 25 | + (focus.endSide === "old" ? row.oldLineNumber : row.newLineNumber) === focus.end, | | 26 | + ); | | 27 | + return start < 0 || end < 0 | | 28 | + ? [] | | 29 | + : rows | | 30 | + .slice(Math.min(start, end), Math.max(start, end) + 1) | | 31 | + .filter((row) => row.fileId === fileId && row.kind === "line"); | | 32 | + } | 15 | 33 | return rows.filter((row) => { | 16 | 34 | const line = focus.side === "old" ? row.oldLineNumber : row.newLineNumber; | 17 | 35 | return ( | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/pullRequestNavigation.test.ts +7-1Lines changed: 7 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -34,7 +34,13 @@ describe("native PR entry points", () => { | 34 | 34 | context, | 35 | 35 | projects, | 36 | 36 | ), | 37 | | - ).toEqual({ ...context, host: "github.com", repository: "org/repo", number: 12 }); | | 37 | + ).toEqual({ | | 38 | + ...context, | | 39 | + host: "github.com", | | 40 | + repository: "org/repo", | | 41 | + number: 12, | | 42 | + navigationUrl: "https://github.com/org/repo/pull/12/files#diff", | | 43 | + }); | 38 | 44 | expect( | 39 | 45 | nativePullRequestDestination( | 40 | 46 | "https://git.example/group/sub/repo/-/merge_requests/9", | |
|