Skip to content

fix(mobile): fully unstage renamed files - #34955

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/git-mobile-rename-unstage-fix
Oct 30, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/git-mobile-rename-unstage-fix

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​78 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​78
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​37 $\color{#cf222e}{\Huge{\mathbf{−}}}$​12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​25

Unstaging a staged rename on mobile (e.g. after git mv before.txt after.txt), from either the Source Control row or the diff-review Unstage button, ran git reset -- after.txt only. before.txt stayed staged as a deletion and after.txt became untracked, leaving the rename half-unstaged.

Both surfaces now compute paths with the existing getUnstageablePaths (shared with desktop and mobile Unstage All) and send [path, oldPath] through git.bulkUnstage, matching desktop's use-entry-mutations. Non-rename rows keep the single git.unstage request. git.bulkUnstage predates mobile source control, so no legacy-host fallback is needed.

Validation:

  • New use-mobile-diff-review-git-actions.test.ts asserts a staged rename sends one git.bulkUnstage with both paths; it fails on main.
  • Mobile session + source-control suites: 359 files / 3211 tests pass; mobile tsconfig.json and tsconfig.test.json typecheck clean.
  • pnpm check:changed --maxWorkers=2: 15/15 pass.

Unstaging a staged rename from the Source Control row or diff review
reset only the new path, leaving the old path staged as a deletion.
Send both paths through git.bulkUnstage, matching desktop.
@OrcaWin
OrcaWin force-pushed the OrcaWin/git-mobile-rename-unstage-fix branch from 9bba3fd to 020f5c2 Compare October 30, 2026 09:58
@OrcaWin
OrcaWin marked this pull request as ready for review October 30, 2026 10:02
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 565fb209-a035-4a88-9585-947dcf38491f
Commits

Reviewing files that changed from the base of the PR and between c610633 and 020f5c2.

Files selected for processing: 4
  • mobile/src/session/mobile-diff-review-git-operations.ts
  • mobile/src/session/use-mobile-diff-review-git-actions.test.ts
  • mobile/src/session/use-mobile-diff-review-git-actions.ts
  • mobile/src/source-control/MobileSourceControlFileRows.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Walkthrough

The mobile review hook and source-control rows now derive unstageable paths for staged items. When an item has multiple paths, they send a bulk-unstage request. The hook uses the existing per-file mutation when there is zero or one path. The change also adds a review RPC operation for git.bulkUnstage and a hook test for a staged rename.

Priority: Normal

Merge Risk: Minimal · up to 020f5

Staged renames are sent for unstaging with both paths. No material merge risk was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description accurately explains the bug, implementation, and validation, but it omits most required template sections, including ELI5, Why, Linked Issue, Visual Proof or N/A, Testing checkboxes, A… Update the description to include all required template sections. Add an ELI5 summary, explicit rationale, an actual linked issue, visual proof or N/A with a reason, completed Testing checkboxes, AI Disclosure when applicable, Review, Agent…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: fully unstaging renamed files on mobile.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 4 files.

Full details: Description check

Explanation

The description accurately explains the bug, implementation, and validation, but it omits most required template sections, including ELI5, Why, Linked Issue, Visual Proof or N/A, Testing checkboxes, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist.

Resolution

Update the description to include all required template sections. Add an ELI5 summary, explicit rationale, an actual linked issue, visual proof or N/A with a reason, completed Testing checkboxes, AI Disclosure when applicable, Review, Agent skill upstream boundary, Notes, and Checklist items.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@OrcaWin
OrcaWin merged commit fad768d into main Oct 30, 2026
49 checks passed
@OrcaWin
OrcaWin deleted the OrcaWin/git-mobile-rename-unstage-fix branch October 30, 2026 10:09
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.

1 participant