[PR #12952] feat: message edit (undo) with confirm/cancel flow #14447

Open
opened 2026-02-16 18:19:14 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12952

State: open
Merged: No


Summary

Implements a deferred edit flow where clicking "Undo" populates the prompt without immediately reverting history. The actual session revert (fork) occurs only when the edited message is sent, providing a safer and more intuitive user experience.

  • Added editingID to global prompt context.
  • Consolidated revert logic into the handleSubmit flow.
  • Added "Undo" button to user messages.
  • Displays an "Editing message" banner with a "Cancel" button in the prompt area.
  • Verified attachment handling (restoring text, files, agents, images).

Fixes

Fixes #9661
Fixes #6942
Fixes #8197

Before / After

image image
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12952 **State:** open **Merged:** No --- ## Summary Implements a deferred edit flow where clicking "Undo" populates the prompt without immediately reverting history. The actual session revert (fork) occurs only when the edited message is sent, providing a safer and more intuitive user experience. - Added `editingID` to global prompt context. - Consolidated revert logic into the `handleSubmit` flow. - Added "Undo" button to user messages. - Displays an "Editing message" banner with a "Cancel" button in the prompt area. - Verified attachment handling (restoring text, files, agents, images). ## Fixes Fixes #9661 Fixes #6942 Fixes #8197 ## Before / After <img width="350" height="270" alt="image" src="https://github.com/user-attachments/assets/cd42c23c-395b-402e-8335-f2d75ef206e9" /> <img width="350" height="270" alt="image" src="https://github.com/user-attachments/assets/d8a2b358-a858-482f-98f7-2e7870c81148" />
yindo added the pull-request label 2026-02-16 18:19:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14447