Skip to content

feat: add staged and unstaged review options#183

Merged
agavra merged 1 commit intoagavra:mainfrom
bellini666:feat/staged-unstaged-selection
Mar 24, 2026
Merged

feat: add staged and unstaged review options#183
agavra merged 1 commit intoagavra:mainfrom
bellini666:feat/staged-unstaged-selection

Conversation

@bellini666
Copy link
Copy Markdown
Contributor

@bellini666 bellini666 commented Feb 17, 2026

Summary

  • Replace the “Uncommitted changes” selector with separate “Staged changes” and “Unstaged changes” entries, shown only when diffs exist.
  • Support selecting staged, unstaged, both, and combinations with commit ranges, with updated diff source/session handling.
  • Add Git staged/unstaged diff support, update UI/status/export messaging, and add tests.

fixes #204

@snoblenet
Copy link
Copy Markdown
Contributor

look like it needs to be updated against main?

Copilot AI review requested due to automatic review settings March 23, 2026 16:49
@bellini666 bellini666 force-pushed the feat/staged-unstaged-selection branch from 3a45d15 to dd29038 Compare March 23, 2026 16:49
@bellini666 bellini666 force-pushed the feat/staged-unstaged-selection branch from dd29038 to 34ef5c1 Compare March 23, 2026 16:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 VcsBackend with 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.

@bellini666 bellini666 force-pushed the feat/staged-unstaged-selection branch from 34ef5c1 to 5394f14 Compare March 23, 2026 16:55
@agavra agavra self-requested a review March 23, 2026 16:58
@bellini666 bellini666 force-pushed the feat/staged-unstaged-selection branch from 5394f14 to 01e8d80 Compare March 23, 2026 17:04
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());
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we're inserting these at index 0 this will put the staged before unstaged, which is a bit confusing (confirmed this locally)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@bellini666 bellini666 force-pushed the feat/staged-unstaged-selection branch from 01e8d80 to 4a37d4d Compare March 24, 2026 16:39
@bellini666 bellini666 requested a review from agavra March 24, 2026 16:40
Copy link
Copy Markdown
Owner

@agavra agavra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks 🙏

@agavra agavra merged commit 5a7386d into agavra:main Mar 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to review only unstaged changes?

4 participants