authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-14 23:04:34-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-02-14 23:35:48-08:00
logb5149f595962b51bf237a4de4a43e3cd4e450272
tree3064793777c7bb1359d19c782e08f80293440d9a
parentea661fb635f66860d4c03e2c518bc29db2383d68

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

1 files changed, 15 insertions(+), 3 deletions(-)

apps/web/src/components/GitActionsControl.tsx+15-3
......@@ -271,6 +271,9 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
271271 (action === "commit_push" || action === "commit_push_pr") && !!prUrl;
272272 const shouldOfferCreatePrCta =
273273 action === "commit_push" && !prUrl && result.push.status === "pushed";
274 const closeResultToast = () => {
275 toastManager.close(progressToastId);
276 };
274277
275278 toastManager.update(progressToastId, {
276279 type: "success",
......@@ -281,21 +284,30 @@ export default function GitActionsControl({ api, gitCwd }: GitActionsControlProp
281284 ? {
282285 actionProps: {
283286 children: "Push",
284 onClick: () => void runGitActionWithToast({ action: "commit_push" }),
287 onClick: () => {
288 closeResultToast();
289 void runGitActionWithToast({ action: "commit_push" });
290 },
285291 },
286292 }
287293 : shouldOfferOpenPrCta
288294 ? {
289295 actionProps: {
290296 children: "Open PR",
291 onClick: () => void api?.shell.openExternal(prUrl),
297 onClick: () => {
298 closeResultToast();
299 void api?.shell.openExternal(prUrl);
300 },
292301 },
293302 }
294303 : shouldOfferCreatePrCta
295304 ? {
296305 actionProps: {
297306 children: "Create PR",
298 onClick: () => setActiveDialogAction("create_pr"),
307 onClick: () => {
308 closeResultToast();
309 setActiveDialogAction("create_pr");
310 },
299311 },
300312 }
301313 : {}),