Skip to content

Edit/Delete with Checkpoints #5710

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

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

Conversation

liwilliam2021
Copy link
Collaborator

@liwilliam2021 liwilliam2021 commented Jul 14, 2025

We now make a checkpoint after every user message so when a user edits a user message. Now when a user has checkpoints enabled, upon deleting or editing a message they are asked if they would like to restore the checkpoint right before the message was sent

Feature Loom: https://www.loom.com/share/a810f38550524e079c3d8c6eb8c53ce5

Edge cases + stress testing Loom: https://www.loom.com/share/28e56e97da944cc18144b9c92594b8e5
Follow Up question editing Loom: https://www.loom.com/share/8f6da376cbb842219ba4eb9aa7956b04
Checkpoints not enabled Loom: https://www.loom.com/share/0fdfde900c494239a16ac19ad26a597f

Fixes #4703


Important

This pull request adds a feature for restoring checkpoints when editing or deleting messages, including UI updates and internationalization support.

  • Behavior:
    • Adds checkpoint restoration feature for message edits and deletions in ChatRow.tsx and ChatView.tsx.
    • Prompts users with CheckpointRestoreDialog to confirm restoration of checkpoints.
  • UI Components:
    • Introduces CheckpointRestoreDialog.tsx for handling user confirmations on checkpoint restoration.
    • Updates ChatRow.tsx to include edit and delete buttons with checkpoint options.
    • Modifies ChatView.tsx to manage message visibility and checkpoint prompts.
  • Internationalization:
    • Updates i18n files across multiple languages to include translations for new checkpoint-related dialog options.

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

@liwilliam2021 liwilliam2021 requested review from mrubens, cte and jr as code owners July 14, 2025 22:34
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. enhancement New feature or request labels Jul 14, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 14, 2025
@@ -69,10 +72,10 @@ export const webviewMessageHandler = async (
* Shared utility to find message indices based on timestamp
*/
const findMessageIndices = (messageTs: number, currentCline: any) => {
const timeCutoff = messageTs - 1000 // 1 second buffer before the message
const messageIndex = currentCline.clineMessages.findIndex((msg: ClineMessage) => msg.ts && msg.ts >= timeCutoff)
// Find the exact message by timestamp, not the first one after a cutoff
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was made to make timestamping against checkpoints easier-- as far I as I can see removing the buffer doesn't break anything

@daniel-lxs daniel-lxs moved this from Triage to renovate BOT in Roo Code Roadmap Jul 15, 2025
@daniel-lxs daniel-lxs moved this from renovate BOT to PR [Needs Prelim Review] in Roo Code Roadmap Jul 15, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jul 15, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Draft / In Progress] in Roo Code Roadmap Jul 15, 2025
Base automatically changed from will/edit-delete-overhaul to main July 17, 2025 14:17
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Jul 17, 2025
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Jul 17, 2025
@daniel-lxs daniel-lxs moved this from PR [Draft / In Progress] to PR [Needs Prelim Review] in Roo Code Roadmap Jul 18, 2025
Copy link
Collaborator

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future consideration: The state transitions during checkpoint restoration (task running → aborting → restoring → reinitialized → processing pending edits) could benefit from a formal state machine implementation to make the flow more explicit.

LGTM.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 18, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Jul 18, 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 lgtm This PR has been approved by a maintainer PR - Needs Review size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
Status: PR [Needs Review]
Development

Successfully merging this pull request may close these issues.

Add message editing functionality to chat interface
3 participants