Skip to content

Commit d1df036

Browse files
committed
fix(web): normalize pull request loading seeds
1 parent 5e61e63 commit d1df036

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎apps/web/src/components/pullRequest/PullRequestGhosts.tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ export function PullRequestDetailGhost({ seed }: { seed?: PullRequestListEntry |
7777
? resolvePullRequestState({
7878
state: seed.state,
7979
isDraft: seed.isDraft,
80-
mergeability: seed.mergeability,
81-
baseBranch: seed.baseBranch,
8280
})
8381
: null;
8482
const checksPresentation = seed?.checksState

‎apps/web/src/routes/_chat.pull-requests.tsx‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ const EMPTY_TERMINAL_LABELS = new Map<string, string>();
220220
const EMPTY_PENDING_SURFACES = new Set<string>();
221221
const MAX_SEARCH_LABEL_CANDIDATES = 100;
222222

223+
const pullRequestListEntryId = (target: Parameters<typeof pullRequestSurfaceId>[0]) =>
224+
pullRequestSurfaceId({ ...target, repository: target.repository.toLowerCase() });
225+
223226
function pullRequestSearchLabels(raw: unknown): Partial<Pick<PullRequestsSearch, "labels">> {
224227
const values = (Array.isArray(raw) ? raw : typeof raw === "string" ? [raw] : []).slice(
225228
0,
@@ -1440,7 +1443,7 @@ function PullRequestsRouteView() {
14401443
() =>
14411444
new Map(
14421445
displayGroups.flatMap((group) =>
1443-
group.entries.map((entry) => [pullRequestSurfaceId(entry), entry] as const),
1446+
group.entries.map((entry) => [pullRequestListEntryId(entry), entry] as const),
14441447
),
14451448
),
14461449
[displayGroups],
@@ -1948,7 +1951,11 @@ function PullRequestsRouteView() {
19481951
repository: renderedPullRequestSurface.repository,
19491952
number: renderedPullRequestSurface.number,
19501953
}}
1951-
listEntry={listedPullRequestsBySurface.get(renderedPullRequestSurface.id) ?? null}
1954+
listEntry={
1955+
listedPullRequestsBySurface.get(
1956+
pullRequestListEntryId(renderedPullRequestSurface),
1957+
) ?? null
1958+
}
19521959
refreshToken={detailRefreshToken}
19531960
// Merging, closing or reopening changes the row this panel was opened from, so
19541961
// the list behind it is out of date the moment the host takes the action.

0 commit comments

Comments
 (0)