[PR #8391] feat(session): add undo functionality to session messages and context menu #12727

Closed
opened 2026-02-16 18:17:37 -05:00 by yindo · 0 comments
Owner

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

State: closed
Merged: No


What does this PR do?

  • Adds a "Revert to here" (Undo) functionality to individual session messages.
  • Introduces a Desktop-friendly Context Menu (right-click) on user messages for quick actions.
  • Implements an intelligent revert logic:
    • Reverting from an older message keeps that message but removes all subsequent turns.
    • Reverting from the latest message acts as a classic "Undo" (removes the message itself).
    • Automatically restores the deleted message's content back into the prompt input for easy editing.
  • Enhances the UI by replacing cluttered hover buttons with a clean, native-feeling context menu.
  • Fixes a critical desktop startup issue by switching from interactive (-il) to login (-l) shell mode to prevent shell-config blocking.
    How did you verify your code works?
  • Verified the desktop app starts correctly without hanging during the sidecar spawn process.
  • Tested the context menu on various messages (both old and latest).
  • Confirmed that the "Undo" correctly clears the session state and restores the prompt in the input field.
  • Verified that right-clicking opens the menu at the correct location and "Copy message" works as expected.
  • Ran typechecks and linting to ensure no regressions were introduced.
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8391 **State:** closed **Merged:** No --- What does this PR do? - Adds a "Revert to here" (Undo) functionality to individual session messages. - Introduces a Desktop-friendly Context Menu (right-click) on user messages for quick actions. - Implements an intelligent revert logic: - Reverting from an older message keeps that message but removes all subsequent turns. - Reverting from the latest message acts as a classic "Undo" (removes the message itself). - Automatically restores the deleted message's content back into the prompt input for easy editing. - Enhances the UI by replacing cluttered hover buttons with a clean, native-feeling context menu. - Fixes a critical desktop startup issue by switching from interactive (-il) to login (-l) shell mode to prevent shell-config blocking. How did you verify your code works? - Verified the desktop app starts correctly without hanging during the sidecar spawn process. - Tested the context menu on various messages (both old and latest). - Confirmed that the "Undo" correctly clears the session state and restores the prompt in the input field. - Verified that right-clicking opens the menu at the correct location and "Copy message" works as expected. - Ran typechecks and linting to ensure no regressions were introduced.
yindo added the pull-request label 2026-02-16 18:17:37 -05:00
yindo closed this issue 2026-02-16 18:17:37 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12727