Skip to content

Conversation

@gauravwarale
Copy link
Contributor

This pull request adds the ability for users to cancel running jobs from the job details page and improves user feedback with toast notifications. The changes include backend API integration, UI enhancements, and improved state management for job cancellation.

Job Cancellation Feature:

  • Added a new cancelJob API function in jobs.ts to send a POST request to cancel a job by its ID.
  • Integrated a "Cancel Job" button in JobDetailsHeader.tsx, which uses React Query's mutation to call the cancel API, disables the button unless the job is running, and displays "Cancelling..." while the request is pending.
  • Added logic to show toast notifications for success or failure of the cancellation action, and to invalidate the relevant job query after cancellation.

UI/UX Improvements:

  • Added the PatternToastContainer to the app layout to ensure toast notifications are displayed globally.
  • Minor JSX formatting improvements for tag rendering in the job details page.

Copilot AI review requested due to automatic review settings January 6, 2026 09:41
Copy link
Contributor

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 pull request implements a job cancellation feature that enables users to cancel running jobs from the job details page. The implementation includes backend API integration, UI components with loading states, and toast notifications for user feedback.

Key changes:

  • Added backend API integration with a new cancelJob function to handle POST requests for job cancellation
  • Implemented a "Cancel Job" button in the job details page with React Query mutation, conditional enabling based on job status, and loading state display
  • Added global toast notification container to provide user feedback for cancellation operations

Reviewed changes

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

File Description
web/src/app/api/jobs/jobs.ts Added cancelJob API function to send POST requests to the job cancellation endpoint
web/src/modules/Jobs/JobDetails/JobDetailsHeader.tsx Integrated cancel mutation with React Query, added cancel button with conditional enabling, implemented toast notifications for success/error states, and included minor JSX formatting improvements
web/src/common/ClientLayout/ClientLayout.tsx Added PatternToastContainer component to enable global toast notifications throughout the application

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

wlggraham
wlggraham previously approved these changes Jan 7, 2026
gauravwarale and others added 2 commits January 8, 2026 08:36
Co-authored-by: Josh Diaz <joshua.michael.diaz@gmail.com>
Co-authored-by: Josh Diaz <joshua.michael.diaz@gmail.com>
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.

4 participants