Skip to content

Conversation

@MuriloFP
Copy link
Contributor

@MuriloFP MuriloFP commented Jul 31, 2025

Related GitHub Issue

Closes: #6494

Roo Code Task Context (Optional)

No Roo Code task context for this PR

Description

This PR fixes the missing delete button on task cards in the main chat screen by removing the size condition that was hiding it.

Key changes:

  • Modified the conditional rendering in TaskActions.tsx to show the delete button whenever an item exists, regardless of its size
  • Kept the file size display conditional - it only shows when item.size > 0
  • Updated tests to reflect the new behavior and added additional test cases for edge cases

Design decision: The delete button visibility is now consistent between the main screen and history screen, improving UX. The file size display remains conditional to avoid showing "0 B" for tasks without size data.

Test Procedure

Automated Testing:

  • Updated existing test case to expect delete button even when size is 0
  • Added new test cases for:
    • Delete button visibility with undefined size
    • Delete button not showing when item is undefined
  • All tests pass: cd webview-ui && npx vitest run src/components/chat/__tests__/TaskActions.spec.tsx

Manual Testing:

  1. Start a new task in Roo Code
  2. Observe the task header in the main chat screen
  3. Verify the delete button (trash icon) is now visible
  4. Click the delete button to verify the confirmation dialog appears
  5. Shift+Click the delete button to verify immediate deletion works
  6. Navigate to task history and verify delete button still works there

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

No UI changes in this PR (The delete button was already styled, just hidden conditionally)

Documentation Updates

  • No documentation updates are required.

Additional Notes

This fix ensures consistent UX between the main chat screen and history screen. The delete functionality was already working properly in the backend - this was purely a UI visibility issue.

Get in Touch

@MuriloFP


Important

Fixes delete button visibility on task cards in TaskActions.tsx to show consistently when an item exists, regardless of size.

  • Behavior:
    • Modified TaskActions.tsx to always show the delete button when item exists, regardless of item.size.
    • File size display remains conditional, only shown when item.size > 0.
  • Testing:
    • Updated tests in TaskActions.spec.tsx to expect delete button visibility when item.size is 0 or undefined.
    • Added test cases for delete button visibility with undefined item.
  • Design:
    • Ensures consistent UX by aligning delete button visibility between main and history screens.

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

MuriloFP and others added 30 commits July 3, 2025 15:26
- Remove size condition from delete button visibility
- Keep size display conditional (only show when size > 0)
- Update tests to reflect new behavior
- Add tests for undefined size and no item cases
@MuriloFP MuriloFP requested review from cte, jr and mrubens as code owners July 31, 2025 20:36
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Jul 31, 2025
Copy link
Contributor

@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.

Thank you for your contribution! This PR successfully fixes the delete button visibility issue on task cards.

What works well:

  • ✅ The delete button now shows consistently when an item exists, regardless of size
  • ✅ File size display remains conditional (only shows when size > 0), avoiding "0 B" display
  • ✅ Comprehensive test coverage with new edge cases
  • ✅ Clean, minimal implementation that follows React best practices

The code changes are focused and properly tested. This improves UX consistency between the main screen and history screen.

LGTM! 🚀

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 31, 2025
@MuriloFP MuriloFP marked this pull request as draft July 31, 2025 21:14
@MuriloFP
Copy link
Contributor Author

Delete button is still not showing on the main screen. This was a workflow test (failed).

@MuriloFP MuriloFP closed this Jul 31, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 31, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Delete button is missing from main screen task cards

2 participants