Skip to content

fix(mobile): show checkout branch for phone-created threads - #9475

Open
Adamulek123 wants to merge 2 commits into
pingdotgg:mainfrom
Adamulek123:fix/mobile-thread-branch-fallback
Open

fix(mobile): show checkout branch for phone-created threads#9475
Adamulek123 wants to merge 2 commits into
pingdotgg:mainfrom
Adamulek123:fix/mobile-thread-branch-fallback

Conversation

@Adamulek123

@Adamulek123 Adamulek123 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Threads created from mobile can persist without a branch while VCS status is still loading, leaving the branch line blank even though the environment has a checked-out branch.

Changes

  • Keep the stored thread branch authoritative when present.
  • For local null-branch threads, reuse the deduplicated live VCS status stream to display the current checkout branch.
  • Apply the fallback to both mobile thread-list implementations; worktree threads remain excluded from the fallback.

Before:

image

After:

image

Testing

  • vp test run apps/mobile/src/state/thread-display-branch.test.ts (5 passed)
  • vp run --filter @t3tools/mobile typecheck
  • Targeted lint on the five changed files (passes with two pre-existing memo dependency warnings outside the diff)
  • Android Emulator (T3_Pixel_API_36) against a disposable local server and a thread fixture with branch = NULL and worktree_path = NULL

Built with GPT-5.6 Codex in T3 Code.


Note

Low Risk
Display-only change with stored branch unchanged for PR/compare logic; reuses an existing VCS status subscription pattern.

Overview
Fixes thread list rows that showed a blank branch when thread.branch was never persisted (common for threads created on phone while VCS status was still loading).

Adds resolveThreadDisplayBranch and useThreadDisplayBranch: stored branch still wins; for local threads with no branch, the row shows the live checkout from the existing deduplicated vcsEnvironment.status query. Worktree threads do not use that fallback.

Both thread-list-items and thread-list-v2-items now render the derived branch in subtitles instead of thread.branch directly. Unit tests cover precedence, worktree exclusion, and trimmed empty strings.

Reviewed by Cursor Bugbot for commit 9f8562a. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Show live checkout branch for phone-created threads in mobile thread list

  • Adds resolveThreadDisplayBranch util and useThreadDisplayBranch hook to resolve a display branch: nonblank stored branch wins, otherwise fall back to the live checkout branch for local threads with a known cwd, and return null for worktree threads or unknown checkouts
  • Updates ThreadListRow and ThreadListV2Row to render the resolved branch in the subtitle instead of thread.branch
  • The hook only subscribes to the environment status query when the thread is local, has no stored branch, and has a usable cwd, avoiding unnecessary queries
  • Risk: threads that previously showed a blank branch label will now show the live checkout branch when available; verify useThreadDisplayBranch in use-thread-display-branch.ts does not trigger status queries for worktree threads

Macroscope summarized 9f8562a.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 3, 2026
Comment thread apps/mobile/src/state/use-thread-display-branch.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 9f8562a

Macroscope's review found this PR approvable — This is a narrowly scoped mobile display fix that falls back to the live checkout branch only for local threads missing a stored branch, while preserving existing branch and worktree behavior. Its added VCS access reuses the existing deduplicated read-only status stream and the resolution logic has focused test coverage.

You can add or adjust custom eligibility rules. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant