-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat: add edit/delete controls to AI messages #9313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- 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
Review completed. Found 1 issue that needs attention:
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| {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> |
There was a problem hiding this comment.
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.
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
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
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.ChatRow.tsx.ChatTextAreaand save changes viahandleSaveEdit().deleteMessagepost message.handleEditClick(),handleCancelEdit(), andhandleSaveEdit()manage edit state and actions.handleSelectImages()allows image selection during editing.This description was created by
for 5061595. You can customize this summary. It will automatically update as commits are pushed.