Skip to content

Add selective file staging to commit dialog#872

Open
GuilhermeVieiraDev wants to merge 1 commit intopingdotgg:mainfrom
GuilhermeVieiraDev:feat/selective-file-commit
Open

Add selective file staging to commit dialog#872
GuilhermeVieiraDev wants to merge 1 commit intopingdotgg:mainfrom
GuilhermeVieiraDev:feat/selective-file-commit

Conversation

@GuilhermeVieiraDev
Copy link

@GuilhermeVieiraDev GuilhermeVieiraDev commented Mar 11, 2026

What Changed

Added checkboxes to the commit dialog file list so users can include/exclude specific files from a commit.

  • Each file row now has a checkbox; unchecking a file excludes it from staging
  • A select-all/none header checkbox toggles all files at once
  • Totals update to reflect only selected files
  • Commit buttons are disabled when no files are selected
  • When all files are checked, existing git add -A behavior is preserved
  • When some files are unchecked, only selected paths are staged via git add -A -- <paths>

Why

The commit flow currently stages all working tree changes with no way to exclude specific files. This is a common need when working across multiple files but only wanting to commit a subset.

UI Changes

Before:

2026-03-11_00-16

After:

2026-03-11_00-16_1 2026-03-11_00-16_2 2026-03-11_00-19

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Add selective file staging to commit dialog

  • Adds per-file checkboxes to the commit dialog in GitActionsControl.tsx, including a 'select all' toggle; commit buttons are disabled when no files are selected.
  • Extends GitCore.prepareCommitContext to accept an optional filePaths array; when provided, it runs git reset then git add -A -- <filePaths> instead of staging all changes.
  • Propagates filePaths through GitManager.runStackedAction, runCommitStep, runFeatureBranchStep, and resolveCommitAndBranchSuggestion so commit/branch suggestions and the final commit reflect only the selected files.
  • Adds filePaths to the GitRunStackedActionInput contract schema as an optional non-empty array of trimmed strings, and forwards it through the React Query mutation.
  • Behavioral Change: when filePaths is provided, a git reset is run before selective staging, which unstages any previously staged changes outside the selection.

Macroscope summarized 1174bc1.

Add checkboxes to the commit dialog file list so users can
include/exclude specific files from a commit. When some files are
unchecked, only the selected paths are staged via `git add -A -- <paths>`
instead of `git add -A`. All files are checked by default to preserve
existing behavior.

- Add optional `filePaths` field to `GitRunStackedActionInput` contract
- Update `prepareCommitContext` to accept and use selective file paths
- Thread `filePaths` through manager, mutation, and UI action handlers
- Add select-all/none checkbox header and per-file checkboxes in dialog
- Disable commit buttons when no files are selected
- Update totals to reflect selected files only
- Add integration tests for selective staging in GitCore and GitManager
@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 35727aaf-9fa1-479a-a790-149b1b3892e8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant