Add an edit action for the latest user message#766
Add an edit action for the latest user message#766Amer-alsayed wants to merge 2 commits intopingdotgg:mainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #762
What Changed
Adds an edit action to the latest eligible user message. Choosing edit restores that message into the composer, rehydrates image attachments when possible, and reverts the thread to the checkpoint immediately before that turn so the user can resend an updated prompt.
Why
This keeps the workflow close to Codex-style prompt editing without mutating historical messages in place. It reuses the existing checkpoint revert model instead of introducing a separate history-editing path.
UI Changes
Before:

After:

Validation
bun run --filter=@t3tools/web typecheckbun run --filter=@t3tools/web testScope
Note
Add an edit action for the latest user message in the chat timeline
MessagesTimeline, replacing the generic Undo button for that specific message.onEditLastUserMessagereverts the thread to just before agent work, then pre-populates the composer with the original message text and any restorable image attachments.previewUrland reconstructingFileobjects via the newrestoreComposerImageAttachmenthelper; attachments that fail to reload trigger a thread error notice.onRevertToTurnCountis refactored to returnPromise<boolean>so callers can gate composer restoration on revert success, andisRevertingCheckpointis now reset in afinallyblock.Macroscope summarized a98fca3.