Skip to content

fix(mobile): show linked pull requests in thread git menus - #31784

Open
wSedlacek wants to merge 1 commit into
pingdotgg:mainfrom
wSedlacek:t3/fix-mobile-view-pr-menu
Open

wSedlacek wants to merge 1 commit into
pingdotgg:mainfrom
wSedlacek:t3/fix-mobile-view-pr-menu

Conversation

@wSedlacek

Copy link
Copy Markdown
Contributor

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.
  • Device verification could not be completed: mobile:install failed because the Cocoapods gem was missing on the machine.

GPT-6 and Codex

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Nov 6, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at a60f71a

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.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

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.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Severity of issue fixed: Medium

Sequence Diagram(s)

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: Passed 4

Check name Status Explanation
Title check Passed The title clearly describes the main mobile git menu change.
Description check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c52df24 and a60f71a.

Files selected for processing: 9

  • apps/mobile/src/features/review/useReviewHeaderPresentation.tsx
  • apps/mobile/src/features/threads/DraftThreadHeader.tsx
  • apps/mobile/src/features/threads/LinkedPullRequestList.tsx
  • apps/mobile/src/features/threads/ThreadHeader.tsx
  • apps/mobile/src/features/threads/ThreadPullRequestsSheet.tsx
  • apps/mobile/src/features/threads/ThreadRouteScreen.tsx
  • apps/mobile/src/features/threads/git/GitOverviewSheet.tsx
  • apps/mobile/src/state/thread-pr-presentation.ts
  • apps/mobile/src/state/use-thread-pr.test.ts

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant