fix(mobile): local-checkout threads record their branch so PR badges show - #4986
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: Approved ff916b0 Straightforward bug fix that adds a simple branch resolution function with unit tests. The change ensures local-checkout threads properly record their branch name so PR badges display correctly - limited scope with clear intent. You can customize Macroscope's approvability policy. Learn more. |
44c1b4e to
0f5683d
Compare
Dismissing prior approval to re-evaluate 0f5683d
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0f5683d. Configure here.
…show A thread created from the mobile composer with the untouched current-checkout default persisted branch: null, and the thread row's PR hook never subscribes or matches on a null branch, so an open PR stayed invisible. Online creation now records the live checkout ref from the project's git status stream - the same value the PR matcher compares against. An explicit picker choice still wins, and a detached HEAD, non-repository project, or not-yet-loaded status stays null rather than fabricating a branch. Queued offline tasks still record only explicit choices, since a queue-time guess would go stale by the time the outbox drains.
Co-authored-by: codex <codex@users.noreply.github.com>
0f5683d to
ff916b0
Compare
Dismissing prior approval to re-evaluate ff916b0
## What's Changed * fix(desktop): route mouse thumb buttons to the in-app browser by @akosbalogh in pingdotgg/t3code#4459 * fix(web): keep the final segment of directory paths with a trailing separator by @jorvarea in pingdotgg/t3code#5460 * Keep block code plain when copying from rendered markdown by @yashranaway in pingdotgg/t3code#4468 * fix(web): add web app manifest so installed app keeps its scope by @Albro3459 in pingdotgg/t3code#4306 * Skip user hooks during Claude capability probes by @yashranaway in pingdotgg/t3code#4466 * fix(mobile): use Android monospace font family by @tastelessjolt in pingdotgg/t3code#4609 * fix(desktop): timestamps follow the OS locale instead of en-US by @brzzdev in pingdotgg/t3code#6190 * fix(web): keep multi-select questions open after the first click by @RaitP1 in pingdotgg/t3code#6646 * fix(web): stop clipping the changed-files expand hover on Windows by @mrmg in pingdotgg/t3code#6545 * fix(server): allow long-running git pushes by @devchaudhary24k in pingdotgg/t3code#6499 * fix(desktop): keep probing backend readiness while the process is alive by @lgwacker in pingdotgg/t3code#5526 * fix(server): allow install scripts in npm-global provider updates by @hey-jj in pingdotgg/t3code#5646 * fix: detect SSH remotes with non-git user prefixes (e.g. gitlab@) by @JackatDJL in pingdotgg/t3code#3649 * fix(web): describe what Ultracode does in the Reasoning picker by @delltrak in pingdotgg/t3code#6092 * fix(server): settle pending user-input requests when a Claude session stops by @AaronAbuUsama in pingdotgg/t3code#5127 * fix(server): stop replaying a command receipt for a different aggregate by @ostapondo in pingdotgg/t3code#5246 * fix(server): settle snoozed threads immediately by @0bkevin in pingdotgg/t3code#5379 * fix(mobile): prevent crash on sign out in settings by @shubhu121 in pingdotgg/t3code#4899 * fix(mobile): local-checkout threads record their branch so PR badges show by @Zeus-Deus in pingdotgg/t3code#4986 * fix(web): contain long approval commands by @Serendeep in pingdotgg/t3code#6503 * feat(web): make right panel maximize bindable by @husseinraoouf in pingdotgg/t3code#5091 * fix(server): respect inherited OPENCODE_CONFIG_CONTENT by @jonocodes in pingdotgg/t3code#4242 * fix(marketing): detect Mac chip on homepage download button by @mahdibm-dev in pingdotgg/t3code#4197 * Keep the server alive when a response write hits a dead socket by @yashranaway in pingdotgg/t3code#4470 * Limit physical key fallback to non-Latin layout output by @yashranaway in pingdotgg/t3code#4469 * fix: restore CLAUDE.md symlink target by @NgoQuocViet2001 in pingdotgg/t3code#3929 * fix(clients): default clone destination to folder plus repo name by @inayayousfi in pingdotgg/t3code#5989 * fix(web): keep timestamp date and time in the same locale by @juliusmarminge in pingdotgg/t3code#7081 * feat(desktop): add signal macOS DMG installer background by @Brechard in pingdotgg/t3code#6201 ## New Contributors * @akosbalogh made their first contribution in pingdotgg/t3code#4459 * @jorvarea made their first contribution in pingdotgg/t3code#5460 * @yashranaway made their first contribution in pingdotgg/t3code#4468 * @Albro3459 made their first contribution in pingdotgg/t3code#4306 * @tastelessjolt made their first contribution in pingdotgg/t3code#4609 * @brzzdev made their first contribution in pingdotgg/t3code#6190 * @RaitP1 made their first contribution in pingdotgg/t3code#6646 * @devchaudhary24k made their first contribution in pingdotgg/t3code#6499 * @lgwacker made their first contribution in pingdotgg/t3code#5526 * @JackatDJL made their first contribution in pingdotgg/t3code#3649 * @delltrak made their first contribution in pingdotgg/t3code#6092 * @AaronAbuUsama made their first contribution in pingdotgg/t3code#5127 * @0bkevin made their first contribution in pingdotgg/t3code#5379 * @shubhu121 made their first contribution in pingdotgg/t3code#4899 * @Zeus-Deus made their first contribution in pingdotgg/t3code#4986 * @husseinraoouf made their first contribution in pingdotgg/t3code#5091 * @jonocodes made their first contribution in pingdotgg/t3code#4242 * @mahdibm-dev made their first contribution in pingdotgg/t3code#4197 * @NgoQuocViet2001 made their first contribution in pingdotgg/t3code#3929 * @inayayousfi made their first contribution in pingdotgg/t3code#5989 **Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260815.1101...v0.0.34-nightly.20260815.1102 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260815.1102

Fixes #4951
Problem
Creating a thread from the mobile composer with the untouched current-checkout default persisted
branch: null: the local workspace mode never writes aworkspaceSelectioninto the draft, and the automatic branch selection effect only runs for worktree mode.useThreadPrrefuses to subscribe whenthread.branch === nulland matches on exact equality with the livestatus.refName, so an open PR for the work was never surfaced on the thread row — while threads with explicit branch metadata showed their badge fine.Fix
Online creation now resolves the branch through a small pure helper,
resolveProjectThreadCreationBranch: an explicit picker choice always wins; an untouched local-checkout draft records the live checkout ref; worktree mode is unchanged. The current checkout comes from the project'svcsEnvironment.statusstream (refName) — the exact value the PR matcher compares against, parsed fresh per publish — not from the ref list, whosecurrentflag is served from a server-side cache with a 10-minute TTL. The subscription is deduped per(environmentId, cwd)with the ones thread rows already open and lives only while the composer sheet is mounted.No branch is ever fabricated: a detached HEAD, a non-repository project, or a status that has not arrived yet all resolve to
null, i.e. exactly the pre-fix behavior. Nothing is written back into the draft'sworkspaceSelection, so the untouched default stays distinguishable from an explicit choice.Scope note: queued/offline tasks still record only explicit choices. A queued local task drains against whatever is checked out at drain time, so recording a queue-time guess would pin a stale branch to a thread that ran somewhere else; that trade is commented at the call site.
Visible side effects: mobile-created local threads now show a branch label on their rows and become eligible for web's informational local-checkout mismatch banner, the same treatment web gives its own local threads (web self-heals the branch on next send). Composer sessions open one deduped status subscription per project cwd.
Tests
New
projectThreadCreationValidation.test.tswith 5 cases: the regression (untouched local default records the checkout), explicit selection wins (local and worktree), no checked-out ref stays null, and worktree mode never borrows the checkout. Each behavior was mutation-checked (reverting it fails exactly its test). Scoped mobile typecheck, lint, and format checks are green, plus adjacent suites (thread-outbox, threadListV2, use-thread-pr — 45 tests). Verified via unit tests on Linux; no native iOS run was performed.Implemented and reviewed with Claude Code (Fable 5).
Note
Low Risk
Scoped mobile composer/thread-creation logic with a pure helper and deduped existing VCS status queries; no auth or server changes.
Overview
Fixes #4951 by persisting a branch on mobile threads created from the default local-checkout composer, so PR badges and row branch labels can match live git status.
Adds
resolveProjectThreadCreationBranch: explicit picker choice wins; otherwise local mode uses the live checkout ref fromvcsEnvironment.status(refName), not the branch list’s cachedcurrentflag. Worktree mode and detached / missing status still resolve tonull.NewTaskFlowProviderexposescurrentCheckoutBranchNamewhile the composer is open;NewTaskDraftScreenuses the helper for the displayed branch label and thecreateProjectThreadpayload.Queued/offline tasks are unchanged: only explicit
workspaceSelection.branchis stored, with a comment that a queue-time checkout guess would go stale at drain time. Five unit tests cover the resolver matrix.Reviewed by Cursor Bugbot for commit ff916b0. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Record live checkout branch on local-checkout threads so PR badges display
resolveProjectThreadCreationBranchin projectThreadCreationValidation.ts to determine which branch to record: uses the explicit picker selection if provided, falls back to the live checked-out branch for local workspace mode, and returnsnullfor worktree mode without an explicit selection.currentCheckoutBranchNamefrom live VCS status in new-task-flow-provider.tsx by issuing avcsEnvironmentstatus query for the selected environment/cwd.createProjectThread, so threads created without an explicit branch selection still record the current checkout.Macroscope summarized ff916b0.
Screenshots (Android emulator, synthetic data)
Verified end-to-end on a Linux-hosted Android emulator against a disposable local T3 environment with a synthetic git repo checked out on
feature/checkout-demo. Threads created on pre-fix code persisted an emptybranch; the thread created with this fix live recordedfeature/checkout-demo(confirmed inprojection_threads), and the row shows the branch label. iOS behavior is the same shared React Native code path.