Repository navigation
fix(mobile): use loaded branch for untouched worktree base - #23241
Merged
maria-rcks merged 6 commits intoNov 1, 2026
Merged
maria-rcks merged 6 commits into
maria-rcks merged 6 commits into
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
On mobile, opening Branches & worktrees before Git status loads can leave the new worktree's base set to
main, even after status reportsrelease/stable. Stale thread metadata can leave an old branch in the field instead. Creating the worktree then uses the wrong base or fails if that ref does not exist.Change
Keep only the user's edit in state. Until the field is edited, derive its value from the current branch so a status response updates the default. Once edited, preserve the entered value, including an empty field.
Scope and approval
This is a very small, focused fix for an obvious bug, under the exception in CONTRIBUTING.md: the sheet's default ignores Git status that arrives after it opens. It changes no product default and no other branch-selection flow. No issue or maintainer approval is claimed. It affects the shared iOS and Android sheet. Branch selection elsewhere is unchanged.
Verification
cd apps/mobile && pnpm exec vp test run --project react src/features/threads/git/GitBranchesSheet.test.tsx: base production source fails two cases by submittingmainor stale metadata. Candidate passes all four, including edited and cleared input. No timers or polling. This re-adds the sheet test path that test: delete 11k low-signal tests so CI runs faster and flakes less #22557 pruned; it now covers only the late-status default and its edit-preserving counterpart.pnpm --filter @t3tools/mobile typecheckpasses. Targetedpnpm exec vp lintandpnpm exec vp fmt --checkpass on the sheet, test and mobile test configuration.main; candidate usesrelease/stable. Both candidates create a worktree through the UI, and Git confirms its branch starts at therelease/stablecommit. An edited base also keeps its value after status resumes. Device runs and services were cleaned up.Not checked:
The base retains
mainalongside the checked-outrelease/stablebranch.The candidate's untouched base follows the loaded branch.
Edited bases remain entered:
masteron iOS andcustom-baseon Android.The regression fails on the base and passes on the candidate.
Prior PRs: Jacob's open #20754 changes jj terminology in this sheet and keeps its one-time base initialization, so it does not fix this stale default; it also rewrites the same initializer lines, so whichever lands second needs a small rebase. Julius Marminge's #22980 and Alex's #22551 change this sheet's header and layout only. This patch reuses no code from them.
Generated with GPT-6.1 Sol in T3 Code Nightly