authorgravatar for maria@kuuro.netmaria <maria@kuuro.net> 2026-10-09 15:47:53-03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-09 15:47:53-03:00
logaa8c6662e212a4307bd4e585661da99a358e46d4
tree482c56bfd799e48001016f3d1f8333805886ed8c
parent64972461c0606a4eafdd3cd08056155b6a2fea95
signature Signed by PGP key B5690EEEBB952194

fix(web): pr merge actions stay visible while the stack refreshes (#17559)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>

3 files changed, 12 insertions(+), 4 deletions(-)

apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx+1-1
......@@ -823,7 +823,7 @@ export function PullRequestDetailPanel({
823823 const canMergeSinglePullRequest = allowsSinglePullRequestMerge({
824824 supportsStackActions,
825825 hasStack: nativeStack !== null,
826 stackPending: !nativeStackQuery.isSuccess || nativeStackQuery.isPending,
826 stackPending: !nativeStackQuery.isFresh,
827827 stackError: nativeStackQuery.error,
828828 });
829829 const activityPending = activityQuery.isPending && activity === null;
apps/web/src/components/pullRequest/pullRequestStackSnapshot.test.ts+5-1
......@@ -88,6 +88,10 @@ describe("saved stack navigation", () => {
8888 isFresh: true,
8989 notice: null,
9090 });
91 expect(pullRequestStackView({ ...query, isPending: true }, saved).isFresh).toBe(false);
91 expect(pullRequestStackView({ ...query, isPending: true }, saved).isFresh).toBe(true);
92 expect(pullRequestStackView({ ...query, data: null, isPending: true }, saved)).toMatchObject({
93 data: null,
94 isFresh: true,
95 });
9296 });
9397});
apps/web/src/components/pullRequest/pullRequestStackSnapshot.ts+6-2
......@@ -47,7 +47,11 @@ export function savedPullRequestStack(
4747 };
4848}
4949
50/** A fresh absence overrides saved membership; failed refreshes preserve available navigation. */
50/**
51 * A fresh absence overrides saved membership; failed refreshes preserve available navigation.
52 * A background refresh keeps the last successful lookup fresh, so stack-dependent actions do
53 * not blink out every time the detail revalidates.
54 */
5155export function pullRequestStackView(
5256 query: {
5357 data: PullRequestStack | null;
......@@ -60,7 +64,7 @@ export function pullRequestStackView(
6064 const data = query.isSuccess ? query.data : (query.data ?? saved);
6165 return {
6266 data,
63 isFresh: query.isSuccess && !query.isPending,
67 isFresh: query.isSuccess,
6468 notice:
6569 data === null
6670 ? null