-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
base: main
Are you sure you want to change the base?
Conversation
@@ -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 |
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.
This change was made to make timestamping against checkpoints easier-- as far I as I can see removing the buffer doesn't break anything
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.
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.
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.
ChatRow.tsx
andChatView.tsx
.CheckpointRestoreDialog
to confirm restoration of checkpoints.CheckpointRestoreDialog.tsx
for handling user confirmations on checkpoint restoration.ChatRow.tsx
to include edit and delete buttons with checkpoint options.ChatView.tsx
to manage message visibility and checkpoint prompts.This description was created by
for 15ce9e3. You can customize this summary. It will automatically update as commits are pushed.