Skip to content

Confirm swarm cancel with a toast (BB-64) - #4111

Open
SebasKoria wants to merge 3 commits into
mainfrom
fix/bb-64-swarm-cancel-toast
Open

Confirm swarm cancel with a toast (BB-64)#4111
SebasKoria wants to merge 3 commits into
mainfrom
fix/bb-64-swarm-cancel-toast

Conversation

@SebasKoria

@SebasKoria SebasKoria commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

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

onCancel in SwarmsTab.tsx now fires the toast before navigating:

onCancel={() => {
  toast.success("Swarm cancelled");
  navigate(routePaths.swarms);
}}
  • toast was already imported; toast.success(...) matches the existing convention for brief confirmations across the swarms code.
  • This path (Cancel button → leaveFlowonCancel) runs only on a real cancel. Leaving a running swarm goes through leaveRunning, and a successful launch goes through onDone, 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).

  • SwarmsTab.tsx: onCancel now calls toast.success("New swarm discarded") then navigates to /swarms. This runs only on pre-launch cancel; successful launch (onDone) and stopping a running swarm are unchanged.
  • Tests: extend the cancel test to assert the discard toast fires, and add a negative assertion that it does not fire on successful launch.

Written for commit fcbda7f. Summary will update on new commits.

Review in cubic

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>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. enhancement New feature or request labels Aug 18, 2026
@chelojimenez

chelojimenez commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 256857bc-cc71-4a8b-810d-de3cad3f01a8

📥 Commits

Reviewing files that changed from the base of the PR and between 41ada5d and fcbda7f.

📒 Files selected for processing (2)
  • mcpjam-inspector/client/src/components/swarms/SwarmsTab.tsx
  • mcpjam-inspector/client/src/components/swarms/__tests__/SwarmsTab.createFlow.test.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • mcpjam-inspector/client/src/components/swarms/SwarmsTab.tsx
  • mcpjam-inspector/client/src/components/swarms/tests/SwarmsTab.createFlow.test.tsx

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.


Walkthrough

The Swarms create-flow cancellation handler now calls toast.success with “New swarm discarded” before navigating to the Swarms route. The create-flow tests verify the toast after cancellation and verify that successful launches do not show the cancellation toast. Other test changes reformat existing expressions without changing behavior.

Merge Risk: ⚪ Minimal · up to fcbda

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Internal preview

Preview URL: https://mcp-inspector-pr-4111.up.railway.app
Deployed commit: 194e142
PR head commit: fcbda7f
Backend target: staging fallback.
Health: ✅ Convex reachable
Access is employee-only in non-production environments.

SebasKoria and others added 2 commits August 24, 2026 15:31
… 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>
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants