Confirm swarm cancel with a toast (BB-64) - #4111
Conversation
Cancelling a new-swarm setup only navigated back to the swarms list with no acknowledgement, so users couldn't tell their click registered. Fire a "Swarm cancelled" success toast on the cancel path (onCancel), which runs only on a real cancel — never on a successful launch (that path is onDone). Extend the existing Cancel test to assert the toast fires. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. WalkthroughThe Swarms create-flow cancellation handler now calls Merge Risk: ⚪ Minimal · up to The change adds confirmation when a user cancels new-swarm setup without affecting launch or running-swarm flows; no actionable merge-blocking risk remains after normal checks and review. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Internal previewPreview URL: https://mcp-inspector-pr-4111.up.railway.app |
… test) Per Gabriel's review (he handed the nits back): - Rename the cancel toast "Swarm cancelled" -> "New swarm discarded" (SwarmsTab.tsx). Cancel in the create flow happens before launch and just drops the draft; "cancelled" collided with the swarm-run status meaning (a running swarm stopped on purpose) and overstated on the failed-launch path where created rows persist. - Pin the negative half of the toast invariant: the successful-launch test now asserts toast.success was NOT called with the discard message (launch leaves via onDone, not onCancel), so the cancel test's comment is no longer an untested claim. Reviewed by Gabriel Olarte. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
What
Cancelling a new-swarm setup gave no feedback — the screen just navigated back to the swarms list, leaving the user unsure their click registered.
This adds a
"Swarm cancelled"toast on the cancel path so the action is acknowledged.Closes BB-64.
Change
onCancelinSwarmsTab.tsxnow fires the toast before navigating:toastwas already imported;toast.success(...)matches the existing convention for brief confirmations across the swarms code.Cancelbutton →leaveFlow→onCancel) runs only on a real cancel. Leaving a running swarm goes throughleaveRunning, and a successful launch goes throughonDone, so the toast can't misfire.Test
Extended the existing Cancel test in
SwarmsTab.createFlow.test.tsx(rather than duplicating its setup) with one assertion that the toast fires. Full file: 56/56 passing.🤖 Generated with Claude Code
Summary by cubic
Show a “New swarm discarded” toast when a user cancels the new-swarm flow, replacing the previous silent exit. This acknowledges the draft was dropped and avoids confusion with the “cancelled” swarm-run status (BB-64).
/swarms. This runs only on pre-launch cancel; successful launch (onDone) and stopping a running swarm are unchanged.Written for commit fcbda7f. Summary will update on new commits.