Skip to content

feat: inline diff hunk viewer with stage/restore actions #687

@batonogov

Description

@batonogov

Summary

Replace the current broken inline diff accept/revert buttons (which overlap line numbers in the gutter) with a proper inline diff hunk viewer, similar to Zed editor.

Current behavior

Modified lines show garbled accept/revert buttons overlapping line numbers in the gutter (e.g., line 37 displays as "87℃").

Expected behavior

Collapsed state:

  • Yellow marker strip in the gutter next to modified lines — line numbers stay clean and readable

Expanded state (click on marker):

  • Inline hunk expands showing old (deleted) line in red and new line in green
  • Right-aligned action buttons: Stage, Restore
  • Navigation arrows (↓ ↑) to jump between changes

Motivation

Current inline diff UI is unusable — buttons render on top of line numbers. A proper hunk viewer (like Zed) gives users a clear way to review, stage, and restore individual changes.

Implementation ideas

  • Gutter markers: keep yellow/green/red strips, remove current accept/revert buttons
  • On click: insert temporary rows below the changed line showing the diff hunk (old vs new)
  • Action buttons (Stage, Restore) rendered in a toolbar row inside the expanded hunk
  • Navigation arrows to cycle through all hunks in the file
  • Use git diff parsed hunks from GitStatusProvider

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions