Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): omit linked-prompt warning when a PR link has no prompt #48308

Opensaphid(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/48308/headopened View on GitHub

Problem

On mobile, a pull-request link without a prompt can show a “Prompt from a link” alert when PR details fail to load, even though the draft is empty.

Deterministic repro on origin/main (43328e8f0a680a491c84995b398f5c635ff37a90)

  • App fixture: pair with a fresh local server and add a Git repo with origin set to https://github.com/pingdotgg/t3code.git. Leave it without a linked thread for PR #123. Make GitHub unreachable from that server while keeping the mobile connection up, then open t3code://new?pr=pingdotgg/t3code/123 (t3code-dev:// in the dev client).
  • The new route parses the link with prompt: null. With a matching project and no linked thread, resolveLink calls openProjectDraft. A failed composerPullRequests.detail read sets pullRequestUnavailable to 123. The draft stays empty, and showPromptLinkNotice passes the title and body to the mobile dialog.
  • Focused fixture: apply only the regression test to base and run vp test run apps/mobile/src/features/prompt-links/prompt-link-model.test.ts -t 'shows only the fallback for an unavailable pull request without a prompt'. The test passes { hasPrompt: false, hiddenCharacters: 0, pullRequestUnavailable: 123 } to the notice formatter.
  • Observed: The alert is titled “Prompt from a link,” and the body starts with “This prompt came from a link. Read it before you send.” before the PR fallback.
  • Expected: The alert is titled “PR #123,” and the body is only “Pull request #123 could not be loaded, so this task starts from your default branch.”

Change

Pass prompt presence from the mobile draft flow to the shared iOS/Android notice code. When a promptless link cannot load its PR, use the existing localized PR number as the title and show only the fallback; prompt-bearing links keep their title and warnings. No web, desktop, server, contract, or translation catalog changes are needed.

Scope

Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.

Verification

  • The focused regression failed on base with the extra warning in the received body. On the fix, all seven tests in the file passed, including checks for the PR-number title and for retaining the warning and title on prompt-bearing links.
  • vp run check:changed exited 0 through commit-checked.sh: format, lint, Knip, affected typechecks and tests, and React Compiler checks passed.
  • Mobile catalog generation found no changes, and vp run i18n:check passed.
  • Before/after test transcript.
  • Not shown: Native before/after screenshots or an end-to-end device run. The required Android dev client was not cached and its build could not start without Java on the checkout host; iOS was not exercised.

Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).

    1. tanstack-source added labelsbug

    2. Approvability

      Verdict: Approved at 11c9491

      Macroscope's review found this PR approvable — This removes an inapplicable prompt warning from mobile PR links that contain no prompt and gives PR-loading failures a matching title. Actual prompt warnings and existing model and branch fallback notices remain intact.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      The prompt-link notice now indicates whether the link contains a prompt. When a pull request is unavailable and no prompt is present, the notice uses the pull-request number as its title and omits the generic prompt-link notice.

      Changes: Prompt-link notice

      Layer / File(s)Summary
      Notice selection and display
      apps/mobile/src/features/prompt-links/prompt-link-model.ts, apps/mobile/src/features/prompt-links/prompt-link-actions.ts, apps/mobile/src/features/prompt-links/newTaskPromptLink.ts, apps/mobile/src/features/prompt-links/prompt-link-model.test.ts
      The notice model omits the generic prompt-link notice when hasPrompt is false. The title helper uses the pull-request number when provided. The call site passes prompt presence and the unavailable pull-request number. Tests cover notice text and title selection.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Suggested reviewers: chenxin-yan

      Merge Risk: Minimal · up to 11c94

      This change makes the mobile alert for a promptless pull-request link show the PR number as its title and only the fallback message. Other prompt links keep their existing title and warnings. No merge-blocking risk remains.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title "fix(mobile): omit linked-prompt warning when a PR link has no prompt" matches the main change. The change stops the "Prompt from a link" warning and title from appearing when a promptless P…
      Description checkPassedThe description follows the repository template. It has Problem, Change, Scope, and Verification sections. The Problem section gives a reproduction path and expected and observed behavior. The Change …
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Title check

      Explanation

      The title "fix(mobile): omit linked-prompt warning when a PR link has no prompt" matches the main change. The change stops the "Prompt from a link" warning and title from appearing when a promptless PR link fails to load its PR details, and it uses the PR-number title instead. The title is a conventional commit, short, and specific.

      Full details: Description check

      Explanation

      The description follows the repository template. It has Problem, Change, Scope, and Verification sections. The Problem section gives a reproduction path and expected and observed behavior. The Change section explains the fix and its limits. The Scope section says why no issue is linked, which the template allows for small obvious bugs. The Verification section lists focused test results, the changed-check run, and the i18n check, and it states what was not checked (native screenshots and device run). The template asks for before/after screenshots for UI changes. The author did not provide them, but the description states this gap and gives a reason. The description is mostly complete.

      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 85b15b92e0f529154677801e072b1e0c3b007433 and 11c94913a4c6b0a8290cd4458ea56cdd1e100cdd.

      Files selected for processing: 4

      • apps/mobile/src/features/prompt-links/newTaskPromptLink.ts
      • apps/mobile/src/features/prompt-links/prompt-link-actions.ts
      • apps/mobile/src/features/prompt-links/prompt-link-model.test.ts
      • apps/mobile/src/features/prompt-links/prompt-link-model.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Sign in to join this conversation.