Scope git action progress toasts to the originating thread#1675
Scope git action progress toasts to the originating thread#1675juliusmarminge wants to merge 2 commits intomainfrom
Conversation
- Pin progress toast data to the thread that started the action - Preserve the in-flight action callback across thread switches - Add a regression test for scoped toast updates - Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
- Remove ref indirection for runGitActionWithToast - Call the effect event directly from pending and dialog flows - Keep toast-triggered git actions working with less state plumbing
ApprovabilityVerdict: Approved This is a focused bug fix ensuring git action progress toasts remain associated with the thread that initiated them, even when users switch threads mid-operation. The change is well-scoped with comprehensive test coverage validating the new behavior. You can customize Macroscope's approvability policy. Learn more. |
Summary
ThreadToastDatafor reuse and add a browser regression test covering the thread-scoped toast behavior.Testing
apps/web/src/components/GitActionsControl.browser.tsxto verify an in-flight git action toast remains pinned to the thread that started it.Note
Low Risk
UI-only toast-scoping and callback refactoring with a focused regression test; no changes to git operations, auth, or data persistence logic.
Overview
Git action progress/result toasts are now thread-scoped at action start:
GitActionsControlsnapshotsthreadToastDataintoscopedToastDataand stores it on the active progress ref so subsequenttoastManager.update/error/success updates don’t retarget when the active thread changes.Follow-up actions triggered from toast CTAs are routed through a stable
useEffectEventreference, and a newGitActionsControl.browser.tsxtest verifies an in-flight “Push & create PR” toast remains pinned to the originating thread after switching threads.ThreadToastDatais exported fromtoast.tsxfor reuse.Written by Cursor Bugbot for commit 2b6fe2a. This will update automatically on new commits. Configure here.
Note
Scope git action progress toasts to the thread active at action start
Previously, toast updates during a git action (loading, success, error) used the currently active thread, so switching threads mid-action would mis-scope the toasts. Now,
threadToastData(includingthreadId) is captured asscopedToastDatawhen the action starts and used for all subsequent updates regardless of thread changes.toastDatafield toActiveGitActionProgressto store the captured snapshot for use byupdateActiveProgressToast.useCallbackmemoization from several internal handlers in GitActionsControl.tsx in favor of plainconstfunctions.ThreadToastDatafrom toast.tsx and adds browser tests in GitActionsControl.browser.tsx verifying toast scoping across thread switches.Macroscope summarized 2b6fe2a.