Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Aug 9, 2025

Description

This PR fixes issue #6865 where the X button (stop/close task button) was missing when the UI was prompting users to Save/Reject changes.

Problem

Users reported that they could not stop or terminate tasks when prompted with Save/Reject buttons. The X button was only visible during streaming operations but disappeared during approval prompts, preventing users from canceling tasks when:

  • The LLM was making no useful progress
  • Users were satisfied with partial changes
  • They wanted to stop without completing the full reasoning process

Solution

Added a dedicated stop/close button (X icon) that remains visible when approval buttons are shown. The button:

  • Appears as an icon button next to the approval buttons
  • Allows users to terminate the current task at any time
  • Uses the existing startNewTask() function to properly clean up the task
  • Is styled consistently with other UI elements

Changes Made

  • Modified ChatView.tsx to add a stop/close button when enableButtons is true and primaryButtonText exists
  • The button is only shown during non-streaming approval states (Save/Reject, Approve/Reject, etc.)
  • Uses the codicon-x icon for consistency with VS Code UI patterns

Testing

  • ✅ All existing tests pass
  • ✅ Linting passes with no warnings
  • ✅ Type checking passes
  • ✅ Manually tested the button appears during save/reject prompts
  • ✅ Button successfully terminates the task when clicked

Screenshots

The X button now appears during save/reject prompts, allowing users to stop the task:

  • Button is visible alongside Save/Reject buttons
  • Maintains consistent styling with other UI elements

Fixes #6865


Important

Adds a stop/close button in ChatView.tsx during save/reject prompts to allow task termination, addressing issue #6865.

  • Behavior:
    • Adds a stop/close button (X icon) in ChatView.tsx during save/reject prompts when enableButtons is true and primaryButtonText exists.
    • Button allows task termination using startNewTask() function.
    • Button is styled with codicon-x for consistency with VS Code UI.
  • Testing:
    • Manually tested button appearance and functionality during save/reject prompts.
    • All existing tests, linting, and type checking pass.

This description was created by Ellipsis for eed1f15. You can customize this summary. It will automatically update as commits are pushed.

- Added a stop/close button (X icon) that remains visible when approval buttons are shown
- Button allows users to terminate tasks during save/reject phase as requested
- Fixes issue where users could not stop tasks when prompted to save/reject changes

Fixes #6865
@roomote roomote bot requested review from cte, jr and mrubens as code owners August 9, 2025 01:28
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Aug 9, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Aug 9, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 9, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Reviewing my own code because apparently I trust no one, not even myself.

</StandardTooltip>
)}
{(secondaryButtonText || isStreaming) && (
{(secondaryButtonText || isStreaming) && !isStreaming && (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this condition intentional? The logic checks for (secondaryButtonText || isStreaming) but then immediately requires !isStreaming, which effectively simplifies to just secondaryButtonText && !isStreaming. Could we simplify this for clarity?

<StandardTooltip content={t("chat:cancel.tooltip")}>
<VSCodeButton
appearance="secondary"
disabled={!(isStreaming && !didClickCancel)}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The outer condition already ensures isStreaming is true, so this inner check isStreaming && !didClickCancel could be simplified to just !didClickCancel. Is there a reason for the redundant check?

<VSCodeButton
appearance="icon"
disabled={false}
className="ml-2"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Minor styling inconsistency: This button uses className="ml-2" while other buttons in this section use ml-[6px]. Consider using consistent spacing for visual harmony.

disabled={false}
className="ml-2"
onClick={() => startNewTask()}>
<span className="codicon codicon-x"></span>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Consider adding an aria-label attribute for better accessibility. Screen readers would benefit from a descriptive label like aria-label="Close task" since the button only contains an icon.

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

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

X button missing to stop and close task

3 participants