Skip to content

fix: unify pairing-link onboarding and make environment imports opt-in - #29

Merged
eliophan merged 4 commits into
eliophan:mainfrom
fatwang2:fix/local-first-onboarding
Nov 16, 2026
Merged

eliophan merged 4 commits into
eliophan:mainfrom
fatwang2:fix/local-first-onboarding

Conversation

@fatwang2

@fatwang2 fatwang2 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem and behavior

First-run desktop catalog discovery could request T3 Code's safeStorage key before the user opted in, and discovery could make an unpaired installation appear connected. Setup also separated local and remote pairing behind different screens.

First setup now has one pairing-link input for either this computer or a remote environment. Its single button reads Paste and connect when empty and Connect when populated. Bar identifies the destination, pairs with it, and selects the connected environment. Settings is unavailable during first setup; paired installations retain connection management and recovery controls.

Changes

  • Reuse the existing destination validation and remote pairing transaction. Identify the server before exchanging a code; a matching local identity uses the local connection, while other identities are paired and saved as manual remote environments. Remote connections work without a local T3 Code installation or environment ID and never fall back to local authorization.
  • Accept direct pairing links and desktop/hosted wrappers. Require an embedded valid code for first setup; a bare code cannot identify its target. Read the clipboard only on an explicit action, mask and clear submitted input, and persist the exchanged grant rather than the link.
  • Fix the reviewed Local needsAccess bug by excluding isLocal from remote access controls. Local cannot submit through the remote-only pair_environment command. In Settings, a compact local status opens a separate Manage connection page.
  • Keep local authorization separate from discovery and aggregate remote status. A running server alone does not complete pairing.
  • Add default-off Import environments from T3 Code to gate encrypted desktop catalog discovery. Manual routes and T3 Connect remain independent. Update usage, compatibility and changelog documentation.

Compatibility

Desktop import defaults to off for existing settings too. Users relying on catalog-only routes must opt in once or add routes manually; existing Bar grants and manual connections are retained. Bar still uses its own OS credential namespace.

Remote links require a reachable address under the existing HTTPS, loopback or verified Tailscale transport policy. A localhost link copied from another computer still targets this computer. Link format evidence: T3 Code v0.1.9, apps/web/src/components/settings/pairingUrls.ts; setup labels were also checked against 0.1.10-nightly.20261113.4656.

Validation

  • bash scripts/check.sh passes on macOS arm64 with Rust 1.99.1: 60 frontend tests, contract check, frontend build, all seven Rust domain crates and 42 Tauri host tests. git diff --check passes.
  • New synthetic integration coverage verifies local routing and grant storage, remote pairing with no local installation, remote links while a local server exists, selection of the paired target, and rejection of invalid codes or a destination previously assigned to another identity before token exchange.
  • UI regression coverage checks one connection action, hidden Settings before pairing (including native Settings events), local/remote links, no unsolicited clipboard read, Local needsAccess exclusion from remote forms, and connection-management navigation.
  • Installed an ad hoc signed preview with separate settings and credential namespaces on macOS 27.2.1 arm64; checked the real menu-bar onboarding. No new real-account authorization was performed. Native captures remain outside the repository.
  • Linux installer tests are skipped on macOS. Linux native UI, real remote end-to-end authorization and notarized release acceptance remain separate checks. Usage-cache v15 compatibility is outside this PR.

@eliophan

Copy link
Copy Markdown
Owner

Reviewed head da68755d4faa103b1ddf285622b1479d024175cd.

[P2] Local exposes a remote-only pairing form in Settings

At desktop/src-tauri/src/main.rs:591–593, a running, unpaired Local environment now gets needsAccess. Settings passes Local through EnvironmentAccess, which renders a second “Local pairing key” form for its direct route.

Submitting that form calls pair_environment, which looks only in remote_routes. Discovery deliberately excludes Local from that map, so submission always returns “Unknown remote environment.” The first Local connection form works, but the duplicate form creates a broken pairing path.

Suggested fix: exclude isLocal environments from the remote access controls and keep Local pairing in the first section. Add regression coverage using the host-produced needsAccess state: Settings should contain exactly one Local pairing form, submitting through connect.

Validation: 52 frontend tests and TypeScript typecheck passed on the exact PR snapshot. Both macOS and Linux CI jobs passed. Native UI and Rust tests were not rerun locally. No code changes were made during review.

Review model: OpenAI gpt-6.1-sol.

@fatwang2 fatwang2 changed the title fix: make onboarding local-first and desktop imports opt-in fix: simplify local pairing and make environment imports opt-in Nov 14, 2026
@fatwang2 fatwang2 changed the title fix: simplify local pairing and make environment imports opt-in fix: unify pairing-link onboarding and make environment imports opt-in Nov 14, 2026
@fatwang2

Copy link
Copy Markdown
Contributor Author

I'd like to keep this PR focused on simplifying the first-run experience after downloading the app. The Settings page still has more flows and logic to untangle. If you agree, I'll address those in separate PRs.

@eliophan

Copy link
Copy Markdown
Owner

Reviewed: CI macOS/Linux pass. Known P2 remains: Settings exposes a Local pairing form through the remote-only pair_environment path, which returns Unknown remote environment; the first Local pairing form works. This should be fixed in a follow-up. Merging per request.

Review model: OpenAI gpt-6.1-sol.

@fatwang2

Copy link
Copy Markdown
Contributor Author

I've resolved the conflict with the latest main, keeping both changelog entries.

The reported Local pairing P2 was already fixed in d23eafe: isLocal entries are excluded from remote access controls. The needsAccess regression test verifies a single Local form using connect, never pair_environment.

Full local checks pass after the merge: 60 frontend tests, all seven Rust domain crates, and 42 Tauri host tests, plus the build and contract checks.

@eliophan
eliophan merged commit 9f9dcc8 into eliophan:main Nov 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants