Skip to content

Commit 6361523

Browse files
juliusmarmingecodex
andcommitted
fix(web): clear displayed PR when thread branch clears
Co-authored-by: codex <[email protected]>
1 parent 3538e19 commit 6361523

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

‎apps/web/src/components/ThreadStatusIndicators.test.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,22 @@ describe("resolveDisplayedThreadPr + nextThreadChangeRequestSnapshot", () => {
337337
retainTerminalOnBranchMismatch: true,
338338
}),
339339
).toBeNull();
340+
expect(
341+
resolveDisplayedThreadPr({
342+
threadBranch: null,
343+
gitStatus: status({ refName: "main", pr: null }),
344+
snapshot: terminalSnapshot,
345+
retainTerminalOnBranchMismatch: true,
346+
}),
347+
).toBeNull();
348+
expect(
349+
resolveDisplayedThreadPrProvider({
350+
threadBranch: null,
351+
gitStatus: status({ refName: "main", pr: null }),
352+
snapshot: terminalSnapshot,
353+
retainTerminalOnBranchMismatch: true,
354+
}),
355+
).toBeUndefined();
340356
});
341357

342358
it("does not erase a terminal snapshot when VCS data is missing", () => {

‎apps/web/src/components/ThreadStatusIndicators.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ export function resolveDisplayedThreadPr(input: {
261261
}
262262

263263
if (
264+
threadBranch !== null &&
264265
retainTerminalOnBranchMismatch &&
265266
snapshot != null &&
266267
isTerminalChangeRequestState(snapshot.pr.state)
@@ -288,6 +289,7 @@ export function resolveDisplayedThreadPrProvider(input: {
288289
}
289290

290291
if (
292+
threadBranch !== null &&
291293
retainTerminalOnBranchMismatch &&
292294
snapshot != null &&
293295
isTerminalChangeRequestState(snapshot.pr.state)

0 commit comments

Comments
 (0)