Skip to content

fix(mobile): open t3code://pair links from t3 pair in the Add environment form - #1

Open
NorthIsUp wants to merge 1 commit into
mainfrom
fix/mobile-pair-app-link
Open

NorthIsUp wants to merge 1 commit into
mainfrom
fix/mobile-pair-app-link

Conversation

@NorthIsUp

@NorthIsUp NorthIsUp commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

t3 pair prints App link: t3code://pair?pairingUrl=…. The desktop app handles that link. The mobile app registers the t3code schemes but has no pair route, so a release build opens NotFound.

This rewrites the link's path to connections/new?pairingUrl=… in getAppStateFromPath and lets release builds honor that prefill. The Add environment form opens with the host and code filled in, and the user taps Connect. Pairing, errors, haptics and the exit all come from the form's existing handleSubmit.

The trust stays the same as today: the in-app QR scanner already fills this form from any scanned payload, including this exact t3code://pair format. That's why the __DEV__ prefill gate can go. Dev auto-connect stays dev-only. Only the pairing URL survives the rewrite, so a link still can't set routeFor (and withoutPairingTarget strips it anyway). A link that arrives while the form is open replaces its contents via pairingFormLinkAction. Desktop asks a direct "Add the backend at X?" question; here the filled-in form, which shows the scheme in the host, is the question.

How I checked it:

  • appLinking.test.ts: the rewrite, the leading-slash path, extra params being dropped, and other links left alone.
  • ConnectionsNewRouteScreen.test.tsx: a release build (__DEV__ false) fills host and code from pairingUrl and doesn't connect. This test fails with the old gate.
  • pnpm run check:changed passes on Node 26.13.1.

Not yet done:

  • Device run on iOS and Android: cold start and warm link, then Connect.
  • Screenshots of the filled form (before: NotFound). UI change, so the screenshots are still needed.

🤖 Generated with Claude Code

@NorthIsUp

Copy link
Copy Markdown
Owner Author

Upstream bug: pingdotgg#40666

@NorthIsUp
NorthIsUp force-pushed the fix/mobile-pair-app-link branch from 6021bc9 to 8e4f89c Compare November 22, 2026 05:19
@NorthIsUp NorthIsUp changed the title fix(mobile): t3 pair's app link opens NotFound on mobile fix(mobile): open t3code://pair links from t3 pair in the Add environment form Nov 22, 2026
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XXL labels Nov 22, 2026
…onment form

`t3 pair` prints a `t3code://pair?pairingUrl=…` app link. Desktop handles
it; the mobile app has no `pair` route, so a release build opens NotFound.

The link path now rewrites to `connections/new?pairingUrl=…`, and release
builds honor that prefill. The user sees the host and code and taps Connect,
the same trust as the in-app QR scanner, which already fills the form from
any scanned payload. Dev auto-connect stays dev-only, and link params other
than the pairing URL are dropped, so `routeFor` still can't come from a link.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@NorthIsUp
NorthIsUp force-pushed the fix/mobile-pair-app-link branch from 8e4f89c to 830d0cd Compare November 22, 2026 06:21
@github-actions github-actions Bot added size:S and removed size:XXL labels Nov 22, 2026
@github-actions

Copy link
Copy Markdown

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 830d0cd.

This comment will update automatically after the next completed run.

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

Labels

size:S vouch:trusted 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