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
{{ message }}
Repository navigation
fix(mobile): show linked pull requests in thread git menus - #31784
Mobile git menus sometimes showed “Create PR” instead of “View PR” when a thread’s open pull request was linked to a different ref than the current checkout. Linked pull requests could also be missing from the thread header or list when server capability information was unavailable.
Change
Use the thread’s open linked pull request as a fallback for git menu presentation when the checkout has no open PR, while preserving the checkout’s own open PR when present. Apply this to the thread and draft headers, Review menu, and Git overview sheet. Show existing linked PRs in the header and list even when the server cannot report support for changing them; capabilities still gate those actions.
Scope and approval
This is a focused mobile bug fix: the existing thread PR links and git menu already provide these actions, but presentation could miss a PR associated with another ref. The change makes the existing linked PR visible across the affected mobile entry points.
Verification
vp test run apps/mobile/src/state/use-thread-pr.test.ts — passed (14 tests), including linked open PR fallback, legacy links, checkout PR precedence, and closed or merged links.
vp run check:changed — passed.
Device verification could not be completed: mobile:install failed because the Cocoapods gem was missing on the machine.
Macroscope's review found this PR approvable — Mobile thread headers and git menus now expose existing linked pull requests, while preserving checkout PR precedence. The change reuses existing navigation and user-triggered actions without altering stored links or permissions.
You can add or adjust custom eligibility rules. Learn more.
No actionable comments were generated in the recent review.
Walkthrough
Mobile Git and review surfaces now use eligible linked thread pull requests when presenting Git status. Thread headers expose an action for linked pull requests, and linked pull-request line resolution no longer depends on runtime configuration.
Changes: Linked pull-request presentation
Layer / File(s)
Summary
Resolve linked pull requests into Git status apps/mobile/src/state/thread-pr-presentation.ts, apps/mobile/src/state/use-thread-pr.test.ts
withThreadOpenPullRequest adds an eligible linked pull request to status when checkout status has no open pull request. Tests cover open, closed, merged, and legacy links, plus checkout status that already has an open pull request.
Use linked pull requests in Git surfaces apps/mobile/src/features/review/useReviewHeaderPresentation.tsx, apps/mobile/src/features/threads/DraftThreadHeader.tsx, apps/mobile/src/features/threads/ThreadRouteScreen.tsx, apps/mobile/src/features/threads/git/GitOverviewSheet.tsx
Review and thread Git surfaces pass status, thread links, and runtime capability to the helper. The Git overview uses the transformed status for its labels, actions, and status details.
Show linked pull-request actions in thread headers apps/mobile/src/features/threads/ThreadHeader.tsx, apps/mobile/src/features/threads/LinkedPullRequestList.tsx, apps/mobile/src/features/threads/ThreadPullRequestsSheet.tsx
Thread headers receive the thread and show an action when it has a linked pull request. Linked pull-request lines resolve from thread links without runtime state, and the sheet calls the updated hook signature.
sequenceDiagram
participant GitOverviewSheetContent
participant GitStatusQuery
participant withThreadOpenPullRequest
participant GitMenu
GitOverviewSheetContent->>GitStatusQuery: Read checkout status
GitStatusQuery-->>GitOverviewSheetContent: Return status or null
GitOverviewSheetContent->>withThreadOpenPullRequest: Pass status, thread links, and capability
withThreadOpenPullRequest-->>GitOverviewSheetContent: Return transformed status
GitOverviewSheetContent->>GitMenu: Build actions from transformed status
Loading
Possibly related issues
pingdotgg/t3code#17716 — Describes mobile Git actions missing an open linked pull request and offering “Create PR” instead of “View PR.”
Possibly related PRs
pingdotgg/t3code#29412 — Moves the Review Git menu into a shared hook; this change supplies linked pull-request status to that menu.
pingdotgg/t3code#26254 — Makes Review and Git overview status and actions repository-specific, relevant to the thread-linked fallback.
pingdotgg/t3code#31657 — Selects a repository worktree for mobile Git status and actions, which this change also augments with thread-linked pull-request status.
Suggested reviewers:juliusmarminge
Merge Risk: Minimal · up to a60f7
Linked pull requests appear in the reviewed mobile Git surfaces, and the inspected controls still operate on the checkout. No issue identified here needs resolution before merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title clearly describes the main mobile git menu change.
Description check
The description covers the problem, change, scope, and verification. It explains why device verification was not completed, but does not include the required before-and-after screenshots.
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.
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; 9 remain after this review.
This branch has not been deployed
No deployments
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:L100-499 changed lines (additions + deletions).vouch:unvouchedPR author is not yet trusted in the VOUCHED list.
1 participant
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
Mobile git menus sometimes showed “Create PR” instead of “View PR” when a thread’s open pull request was linked to a different ref than the current checkout. Linked pull requests could also be missing from the thread header or list when server capability information was unavailable.
Change
Use the thread’s open linked pull request as a fallback for git menu presentation when the checkout has no open PR, while preserving the checkout’s own open PR when present. Apply this to the thread and draft headers, Review menu, and Git overview sheet. Show existing linked PRs in the header and list even when the server cannot report support for changing them; capabilities still gate those actions.
Scope and approval
This is a focused mobile bug fix: the existing thread PR links and git menu already provide these actions, but presentation could miss a PR associated with another ref. The change makes the existing linked PR visible across the affected mobile entry points.
Verification
vp test run apps/mobile/src/state/use-thread-pr.test.ts— passed (14 tests), including linked open PR fallback, legacy links, checkout PR precedence, and closed or merged links.vp run check:changed— passed.mobile:installfailed because the Cocoapods gem was missing on the machine.GPT-6 and Codex