Skip to content

feat: expandable inline diff hunk viewer with restore action #689

@batonogov

Description

@batonogov

Summary

When user clicks a diff marker in the gutter, expand an inline hunk viewer showing old vs new lines with a Restore button and navigation arrows between hunks.

This is step 2 of #687 — depends on #688 (clean gutter markers).

Motivation

Users need a way to review and restore individual changes directly in the editor, like Zed's inline diff.

Implementation ideas

  • Click on gutter diff marker → insert temporary view below the hunk
  • Show deleted lines (red background) above current lines (green background)
  • Right-aligned toolbar: Restore button (reverts hunk to original), ↓↑ arrows for navigation
  • Stage button can be added later when git staging support is implemented
  • Use parsed hunks from GitStatusProvider (git diff output)
  • Dismiss hunk viewer on click outside or Escape

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions