authorgravatar for 97427849+flamboh@users.noreply.github.comoliver <97427849+flamboh@users.noreply.github.com> 2026-10-08 11:39:47-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-08 11:39:47-07:00
logeb1cf7bd0efba7364d53907036f5b7eefb379c39
treed6cc2b5a690452cbf9d39999b43111164bbc784f
parentde72286ee5777319fde054e7a82023916ce6f481
signature Signed by PGP key B5690EEEBB952194

fix(web): stack merge dialog closes as soon as you confirm (#17116)


1 files changed, 13 insertions(+), 9 deletions(-)

apps/web/src/components/pullRequest/PullRequestStackMenu.tsx+13-9
......@@ -87,6 +87,11 @@ export function PullRequestStackMenu({
8787 layer.headSha ? [{ number: layer.number, headSha: layer.headSha }] : [],
8888 );
8989 setPending(true);
90 setConfirmation(null);
91 const toastId = toastManager.add({
92 type: "loading",
93 title: action === "merge" ? "Merging stack..." : "Rebasing stack...",
94 });
9095 const result = await runAction({
9196 environmentId,
9297 input: {
......@@ -99,16 +104,15 @@ export function PullRequestStackMenu({
99104 },
100105 });
101106 setPending(false);
102 setConfirmation(null);
103107 onActed();
104108 if (result._tag === "Failure") {
105 toastManager.add({
109 toastManager.update(toastId, {
106110 type: "error",
107 title: "Stack operation did not complete",
111 title: action === "merge" ? "Could not merge the stack" : "Could not rebase the stack",
108112 description: String(squashAtomCommandFailure(result)),
109113 });
110114 } else {
111 toastManager.add({
115 toastManager.update(toastId, {
112116 type: "success",
113117 title: action === "merge" ? "Stack merge request completed" : "Stack rebased",
114118 description:
......@@ -216,10 +220,10 @@ export function PullRequestStackMenu({
216220 <Dialog
217221 open={confirmation !== null}
218222 onOpenChange={(value) => {
219 if (!value && !pending) setConfirmation(null);
223 if (!value) setConfirmation(null);
220224 }}
221225 >
222 <DialogPopup className="max-w-md" showCloseButton={!pending}>
226 <DialogPopup className="max-w-md">
223227 <DialogHeader>
224228 <DialogTitle>
225229 {confirmation === "merge"
......@@ -245,11 +249,11 @@ export function PullRequestStackMenu({
245249 </ul>
246250 </DialogPanel>
247251 <DialogFooter>
248 <Button variant="outline" disabled={pending} onClick={() => setConfirmation(null)}>
252 <Button variant="outline" onClick={() => setConfirmation(null)}>
249253 Cancel
250254 </Button>
251 <Button disabled={pending} onClick={() => void run()}>
252 {pending ? "Working…" : confirmation === "merge" ? "Merge stack" : "Rebase stack"}
255 <Button onClick={() => void run()}>
256 {confirmation === "merge" ? "Merge stack" : "Rebase stack"}
253257 </Button>
254258 </DialogFooter>
255259 </DialogPopup>