Skip to content

Delete button is missing from main screen task cardsΒ #6494

@MuriloFP

Description

@MuriloFP

App Version

latest

API Provider

Anthropic

Model Used

irrelevant

Roo Code Task Links (Optional)

No response

πŸ” Steps to Reproduce

Description

The delete button (trash icon) is not visible on task cards in the main chat screen, even though the same functionality is available in the task history screen. This creates an inconsistent user experience where users have to navigate to the history screen to delete tasks.

Steps to Reproduce

  1. Start a new task in Roo Code
  2. Look at the task header in the main chat screen
  3. Notice that there's no delete/trash icon visible
  4. Navigate to the task history screen
  5. Notice that the same task shows a delete button there

πŸ’₯ Outcome Summary

Expected Behavior

The delete button should be consistently available on both the main screen and history screen for all tasks.

Actual Behavior

The delete button only appears in the history screen. On the main screen, it's hidden because the TaskActions component only renders the delete button when item?.size && item.size > 0 (line 39 in TaskActions.tsx).

πŸ” Comprehensive Issue Scoping

Root Cause

The delete button visibility is conditionally tied to the size property of the HistoryItem. Current tasks on the main screen may have a size of 0 or undefined, causing the delete button to be hidden.

Affected Components

  • Primary Files:
    • webview-ui/src/components/chat/TaskActions.tsx (lines 39-66): Contains the conditional rendering logic
    • webview-ui/src/components/chat/__tests__/TaskActions.spec.tsx (lines 364-370): Tests confirming the current behavior

Current Implementation Analysis

The TaskActions component checks !!item?.size && item.size > 0 before rendering the delete button section. This was likely intended to hide the delete button for tasks that haven't been saved yet, but it creates an inconsistent UX.

Proposed Implementation

Step 1: Remove size condition from delete button rendering

  • File: webview-ui/src/components/chat/TaskActions.tsx
  • Changes: Remove the size check on line 39, keeping only the item check
  • Rationale: The delete functionality works regardless of size, as confirmed by backend implementation

Testing Requirements

  • Unit Tests:
    • Update test case "does not render delete button when item has no size" to expect the button to be rendered
    • Add test case for delete button visibility with size = 0
    • Add test case for delete button visibility with undefined size
  • Manual Testing:
    • Verify delete button appears on main screen for new tasks
    • Verify delete button still works in history screen
    • Test delete functionality with Shift+Click (skip confirmation)
    • Test delete dialog appears without Shift key

Acceptance Criteria

Given a user has an active task on the main screen
When they look at the task header
Then they should see a delete button (trash icon)
And clicking it should open the delete confirmation dialog
And Shift+clicking it should delete immediately without confirmation

Dependencies and Breaking Changes

  • No breaking changes expected
  • No API changes required
  • Backend already supports deleting tasks regardless of size

πŸ“„ Relevant Logs or Errors (Optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.UI/UXUI/UX related or focusedbugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions