Skip to content

Add loading spinner to Cancel Coding Agent button#7466

Merged
alexr00 merged 4 commits intomainfrom
copilot/fix-7451
Jul 30, 2025
Merged

Add loading spinner to Cancel Coding Agent button#7466
alexr00 merged 4 commits intomainfrom
copilot/fix-7451

Conversation

Copy link
Contributor

Copilot AI commented Jul 30, 2025

The "Cancel Coding Agent" button now shows a loading spinner during the cancellation process to provide clear visual feedback to users.

Problem

Users reported that when clicking "Cancel Coding Agent", the button would become disabled for ~10 seconds with no visual indication that the cancellation was still in progress. This left users uncertain whether the action was working or if the button was stuck.

Solution

Added a spinning loading icon that appears inline with the button text when the cancellation is in progress:

  • Before: Button shows "Cancel Coding Agent" and becomes disabled (no visual feedback)
  • After: Button shows "🔄 Cancel Coding Agent" with animated spinner while disabled

Implementation Details

  • Leverages existing isBusy state management in CancelCodingAgentButton
  • Uses the existing loadingIcon component with CSS animations already present in the codebase
  • Minimal changes to ContextDropdown interface to support React nodes in button labels
  • Maintains backward compatibility - all existing dropdown buttons continue to work unchanged

Technical Changes

  1. Updated ContextDropdownProps.defaultOptionLabel to accept string | React.ReactNode
  2. Modified ContextDropdown to safely handle React nodes in the title attribute
  3. Enhanced CancelCodingAgentButton to conditionally show spinner when isBusy is true

The implementation provides immediate visual feedback that the cancellation is actively processing, improving the user experience during the 10-second operation.

Fixes #7451.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits July 30, 2025 10:53
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] "Cancel coding agent" could use status Add loading spinner to Cancel Coding Agent button Jul 30, 2025
Copilot AI requested a review from alexr00 July 30, 2025 11:04
@alexr00 alexr00 marked this pull request as ready for review July 30, 2025 13:11
@alexr00 alexr00 enabled auto-merge (squash) July 30, 2025 13:11
@vs-code-engineering vs-code-engineering bot added this to the July 2025 milestone Jul 30, 2025
@alexr00 alexr00 merged commit c4534bb into main Jul 30, 2025
3 checks passed
@alexr00 alexr00 deleted the copilot/fix-7451 branch July 30, 2025 16:03
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.

"Cancel coding agent" could use status

3 participants