Skip to content

feat(native): first-run welcome wizard, connection and agents steps - #84

Merged
rynfar merged 2 commits into
nativefrom
nw/81-welcome
Nov 2, 2026
Merged

rynfar merged 2 commits into
nativefrom
nw/81-welcome

Conversation

@rynfar

@rynfar rynfar commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Part of #81

Problem

A first launch of the native client drops the user on the bare connect screen. The web, desktop and npx t3 clients open a welcome wizard instead: connect a computer, check its agents, import projects. FirstRunGate decides when the wizard shows, and it records onboardingCompletedAt once setup is done or once the server shows an established workspace. Native had neither the wizard nor the gate.

Approach

Gate (crates/core/src/onboarding.rs, pure and tested). It ports firstRun.logic.ts:

  • resolveFirstRunDecision, isFreshFirstRunWorkspace (Windows path normalization included), and the welcome's provenance check.

Native connects one environment at a time and reads its settings and saved environments synchronously. So the web's hydration, catalog and multi-environment inputs fall away, and one live flag (connected, shell replayed) stands in for them. The adaptations:

  • Nothing saved and onboarding not done: the wizard opens at once, in place of the connect screen (resolve_unpaired).
  • Saved environments: the gate waits for a connection and then judges the workspace as the web does. An established workspace saves onboardingCompletedAt and never shows the wizard, so existing users are not interrupted. A fresh one opens the wizard from home. The server's subscribeServerLifecycle welcome is read once per connection, and only while the gate is undecided.
  • Pending evidence never blocks the app. The web blanks the screen and shows a "Still connecting" recovery instead. That would lock out an offline user on their first launch after upgrading.

Wizard (crates/app/src/onboarding/). The frame follows ui/wizard.tsx: brand, WizardSteps with done steps clickable, a glass dialog, and a close button that finishes setup, as on the web.

  • Connection step. Lists T3 Code on this Mac (local discovery, or why it is missing, with Check again) and the saved environments. Picking one connects it through the connect screen's own pairing (environments.rs). "Add a computer" holds the pairing-link form, its error, and "Need a pairing link?" with copyable npx t3 pair. It also has the privacy line, including the managed-policy wording when telemetry is turned off, and Continue once connected. connect.rs now shares its local-server details, discovery copy and pairing-error lookup with it.
  • Agents step. Refreshes providers, then shows Codex (every instance) and Claude cards with their readiness: Ready, Checking, Disabled, Attention, Install, Sign in. Drivers a managed policy disallows are left out. The cards reuse Settings → Providers' summary copy and provider icons. Install and Sign in show the command the web would type into its setup terminal (the installer, or the login command with the instance's quoted binary), with Copy. Close checks the agents again.
  • Snapshot. --welcome [connect|agents] opens the wizard offscreen whatever the gate decides.

Also:

  • onboardingCompletedAt is now a client setting (ClientSettingChange::OnboardingCompletedAt).
  • The environment descriptor decodes platform.os for the setup commands.
  • The Lucide monitor icon is vendored.

Ledger

CN-WELCOME: todo → partial.

Gaps (this is a first slice, so the row stays partial):

  • T3 Connect (the cloud option) is hidden until CN-RELAY lands.
  • No import step yet (project scans and Claude Code/Codex history import). The agents step's Continue finishes setup, and the stepper shows two stages.
  • Codex's ChatGPT-managed setup (CodexSetupSection) is missing, along with "Connect another ChatGPT account" and resuming at #agents:<environment>.
  • No embedded setup terminal: Install and Sign in show the command instead. A standalone terminal pane needs the terminal module to export one.
  • One computer at a time (CN-MULTI), so there is no multi-select and no "setup skips X" note. The connection step's description is adjusted to match.
  • No "Could not finish setup" toast: client settings save through the background writer, which has no failure path.

Screenshots

Offscreen renderer at 1280×840, against the smoke server (Replay (dev), port 14658). T3CODE_HOME was set to a scratch home throughout, so nothing read or paired with ~/.t3.

Before (native):

  • Empty home, nothing running locally: /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/15deb025-b650-4cf9-a1aa-1cc16b006f6d/scratchpad/shots81/before-first-run-empty.png
  • Empty home, smoke server found as "this Mac": /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/15deb025-b650-4cf9-a1aa-1cc16b006f6d/scratchpad/shots81/before-first-run-smoke.png

