Skip to content

feat(ui): add ability to edit user message when reverting#2440

Draft
Githubguy132010 wants to merge 3 commits intopingdotgg:mainfrom
Githubguy132010:session/agent_e8ef51f9-999b-4912-9fc5-f9a251cdbdb8
Draft

feat(ui): add ability to edit user message when reverting#2440
Githubguy132010 wants to merge 3 commits intopingdotgg:mainfrom
Githubguy132010:session/agent_e8ef51f9-999b-4912-9fc5-f9a251cdbdb8

Conversation

@Githubguy132010
Copy link
Copy Markdown

@Githubguy132010 Githubguy132010 commented May 1, 2026

Fixes #2438

What Changed

Added an edit button to eligible user messages in the chat timeline. Clicking it rolls the thread back to the checkpoint before that message’s agent work, restores the user message text into the composer, and focuses the composer so the prompt can be corrected and resent.

Why

This supports the common “fix my previous prompt and restart from there” workflow without manually copying text and reverting separately. It reuses the existing checkpoint revert mechanism instead of introducing a new rollback path, keeping the behavior consistent with current thread state handling.

UI Changes

Adds a small edit icon button next to the existing revert action on user messages that have a restorable checkpoint.

Before: user messages exposed copy/revert actions only.
After: user messages expose copy/edit/revert actions, with edit pre-filling the composer after rollback.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Add Edit button to user messages in the chat timeline to revert and prefill the composer

  • Adds an Edit button (alongside the existing Revert button) to eligible user message rows in MessagesTimeline.tsx.
  • Clicking Edit reverts the conversation to that message's turn count and prefills the composer with the derived visible text, moves the cursor to the end, and focuses the input.
  • The Edit button is disabled while a checkpoint revert or work is in progress.
📊 Macroscope summarized 914e503. 3 files reviewed, 3 issues evaluated, 0 issues filtered, 1 comment posted

🗂️ Filtered Issues

Implement `onEditUserMessage` in `ChatView` to allow users to modify a message's text and revert the conversation to that specific point. This updates the composer draft and resets the cursor state to the end of the text.

- Add `onEditUserMessage` handler to `ChatView`
- Update `MessagesTimeline` to include an edit button (SquarePenIcon) next to the revert button
- Update corresponding types and test mocks for `MessagesTimeline`
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9103a2e8-ebd7-49af-a36b-676ed9447f8c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels May 1, 2026
Comment thread apps/web/src/components/ChatView.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Edit button on user messages (similar to t3chat)

1 participant