Skip to content

feat(native): add Welcome Phone section, T3 Connect link states, and accessible telemetry notice (CN-WELCOME) - #465

Merged
rynfar merged 2 commits into
nativefrom
feat/native-welcome-phone
Nov 20, 2026
Merged

rynfar merged 2 commits into
nativefrom
feat/native-welcome-phone

Conversation

@rynfar

@rynfar rynfar commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Closes #81

Problem

CN-WELCOME remained partial because the single-computer Welcome page (apps/web/src/components/onboarding/WelcomePage.tsx) was missing the collapsible Phone section (QR code + T3 Connect link-status flow) and its footer TelemetryNotice privacy-policy link used non-focusable InteractiveText with outdated copy.

Solution

  • Core onboarding phone logic (apps/native/crates/core/src/onboarding/phone.rs, re-exported from crates/core/src/onboarding.rs):
    • Added MOBILE_APP_URL (https://t3.codes/mobile) and PHONE_LINK_REFRESH_INTERVAL_SECS (30).
    • Ported welcome_offers_phone (welcomeOffersPhone: primary computer + cloud public config + relay:read/relay:write scopes + managed policy allowing remoteClients and connect).
    • Ported phone_is_shared, phone_account_for_identity, and resolve_phone_connect_state covering all 6 PhoneConnectLink states (Checking, Error, Reachable, SharedUnknownReachability, SharedUnreachable, NotShared, SignedOut) including legacy servers omitting managedTunnelActive.
    • Updated privacy_notice to match TelemetryNotice (WelcomePage.tsx) and reuse managed_policy::managed_telemetry_off_message.
  • Native GPUI Welcome UI (apps/native/crates/app/src/onboarding/{phone,mod,agents,connection}.rs):
    • Added collapsible PhoneSection ("Phone", "Use T3 Code on your phone", "Set up" / "Hide") gated by welcome_offers_phone and live relay:read/relay:write session grants.
    • Step 1 renders the cached qrcode quad canvas for MOBILE_APP_URL (124px, EC level M, 2-module quiet zone) with localized tooltip.
    • Step 2 (PhoneConnectLink) reads native crate::cloud signed-in state and queries GET /api/connect/link-state (t3_core::mcp::gate::CloudLinkState), refreshing every 30s only while expanded and suppressing all real timers/background network calls in headless/test/snapshot mode.
    • Wired "Check T3 Connect" / "Set up T3 Connect" to dismiss the welcome overlay (without prematurely completing onboarding) and open Settings at Section::Access, and "Sign in to T3 Connect" to start native crate::cloud OAuth PKCE sign-in.
    • Replaced InteractiveText in TelemetryNotice with a keyboard-accessible key_stop_with_focus link (Role::Link, aria_label, Tab/Enter/Space, focus ring) using localized crate::i18n::t / t_fmt copy.
  • Tests & Ledger:
    • Added deterministic unit tests in crates/core/src/onboarding/tests.rs and GPUI + --features snapshot tests in crates/app/src/onboarding/tests.rs.
    • Updated apps/native/parity/LEDGER.md row CN-WELCOME (L29) -> done and cleared #81.

Verification

  1. vp fmt --check apps/native/parity/LEDGER.md: PASS
  2. node apps/native/scripts/gen-theme.ts --check: PASS
  3. node apps/native/conformance/generate.ts --check: PASS
  4. node --test apps/native/parity/sync.test.ts: 47 passed, 0 failed
  5. CARGO_INCREMENTAL=0 cargo clippy --manifest-path apps/native/Cargo.toml --workspace --all-targets -- -D warnings: PASS (0 warnings)
  6. CARGO_INCREMENTAL=0 cargo test --manifest-path apps/native/Cargo.toml -p t3-core: 1,887 unit + 8 conformance = 1,895 passed, 0 failed
  7. CARGO_INCREMENTAL=0 cargo test --manifest-path apps/native/Cargo.toml -p t3-client -- --test-threads=1: 171 passed, 0 failed
  8. T3_NATIVE_HOME=$(mktemp -d) CARGO_INCREMENTAL=0 cargo test --manifest-path apps/native/Cargo.toml -p t3-native -- --test-threads=1: 225 passed, 0 failed
  9. T3_NATIVE_HOME=$(mktemp -d) CARGO_INCREMENTAL=0 cargo test --manifest-path apps/native/Cargo.toml -p t3-native --features snapshot onboarding -- --test-threads=1: 8 passed, 0 failed
  10. CARGO_INCREMENTAL=0 cargo build --manifest-path apps/native/Cargo.toml -p t3-native: PASS

Authored by Antigravity.

@rynfar
rynfar merged commit 97baab6 into native Nov 20, 2026
@rynfar
rynfar deleted the feat/native-welcome-phone branch November 20, 2026 08:57
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.

1 participant