You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The mobile Branches & worktrees sheet can show the right base branch but silently create a worktree from a different commit. The submit handler strips trailing Unicode whitespace even when it is part of a valid Git ref.
Deterministic repro on origin/main (9b85186ca9c799cee2b1358f1b6502183d2bc159)
Add $repo as a regular local project with no tracked folders or worktree layout. Open an existing, idle thread in the local checkout on $nbsp_branch (Replay (dev) is sufficient). In the thread's Git menu, choose More → Branches & worktrees. Leave Base branch untouched, enter feature/new-worktree as the new branch, then tap Create worktree. Use git -C "$repo" worktree list --porcelain to find the new worktree and run git -C "$worktree" rev-parse HEAD with that path.
Observed: the sheet submits release to vcs.createWorktree; Git creates the feature branch from plain, and the new worktree's HEAD equals git -C "$repo" rev-parse refs/heads/release.
Expected: the sheet submits release plus U+00A0; the new worktree's HEAD equals git -C "$repo" rev-parse "refs/heads/$nbsp_branch" (nbsp). Pasted ASCII padding should still be removed.
Change
Normalize the base ref with the shared ASCII-only trim used by the Git ref contract. Reuse the result for the disabled check and the submitted value on iOS and Android. The web picker and server contract already preserve the exact ref; no other surface, provider, or UI copy changes.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
Both focused sheet tests failed on the pinned base (submitted release) and passed with the fix (submitted release plus U+00A0), with and without pasted ASCII padding.
vp run check:changed exited 0: formatting, lint, knip, typecheck, 13 affected tests, and 6 React Compiler cases passed.
Before/after transcript: passed the sheet's submit expression through the real RPC schema, then created worktrees in disposable Git. HEAD changed from plain to nbsp.
Not shown: native iOS/Android screenshots or a full native client-to-server run; the proof uses the rendered sheet test and a separate Git checkout check.
Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).
Macroscope's review found this PR approvable — The mobile worktree form now preserves valid Unicode whitespace in base-branch names instead of stripping it. The change retains existing action guards and introduces no material change to defaults or operational exposure.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between 68a606e and 675b2f7.
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
No actionable comments were generated in the recent review.
Walkthrough
The worktree sheet now uses trimAsciiWhitespace to check whether a base ref is empty. Tests cover creating a worktree with a base ref that contains a non-breaking space, both with and without added surrounding whitespace.
Changes: Worktree base ref handling
Layer / File(s)
Summary
Base-ref validation and creation apps/mobile/src/features/threads/git/GitBranchesSheet.tsx, apps/mobile/src/features/threads/git/GitBranchesSheet.test.tsx
The sheet checks the base ref using trimAsciiWhitespace and uses the computed value during worktree creation. Tests verify that a base ref containing a non-breaking space is preserved when unchanged or surrounded by whitespace.
The mobile worktree sheet now keeps a trailing non-breaking space in the base branch name and still removes pasted ASCII padding, so worktrees are created from the exact ref. The change is small and reversible, and the focused tests cover the fixed behavior, so no actionable merge risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the mobile area and the core change: worktrees are created from the exact base branch. The raw summary and objectives both describe a trim change that keeps trailing Unicode whitespace…
Description check
The description covers the required template sections. Problem gives the bug, a reproduction, and expected behavior. Change explains the shared ASCII-only trim. Scope says it is a small bug fix and ne…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the mobile area and the core change: worktrees are created from the exact base branch. The raw summary and objectives both describe a trim change that keeps trailing Unicode whitespace in the base ref. The title matches the main change and is specific enough for history scanning.
Full details: Description check
Explanation
The description covers the required template sections. Problem gives the bug, a reproduction, and expected behavior. Change explains the shared ASCII-only trim. Scope says it is a small bug fix and needs no issue. Verification lists focused tests, a check run, and a before/after transcript, and it states what was not verified (native screenshots and a full native run). The template's conventional-commit title guidance is also satisfied. The description is complete and specific.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Android Pixel 9 emulator, API 36, portrait 1080 × 2424, light theme. Each commit ran its own real server and Metro bundle with fresh isolated data and the same synthetic Git repository/thread setup. Replay (dev) only supplied the initial idle turn.
Check out release\u00a0; plain release has f = plain, while the NBSP branch has f = nbsp at a different commit.
Open the idle thread → Git controls → More → Branches & worktrees.
Leave Base branch untouched, enter feature/new-worktree, and tap Create worktree.
Open Files → f and read the resulting worktree. Read-only Git inspection independently confirms its HEAD.
Observed: base selects the plain release commit; head selects the NBSP release commit. The stills were accepted only after two app-area captures more than 500 ms apart were pixel-identical; their 70-pixel system status bars are cropped. Videos are resized and end with a labeled three-second result still because Android screenrecord can omit the static final view. Original recordings: before, after.
Additional head-only check: literal \\trelease\\u00a0\\t was confirmed character-for-character in the accessibility tree, submitted as the base for feature/padded, and produced the NBSP commit with f = nbsp: recording, result still, captured field code points and result.
The ASCII-padded variant was an additional head-only check; its base behavior was not separately captured. The paired base/head proof uses the reported untouched Base branch reproduction.
iOS was not verified: both scenario attempts stopped before launch with an incompatible remote daemon RPC protocol. The reported Android flow was completed on both commits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The mobile Branches & worktrees sheet can show the right base branch but silently create a worktree from a different commit. The submit handler strips trailing Unicode whitespace even when it is part of a valid Git ref.
Deterministic repro on
origin/main(9b85186ca9c799cee2b1358f1b6502183d2bc159)Add
$repoas a regular local project with no tracked folders or worktree layout. Open an existing, idle thread in the local checkout on$nbsp_branch(Replay (dev) is sufficient). In the thread's Git menu, choose More → Branches & worktrees. Leave Base branch untouched, enterfeature/new-worktreeas the new branch, then tap Create worktree. Usegit -C "$repo" worktree list --porcelainto find the new worktree and rungit -C "$worktree" rev-parse HEADwith that path.releasetovcs.createWorktree; Git creates the feature branch fromplain, and the new worktree's HEAD equalsgit -C "$repo" rev-parse refs/heads/release.releaseplus U+00A0; the new worktree's HEAD equalsgit -C "$repo" rev-parse "refs/heads/$nbsp_branch"(nbsp). Pasted ASCII padding should still be removed.Change
Normalize the base ref with the shared ASCII-only trim used by the Git ref contract. Reuse the result for the disabled check and the submitted value on iOS and Android. The web picker and server contract already preserve the exact ref; no other surface, provider, or UI copy changes.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
release) and passed with the fix (submittedreleaseplus U+00A0), with and without pasted ASCII padding.vp run check:changedexited 0: formatting, lint, knip, typecheck, 13 affected tests, and 6 React Compiler cases passed.plaintonbsp.Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).