From eb1cf7bd0efba7364d53907036f5b7eefb379c39 Mon Sep 17 00:00:00 2001 From: oliver <97427849+flamboh@users.noreply.github.com> Date: Thu, 8 Oct 2026 11:39:47 -0700 Subject: [PATCH] fix(web): stack merge dialog closes as soon as you confirm (#17116) --- .../pullRequest/PullRequestStackMenu.tsx | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/apps/web/src/components/pullRequest/PullRequestStackMenu.tsx b/apps/web/src/components/pullRequest/PullRequestStackMenu.tsx index 61eeed0f0f3271b1eabc689f6044aba3ad54cc29..ff8e886d14afccc36db2f7ae259cd261c0eff3ac 100644 --- a/apps/web/src/components/pullRequest/PullRequestStackMenu.tsx +++ b/apps/web/src/components/pullRequest/PullRequestStackMenu.tsx @@ -87,6 +87,11 @@ export function PullRequestStackMenu({ layer.headSha ? [{ number: layer.number, headSha: layer.headSha }] : [], ); setPending(true); + setConfirmation(null); + const toastId = toastManager.add({ + type: "loading", + title: action === "merge" ? "Merging stack..." : "Rebasing stack...", + }); const result = await runAction({ environmentId, input: { @@ -99,16 +104,15 @@ export function PullRequestStackMenu({ }, }); setPending(false); - setConfirmation(null); onActed(); if (result._tag === "Failure") { - toastManager.add({ + toastManager.update(toastId, { type: "error", - title: "Stack operation did not complete", + title: action === "merge" ? "Could not merge the stack" : "Could not rebase the stack", description: String(squashAtomCommandFailure(result)), }); } else { - toastManager.add({ + toastManager.update(toastId, { type: "success", title: action === "merge" ? "Stack merge request completed" : "Stack rebased", description: @@ -216,10 +220,10 @@ export function PullRequestStackMenu({ { - if (!value && !pending) setConfirmation(null); + if (!value) setConfirmation(null); }} > - + {confirmation === "merge" @@ -245,11 +249,11 @@ export function PullRequestStackMenu({ - - -- 2.54.0