After:

  • Empty home, nothing running (pairing opens by default): /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/15deb025-b650-4cf9-a1aa-1cc16b006f6d/scratchpad/shots81/after-first-run-none.png
  • Same, light mode, with "Need a pairing link?" open: /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/15deb025-b650-4cf9-a1aa-1cc16b006f6d/scratchpad/shots81/after-pairing-help-light.png
  • Empty home, smoke server found: /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/15deb025-b650-4cf9-a1aa-1cc16b006f6d/scratchpad/shots81/after-first-run-local.png
  • Click the local row. It pairs through t3 pair, against a wrapper bound to the smoke home, and connects. The wizard stays over the workspace with Continue enabled: /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/15deb025-b650-4cf9-a1aa-1cc16b006f6d/scratchpad/shots81/after-local-paired.png
  • The same run, then Continue, reaches the agents step: /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/15deb025-b650-4cf9-a1aa-1cc16b006f6d/scratchpad/shots81/after-local-agents.png
  • Paired smoke home, established workspace: no wizard, and the gate records completion: /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/15deb025-b650-4cf9-a1aa-1cc16b006f6d/scratchpad/shots81/after-established-no-wizard.png
  • --welcome / --welcome agents over the paired workspace: /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/15deb025-b650-4cf9-a1aa-1cc16b006f6d/scratchpad/shots81/after-paired-connect.png, /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/15deb025-b650-4cf9-a1aa-1cc16b006f6d/scratchpad/shots81/after-paired-agents.png

Both smoke-server sessions the local-pairing runs created were revoked afterwards with t3 auth session revoke.

I took no real-window capture, because launching the app would take focus from the developer's session.

Tests

onboarding::tests (17) mirror firstRun.logic.test.ts and providerReadiness.logic.test.ts, plus the native rules:

  • Wizard, backfill and pending decisions.
  • The legacy welcome.
  • Bootstrap freshness, including Windows paths and used threads.
  • Agent states and the best instance.
  • The agent list under a managed policy.
  • Login-command quoting, install commands, and the privacy line.

The client_settings round-trip test now covers onboardingCompletedAt.

  • cargo clippy --workspace --all-targets -- -D warnings ✓ (and -p t3-native --features snapshot)
  • cargo test --workspace ✓
  • node scripts/gen-theme.ts --check ✓
  • node --test parity/sync.test.ts ✓
  • node ../../apps/native/conformance/generate.ts --check ✓

Opus 5.5, Claude Code.

…nt, keyboard reachable rows, local re-pair errors
@rynfar

rynfar commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Review fixes in 7354522. All three findings were real.

  1. A provider refresh could land on another environment. refresh_providers now records connection_id() when it asks, and drops the reply if the connection has changed since (answers_current). Test: onboarding::agents::tests::a_provider_reply_after_a_switch_is_dropped. It fails when the guard is stubbed to true.
  2. The wizard could not be used from the keyboard. The computer rows, "Add a computer", "Need a pairing link?" and the done step tab are now Tab stops.
    • Enter or Space activates them, the same way the settings Switch handles keys (activates, with keyboard-generated clicks ignored).
    • Keyboard focus paints a 2px ring inside the row (§4.2's area outline), so it covers nothing.
    • Tab and Shift+Tab stay inside the wizard (FocusNextInWelcome / FocusPreviousInWelcome), as the settings modal's focus trap does.
    • Offscreen, local server found, --keys tab: /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/15deb025-b650-4cf9-a1aa-1cc16b006f6d/scratchpad/shots81/after-keyboard-tab.png
    • --keys "tab tab enter" expands Add a computer: /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/15deb025-b650-4cf9-a1aa-1cc16b006f6d/scratchpad/shots81/after-keyboard-tab-tab-enter.png
  3. A failed re-pair of the saved local computer showed nowhere. The listing is now a pure computers(&Listing).
    • The saved entry for T3 Code on this Mac shows "Connecting…" while t3 pair runs, and then its PairingSource::Local failure.
    • A pairing-link failure keeps the Add a computer form, and its error, open. That case is a saved non-local computer that needs a new link.
    • Tests: onboarding::connection::tests::a_saved_local_computer_shows_its_own_repairing_and_why_it_failed, which fails without the fix, and an_unsaved_local_server_has_its_own_row_with_its_pairing_failure.

Gates: clippy (default and --features snapshot), cargo test --workspace, gen-theme --check, parity sync and conformance --check all pass. The branch is already on fork/native (#80).

@rynfar
rynfar merged commit 1c7a7c5 into native Nov 2, 2026
@rynfar rynfar mentioned this pull request Nov 2, 2026
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