Diff viewer: vim keys, scrolling, find in diff and an all-files view

Left/right and h/l step between files (or headers in the all-files
view), up/down and j/k scroll, / opens find-in-diff (highlighted
matches across every file, n/N or Enter/Shift+Enter to move, Escape to
close), and a top-bar toggle switches between one file at a time and
every file stacked with collapsible headers, like a pull request's
Files changed tab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 18:13:08 +00:00
parent cfebd3a05b
commit d407a72a06
12 changed files with 1072 additions and 98 deletions
@@ -109,7 +109,7 @@ class ChangeFileRow extends StatelessWidget {
@override
Widget build(BuildContext context) {
final mono = nativeDiffText(DefaultTextStyle.of(context).style);
final leading = Icon(_kindIcon(file.kind));
final leading = Icon(changeKindIcon(file.kind));
final title = Text(file.path, style: mono);
final subtitle = ChangeStatText(changeFileMeta(file));
const trailing = Icon(Icons.chevron_right);
@@ -179,7 +179,8 @@ IconData _noteIcon(_NoteKind kind) => switch (kind) {
_NoteKind.pending => Icons.schedule,
};
IconData _kindIcon(ChangeKind kind) => switch (kind) {
/// The glyph a changed file's kind is drawn with.
IconData changeKindIcon(ChangeKind kind) => switch (kind) {
ChangeKind.added => Icons.add_circle_outline,
ChangeKind.deleted => Icons.delete_outline,
ChangeKind.modified => Icons.edit_outlined,