Skip to content

feat: Cancel specific run from dashboard#313

Merged
jamescmartinez merged 1 commit intoopenworkflowdev:mainfrom
octoper:vaggelis/add-cancel-button-to-run
Feb 15, 2026
Merged

feat: Cancel specific run from dashboard#313
jamescmartinez merged 1 commit intoopenworkflowdev:mainfrom
octoper:vaggelis/add-cancel-button-to-run

Conversation

@octoper
Copy link
Contributor

@octoper octoper commented Feb 15, 2026

This PR adds "Cancel Run" action to the run details page in dashboard

Run details Confirmation dialog
CleanShot 2026-02-15 at 13 00 51@2x CleanShot 2026-02-15 at 13 01 11@2x

Copilot AI review requested due to automatic review settings February 15, 2026 11:03
@octoper octoper changed the title feat: Cancel run from dashboard feat: Cancel specific run from dashboard Feb 15, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a "Cancel Run" feature to the workflow run details page in the dashboard, allowing users to cancel workflow runs that are in pending, running, or sleeping states. The implementation includes a new reusable component with a confirmation dialog, backend API integration, and status utility functions.

Changes:

  • Added a new RunCancelAction component that displays a destructive action button and confirmation dialog for canceling workflow runs
  • Introduced API endpoint cancelWorkflowRunServerFn to handle workflow run cancellation via the backend
  • Added CANCELABLE_RUN_STATUSES constant and isRunCancelableStatus helper function to determine which runs can be canceled

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/dashboard/src/components/run-cancel-action.tsx New component implementing the cancel run UI with AlertDialog confirmation and error handling
packages/dashboard/src/lib/api.ts Added cancelWorkflowRunServerFn server function to call backend's cancelWorkflowRun method
packages/dashboard/src/lib/status.ts Added CANCELABLE_RUN_STATUSES constant and isRunCancelableStatus utility function
packages/dashboard/src/routes/runs/$runId.tsx Integrated RunCancelAction component into run details page with router invalidation on successful cancellation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 15, 2026 14:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

</AlertDialogDescription>
</AlertDialogHeader>

{error && <p className="text-destructive text-xs">{error}</p>}
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline error message is rendered as a plain <p>, which won’t be announced reliably by screen readers. Elsewhere in the codebase FieldError uses role="alert"; consider using the same pattern here (e.g., add role="alert" and/or aria-live) so cancellation failures are accessible.

Suggested change
{error && <p className="text-destructive text-xs">{error}</p>}
{error && (
<p role="alert" aria-live="assertive" className="text-destructive text-xs">
{error}
</p>
)}

Copilot uses AI. Check for mistakes.
interface RunCancelActionProps {
runId: string;
status: WorkflowRunStatus;
onCanceled?: (() => Promise<void>) | (() => void);
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onCanceled?: (() => Promise<void>) | (() => void) can be simplified to a single signature like () => void | Promise<void>, which is easier to read and avoids an unnecessary union of function types.

Suggested change
onCanceled?: (() => Promise<void>) | (() => void);
onCanceled?: () => void | Promise<void>;

Copilot uses AI. Check for mistakes.
@octoper octoper force-pushed the vaggelis/add-cancel-button-to-run branch from 91126f1 to 4d8bcde Compare February 15, 2026 15:01
@codecov
Copy link

codecov bot commented Feb 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jamescmartinez
Copy link
Contributor

thanks!

@jamescmartinez jamescmartinez merged commit b14bb5e into openworkflowdev:main Feb 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments