From b5149f595962b51bf237a4de4a43e3cd4e450272 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sat, 14 Feb 2026 23:04:34 -0800 Subject: [PATCH] Close git action toast before triggering follow-up action - Dismiss the success toast before handling Push/Open PR/Create PR CTA clicks - Prevent stale result toasts from lingering while starting the next git action --- apps/web/src/components/GitActionsControl.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx index 6d900b08a3fdb2980b9c8c71a2e3ef69852e8870..9e35e618e9b1e8575d981e8631e4c81e603b7de6 100644 --- a/apps/web/src/components/GitActionsControl.tsx +++ b/apps/web/src/components/GitActionsControl.tsx @@ -271,6 +271,9 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp (action === "commit_push" || action === "commit_push_pr") && !!prUrl; const shouldOfferCreatePrCta = action === "commit_push" && !prUrl && result.push.status === "pushed"; + const closeResultToast = () => { + toastManager.close(progressToastId); + }; toastManager.update(progressToastId, { type: "success", @@ -281,21 +284,30 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp ? { actionProps: { children: "Push", - onClick: () => void runGitActionWithToast({ action: "commit_push" }), + onClick: () => { + closeResultToast(); + void runGitActionWithToast({ action: "commit_push" }); + }, }, } : shouldOfferOpenPrCta ? { actionProps: { children: "Open PR", - onClick: () => void api?.shell.openExternal(prUrl), + onClick: () => { + closeResultToast(); + void api?.shell.openExternal(prUrl); + }, }, } : shouldOfferCreatePrCta ? { actionProps: { children: "Create PR", - onClick: () => setActiveDialogAction("create_pr"), + onClick: () => { + closeResultToast(); + setActiveDialogAction("create_pr"); + }, }, } : {}), -- 2.54.0