Skip to content

[Feature]: Add Undo/Rewind support in the Diff tab #4070

Description

@Fazalkadivar21

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I am describing a concrete problem or use case, not just a vague idea.

Area

apps/desktop

Problem or use case

When reviewing changes in the Diff tab, it's easy to realize that the last edit wasn't what you wanted. Currently, reverting requires leaving the current workflow or manually restoring the previous state, which interrupts the editing experience.

Proposed solution

Add an Undo (or Rewind) action in the Diff tab that reverts the latest change and updates the diff accordingly.

Possible implementations:

  • Add an Undo button in the Diff tab toolbar.
  • Support the standard keyboard shortcut (Ctrl/Cmd + Z) while the Diff tab is focused.
  • Refresh the displayed diff immediately after the undo operation.

Why this matters

Having an Undo/Rewind action in the Diff tab makes it easier to recover from accidental edits and iterate on changes without leaving the current workflow. This creates a smoother editing experience and reduces unnecessary context switching.

Smallest useful scope

Add an Undo/Rewind button to the Diff tab that reverts the most recent change and refreshes the displayed diff. More advanced features, such as multi-level undo history or redo support, can be considered separately.

Alternatives considered

Users can currently leave the Diff tab and use existing editing or version control workflows to revert changes. While functional, this interrupts the review process and requires extra steps compared to having an Undo/Rewind action directly in the Diff tab.

Risks or tradeoffs

Adding an Undo/Rewind action introduces additional UI and requires it to stay in sync with the application's existing undo history. Care should also be taken to ensure users clearly understand what will be undone, especially if edits can originate from multiple places.

Examples or references

Examples of similar workflows can be found in editors such as VS Code and JetBrains IDEs, where users can immediately undo recent edits while reviewing changes without interrupting their workflow. The proposed feature aims to provide a similarly seamless experience within the Diff tab.

Contribution

  • I would be open to helping implement this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequested improvement or new capability.needs-triageIssue needs maintainer review and initial categorization.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions