Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Nov 17, 2025

Description

This PR attempts to address Issue #9312 by adding edit and delete controls to AI messages, similar to the existing functionality for user messages.

Changes

  • Added edit and delete buttons to AI text messages in the chat interface
  • Implemented the same functionality that currently exists for user messages
  • Users can now modify or remove AI responses for better conversation control

Why

As described in the issue, the current implementation only allows users to edit/delete their own messages but not AI responses. This creates limitations in conversation management, especially when the model produces incorrect or undesired outputs. Users had to rely on checkpoints or the 'Stop' button to manage conversations.

Testing

  • ✅ Built the project successfully
  • ✅ All existing tests pass (976 passed, 6 skipped)
  • ✅ No TypeScript errors
  • ✅ Lint checks pass

Screenshots

The AI messages now display edit and delete icons on hover, similar to user messages.

Closes #9312

Feedback and guidance are welcome!


Important

Adds edit and delete controls to AI messages in ChatRow.tsx, allowing users to modify or remove AI responses.

  • Behavior:
    • Adds edit and delete buttons to AI text messages in ChatRow.tsx.
    • Users can edit AI messages using ChatTextArea and save changes via handleSaveEdit().
    • AI messages can be deleted by sending a deleteMessage post message.
  • Functions:
    • handleEditClick(), handleCancelEdit(), and handleSaveEdit() manage edit state and actions.
    • handleSelectImages() allows image selection during editing.
  • UI:
    • Edit and delete icons appear on hover, hidden during streaming.

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

- Added edit and delete buttons to AI text messages
- Implemented same functionality as user messages
- Allows users to modify or remove AI responses for better conversation control
- Fixes #9312
@roomote roomote bot requested review from cte, jr and mrubens as code owners November 17, 2025 16:36
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Nov 17, 2025
@roomote
Copy link
Contributor Author

roomote bot commented Nov 17, 2025

Rooviewer Clock   See task on Roo Cloud

Review completed. Found 1 issue that needs attention:

  • Backend message handler needs updates to properly support AI message deletion/editing

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Comment on lines +1131 to +1150
{isEditing ? (
<div className="flex flex-col gap-2">
<ChatTextArea
inputValue={editedContent}
setInputValue={setEditedContent}
sendingDisabled={false}
selectApiConfigDisabled={true}
placeholderText={t("chat:editMessage.placeholder")}
selectedImages={editImages}
setSelectedImages={setEditImages}
onSend={handleSaveEdit}
onSelectImages={handleSelectImages}
shouldDisableImages={!model?.supportsImages}
mode={editMode}
setMode={setEditMode}
modeShortcutText=""
isEditMode={true}
onCancel={handleCancelEdit}
/>
</div>
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 backend message handler needs to be updated to properly support AI message deletion and editing. Currently, the handleEditMessageConfirm function (lines 336-359 in webviewMessageHandler.ts) searches backwards for user_feedback messages, which won't work for AI messages that have say: "text". This will cause the deletion to target the wrong message range, potentially corrupting the conversation state.

The backend should distinguish between user message edits (which need to find the preceding user_feedback) and AI message edits (which should delete from the AI message itself). Consider adding a check for the message type before determining the deletion range.

Fix it with Roo Code or mention @roomote and request a fix.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Manual deletion/(editing?) of model messages

3 participants