diff --git a/TODO.md b/TODO.md index dbcad71..b57c6a1 100644 --- a/TODO.md +++ b/TODO.md @@ -8,7 +8,7 @@ - three tabs: open, closed, all - search under the given category - selecting a pr opens the diff viewer for that pr using the branch merge base (standard github diff view on prs; already implemented as default diff viewer behavior in vamp) -- [ ] move the checkmark in the file picker in the diff viewer right next to the modification type indicator (still left of, but only with a 1 column margin). the modification type indicator should retain it's current position, not be inset further. +- [x] move the checkmark in the file picker in the diff viewer right next to the modification type indicator (still left of, but only with a 1 column margin). the modification type indicator should retain it's current position, not be inset further. - [ ] diff view: github integration (code review) - add comments on a pr, add review comments at specific lines of files, request changes, approve pr, etc. - [ ] diff view: local review comments (same features as for github reviews) that allows review of local changes to deliver specific reviews to ai agents used for coding. - design question: would this require a server that the agent can interact with, or would local review files be fine? don't want to use server client stuff, if it would be easier and better to just use local files. diff --git a/docs/editing.md b/docs/editing.md index b966be2..3bf68b5 100644 --- a/docs/editing.md +++ b/docs/editing.md @@ -422,7 +422,7 @@ Use the ordinary **file-picker/file-explorer actions and bindings**: Space `o` o File rows show colored **A** (added, green), **M** (modified, yellow), **D** (removed, red), or **R** (renamed, cyan) markers in Tree and List views, including filtered results. Rename rows show `R old/path -> new/path`; directories have no file-status marker. Ordinary file exploration remains unannotated. -Mark or unmark a diff file with **`c` while browsing the changed-file tree**, **`:diff.review.toggle`**, or the command-palette action. With the changed-file explorer focused, it toggles the highlighted file without opening it; from a text pane, the command toggles the displayed file. Reviewed files show a green **`✓` in the picker gutter** in Tree and List views. A/M/D/R begins at the tree's indentation column, without extra review-marker padding before the status. Directories and ordinary filesystem pickers cannot be marked. While filtering, including List view, `c` remains query text; use the palette or a control-key binding there. Explicit bindings take precedence over the default browsing shortcut. +Mark or unmark a diff file with **`c` while browsing the changed-file tree**, **`:diff.review.toggle`**, or the command-palette action. With the changed-file explorer focused, it toggles the highlighted file without opening it; from a text pane, the command toggles the displayed file. Reviewed files show a green **`✓` immediately left of A/M/D/R, separated by one blank column**, in Tree and List views. The modification indicator keeps its existing indentation; the review marker uses the preceding gutter space instead of adding padding. Diff rows use the selection background and cursor rather than a `>` prefix. Directories and ordinary filesystem pickers cannot be marked. While filtering, including List view, `c` remains query text; use the palette or a control-key binding there. Explicit bindings take precedence over the default browsing shortcut. Review marks belong only to the open comparison and survive filtering, file navigation, lazy loading, tabs, split/unified/orientation changes, and pinned checkout-only transitions. A new or recomputed comparison clears them. Editing a writable After file clears only that file's mark; unchanged refreshes and saves preserve it. Marks do not change document text, undo history, or repository state, and are not persisted after closing the comparison. diff --git a/src/tui.rs b/src/tui.rs index ab9ee80..39a14bf 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -4694,13 +4694,8 @@ fn draw_file_list( && entry.catalog_index.is_some_and(|index| { changed_files.is_some_and(|(_, reviewed)| reviewed.contains(&index)) }); - spans.push(Span::raw(if selected { ">" } else { " " })); - if changed_files.is_some() { - spans.push(Span::styled( - if reviewed { "✓" } else { " " }, - Style::default().fg(Color::Green), - )); - } else { + if changed_files.is_none() { + spans.push(Span::raw(if selected { ">" } else { " " })); spans.push(Span::raw(" ")); } spans.push(Span::raw(if picker.view == FileView::Tree { @@ -4708,6 +4703,13 @@ fn draw_file_list( } else { String::new() })); + if changed_files.is_some() { + spans.push(Span::styled( + if reviewed { "✓" } else { " " }, + Style::default().fg(Color::Green), + )); + spans.push(Span::raw(" ")); + } if let Some(status) = status { let color = match status { FileStatus::Added => Color::Green, @@ -7320,9 +7322,10 @@ mod tests { .unwrap_or_else(|| panic!("missing {expected}")); assert_eq!(buffer[(x, y)].fg, color); assert_eq!( - buffer[(2, y)].symbol(), + buffer[(x - 2, y)].symbol(), if catalog_index == index { "✓" } else { " " } ); + assert_eq!(buffer[(x - 1, y)].symbol(), " "); let depth = picker .entries() .find(|entry| entry.catalog_index == Some(catalog_index)) @@ -7337,9 +7340,9 @@ mod tests { } ); if catalog_index == index { - assert_eq!(buffer[(2, y)].fg, Color::Green); + assert_eq!(buffer[(x - 2, y)].fg, Color::Green); assert_eq!( - buffer[(2, y)].bg, + buffer[(x - 2, y)].bg, if focused { Color::Blue } else {