-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Edit/Delete User Message #7447
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
Edit/Delete User Message #7447
Conversation
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.
Thank you for your contribution! I've reviewed the changes and found several issues that need attention before this can be merged. The implementation of checkpoint restoration for edit/delete operations looks promising, but there are some critical items to address.
| currentCline.abortTask() | ||
| // Wait a bit for the abort to complete | ||
| await pWaitFor(() => currentCline.abort === true, { | ||
| timeout: 1000, |
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.
Is a 1-second timeout sufficient for complex operations? Consider making this configurable or increasing the default:
| variant="ghost" | ||
| size="icon" | ||
| className="shrink-0 hidden" | ||
| className="shrink-0" |
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.
Is this intentional? The edit button was previously hidden but is now always visible. Should this be conditional based on message type or user permissions?
|
|
||
| const visibleMessages = useMemo(() => { | ||
| // Pre-compute checkpoint hashes that have associated user messages for O(1) lookup | ||
| const userMessageCheckpointHashes = new Set<string>() |
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.
Good optimization using Set for O(1) lookup! This improves performance when filtering checkpoint messages.
Additional Review CommentsCritical Issues to Address:
Positive Observations:
Once these issues are addressed and the PR is moved out of draft status, it will be ready for final review and merge. |
fddb922 to
83c38d0
Compare
83c38d0 to
44144bd
Compare
commit 6384ca5 Merge: 0c481a3 85268aa Author: NaccOll <[email protected]> Date: Mon Aug 25 18:00:51 2025 +0800 Merge branch 'will/edit-w-checkpoints' into main commit 85268aa Author: Will Li <[email protected]> Date: Fri Jul 25 09:57:08 2025 -0700 remove some extra code commit 0bd49d7 Merge: a78aed8 d62a260 Author: Will Li <[email protected]> Date: Fri Jul 25 09:23:24 2025 -0700 Merge branch 'main' into will/edit-w-checkpoints commit a78aed8 Author: Will Li <[email protected]> Date: Wed Jul 23 04:06:27 2025 -0700 further simplification commit b8c5dda Author: Will Li <[email protected]> Date: Wed Jul 23 03:17:54 2025 -0700 clean code more commit 6657a7d Merge: 7baefef 9956cc1 Author: Will Li <[email protected]> Date: Wed Jul 23 03:03:58 2025 -0700 Merge branch 'main' into will/edit-w-checkpoints commit 7baefef Author: Will Li <[email protected]> Date: Wed Jul 23 01:20:46 2025 -0700 reduce checkpoint changes commit ab46f94 Merge: 15ce9e3 5629199 Author: Matt Rubens <[email protected]> Date: Tue Jul 22 14:51:14 2025 -0400 Merge remote-tracking branch 'origin/main' into will/edit-w-checkpoints commit 15ce9e3 Merge: 09d0b29 9014840 Author: Will Li <[email protected]> Date: Fri Jul 18 15:33:21 2025 -0700 merge main commit 09d0b29 Author: Will Li <[email protected]> Date: Thu Jul 17 08:41:08 2025 -0700 fix typo commit 17658ba Author: Will Li <[email protected]> Date: Thu Jul 17 08:39:36 2025 -0700 fix weird autolint again commit 2ab8d49 Author: Will Li <[email protected]> Date: Thu Jul 17 08:35:05 2025 -0700 other merge fixes commit 0e9954d Merge: 2c77f32 fb374b3 Author: Will Li <[email protected]> Date: Thu Jul 17 08:34:29 2025 -0700 Merge branch 'main' into will/edit-w-checkpoints commit 2c77f32 Author: Will Li <[email protected]> Date: Mon Jul 14 15:56:18 2025 -0700 clean logging commit 616c4b6 Author: Will Li <[email protected]> Date: Mon Jul 14 15:42:08 2025 -0700 do translations commit 7015608 Author: Will Li <[email protected]> Date: Mon Jul 14 15:26:05 2025 -0700 fix race cond and lint commit caee1dc Author: Will Li <[email protected]> Date: Mon Jul 14 14:52:06 2025 -0700 tests, optimizations, refactors commit bccffac Author: Will Li <[email protected]> Date: Mon Jul 14 11:41:27 2025 -0700 working commit 930e70e Author: Will Li <[email protected]> Date: Sun Jul 13 18:03:51 2025 -0700 refactor commit 6044c1a Author: Will Li <[email protected]> Date: Sun Jul 13 15:26:24 2025 -0700 initial print fix commit 0872b8b Author: Will Li <[email protected]> Date: Sun Jul 13 10:36:45 2025 -0700 cleaner code commit d3c655d Author: Will Li <[email protected]> Date: Sun Jul 13 00:19:49 2025 -0700 working version, still some default checkpointing bugs commit 63c7c7c Author: Will Li <[email protected]> Date: Fri Jul 11 15:56:33 2025 -0700 some merge fixes commit 7b77d80 Merge: ce0c182 69c3996 Author: Will Li <[email protected]> Date: Fri Jul 11 09:49:47 2025 -0700 Merge branch 'will/edit-delete-overhaul' into will/edit-w-checkpoints commit 69c3996 Merge: 4604211 406b366 Author: Will Li <[email protected]> Date: Thu Jul 10 20:46:31 2025 -0700 Merge branch 'main' into will/edit-delete-overhaul commit 4604211 Author: Will Li <[email protected]> Date: Thu Jul 10 20:26:35 2025 -0700 ui fix commit 5edab52 Author: Will Li <[email protected]> Date: Thu Jul 10 18:47:21 2025 -0700 fixed image issue commit f89d768 Author: Will Li <[email protected]> Date: Thu Jul 10 17:26:36 2025 -0700 remove option to skip notif commit ce0c182 Author: Will Li <[email protected]> Date: Thu Jul 10 17:10:12 2025 -0700 temp push commit 67fd5a7 Author: Will Li <[email protected]> Date: Wed Jul 9 17:08:10 2025 -0700 add back hidden flag commit a17bf98 Author: Will Li <[email protected]> Date: Wed Jul 9 17:06:43 2025 -0700 translations commit ed4a2a7 Author: Will Li <[email protected]> Date: Wed Jul 9 16:48:11 2025 -0700 ok finally tests working for real! commit 303a9c8 Author: Will Li <[email protected]> Date: Wed Jul 9 16:33:04 2025 -0700 tests working commit 24a8c10 Author: Will Li <[email protected]> Date: Wed Jul 9 15:32:50 2025 -0700 working functionality commit d926a77 Author: Will Li <[email protected]> Date: Wed Jul 9 13:02:18 2025 -0700 big UI improvements commit ff8c188 Author: Will Li <[email protected]> Date: Wed Jul 9 09:00:43 2025 -0700 improved chat row first pass
44144bd to
7922443
Compare
|
The checkpoint feature handles more than just code changes so I think it makes sense to have a more generic message. The translations should be updated to remove specific references to "code": In all language files (
What do you think? |
Related GitHub Issue
Relate: #7285
Closes: #5710 #4703
Roo Code Task Context (Optional)
Description
After fixing checkpointing issues and changing the checkpoint generation time, #5710 generated numerous conflicts, requiring a revision.
This PR resolves these conflicts, adapts to the new checkpoint generation time, improves user message editing, and supports delete operations to roll back file state.
Test Procedure
unit test
src/core/checkpoints/__tests__/checkpoint.test.tssrc/core/webview/__tests__/checkpointRestoreHandler.spec.tssrc/core/webview/__tests__/webviewMessageHandler.checkpoint.spec.tssrc/core/webview/__tests__/webviewMessageHandler.spec.tsmanual test
3.1. edit message only: Does not change the status of the current workspace file, only replaces the selected user message with the new content in the input box and resends the request. Delete all messages after the selected user's message
3.2. restore code to checkpoint: Restore the workspace files to the state of the next checkpoint, and replaces the selected user message with the new content in the input box and resends the request. Delete all messages after the selected user's message
4.1. delete message only: Does not change the status of the current workspace file and delete the current user message and all subsequent messagesuser's message
4.2. restore code to checkpoint: Restore the workspace files to the state of the next checkpoint and delete the current user message and all subsequent messagesuser's message
Pre-Submission Checklist
Screenshots / Videos
delete message:

edit message:


Documentation Updates
Added a section on editing and deleting user messages
Additional Notes
Get in Touch
NaccOll
Important
This PR adds functionality to edit/delete user messages with options to restore code to a previous checkpoint, including UI updates, backend logic, and localization support.
ChatView.tsxandCheckpointRestoreDialog.tsx.CheckpointRestoreDialogfor user confirmation with options to restore to checkpoint.ChatRowto handle edit mode with image selection and message editing.CheckpointRestoreDialoginCheckpointRestoreDialog.spec.tsx.ClineProvider.spec.tsandwebviewMessageHandler.checkpoint.spec.ts.This description was created by
for 83c38d0. You can customize this summary. It will automatically update as commits are pushed.