Expand description
Code diff viewer: a unified patch as reviewable hunks.
Agents propose edits; people review them. CodeDiff shows one file’s
patch with old/new line gutters, change tints, a copyable source, and,
when reviewable, an Accept / Reject pair per hunk that reports
CodeDiffEvents by file path and hunk index. DiffFile::from_unified
parses standard unified diffs so the application can hand over what a
tool already produced.
The code itself is rendered through the upstream syntax-highlighted, selectable text view; the gutter and change tints are laid out beside it on the same rem-based line height so numbers and lines stay aligned.
Structs§
- Code
Diff - One file’s patch as a card: header with path and statistics, then each hunk with gutters, tints, highlighted selectable code, and optional review controls.
- Diff
File - One file’s patch.
- Diff
Hunk - A contiguous group of changed lines.
- Diff
Line - One line of a hunk with its position on either side.
- Diff
Stats - Added and removed line counts.
Enums§
- Code
Diff Event - An interaction emitted by
CodeDiff. - Diff
Line Kind - Whether a line was kept, added, or removed.
- Hunk
Review - The review decision recorded for a hunk.