feat: add staged and unstaged review options#183
Conversation
|
look like it needs to be updated against main? |
3a45d15 to
dd29038
Compare
dd29038 to
34ef5c1
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the review scope selection model to distinguish staged vs unstaged working tree changes, plumbing those options through the VCS layer, UI, persistence/session naming, and markdown export.
Changes:
- Extend
VcsBackendwith staged/unstaged diff APIs and implement them for Git. - Replace the prior “uncommitted/working tree” selection with separate “staged” and “unstaged” options and update status/help/export strings accordingly.
- Update session/persistence handling to include new diff-source variants and add tests for Git diff separation + commit selector bookkeeping.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vcs/traits.rs | Adds staged/unstaged diff methods to the backend trait (defaulting to UnsupportedOperation). |
| src/vcs/mod.rs | Re-exports VcsType. |
| src/vcs/git/mod.rs | Wires GitBackend to new staged/unstaged diff functions. |
| src/vcs/git/diff.rs | Implements staged and unstaged diffs in git2 + adds tests. |
| src/ui/status_bar.rs | Updates header labeling for new diff sources. |
| src/ui/help_popup.rs | Updates help text to mention staged/unstaged changes. |
| src/ui/app_layout.rs | Treats staged/unstaged selection rows as “special” in commit selector rendering. |
| src/persistence/storage.rs | Adds new session filename/context keys for staged/unstaged diff sources + tests. |
| src/output/markdown.rs | Updates exported scope labels and review intro text for new diff sources + adjusts test expectation. |
| src/model/review.rs | Extends SessionDiffSource with staged/unstaged variants. |
| src/main.rs | Updates CLI error hint text. |
| src/handler.rs | Updates error message when exiting commit select mode. |
| src/app.rs | Core behavioral change: staged/unstaged selection entries, loading logic, and new session source handling + tests. |
| README.md | Documents staged/unstaged entries in commit selection mode. |
| PLAN.md | Updates manual test instructions to staged/unstaged wording. |
| AGENTS.md | Updates architecture doc wording to staged/unstaged selection rows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
34ef5c1 to
5394f14
Compare
5394f14 to
01e8d80
Compare
src/app.rs
Outdated
| if working_tree_diff.is_some() { | ||
| commit_list.insert(0, Self::working_tree_commit_entry()); | ||
| if has_unstaged_changes { | ||
| commit_list.insert(0, Self::unstaged_commit_entry()); |
There was a problem hiding this comment.
since we're inserting these at index 0 this will put the staged before unstaged, which is a bit confusing (confirmed this locally)
There was a problem hiding this comment.
Good catch — fixed. Swapped the insert order so the list reads [Unstaged, Staged, ...] which feels more natural (unstaged = current working state, staged = ready to commit).
01e8d80 to
4a37d4d
Compare
Summary
fixes #204