allternit-ai/src/components/onboarding/. One implementation ships to Desktop, ai.allternit.com (desktop and phone layouts) and the m.allternit.com PWA. The user guide is First-run setup.
Files
Gating
- Desktop and ai.allternit.com desktop layout:
OnboardingGateinShellApp.tsxaskssetupApi.getConfig();shouldRunWizard()is!onboardingComplete. On failure it keeps the local store state.OnboardingPortalrendersOnboardingFlowfull screen. - Phone shell (ai.allternit.com phone layout and the PWA):
PhoneFirstRunGatewrapsPhoneShellinSignedInPhone. It follows the server flag when the config call answers. When it cannot answer (no computer online to relay it), it runs setup only for an account with no paired computer and no local record, and gives up after 8 seconds, so an existing user is never held on a splash. - Completing setup on any surface saves
onboardingCompletefor the account; the other surfaces skip it after that.
Honest outcomes
Every result card and tile tag is computed from what happened:- Brains: connected only when the connect kit row for the chosen brain reports
on(useConnections()merged with the server’s availability); the result card is built from that state inaiCard. Allternit Cloud is the brain when nothing else is picked. A row the account cannot use shows the server’s reason and up to two fallbacks. - Phone: connected only when the QR sign-in completes and the row reports
onwith the phone’s name (phoneCard). Leaving the step with the QR still showing resets the row to Not connected. - Computer: there is no computer step. Add a computer (“Later, if you need it”) opens the compute gate’s own paths, and finishing with no computer records the same “Set up a computer later” choice as the gate.
- Plan brains (
chatgpt,claude,grok,kimi,copilot,gemini; the setup model still keys them assubs-chatgpt,subs-claude, …):KitSetup.tsxshows each as a connect-kitConnectionRowin the Connections page’s groups, and the server’s/api/v1/connectionsavailability decides which group it sits in. Tapping a row opens the kit’sConnectSheet, the same sheet Settings › Connections uses. A plan the server marks unavailable offers “Use a key” instead. With nothing picked, Allternit Cloud is the default brain once it is connected. States reported: Not connected, Connecting…, Connected, Needs you.
Haptic ripple
firesHaptic(action) is true only for choose. The block-square ripple is keyed by the reducer’s ripple counter and starts at the picked tile (rippleOriginFrom). On the phone a choice also calls vibrateSend(). Reduced motion hides the ripple and every loop; state changes stay.
Connected view
loadInventory() reads provider auth, the cloud catalog, runtimes (useRuntimes, settled after 6 s), cloud computers, bots (listAgents + findMainBot), messaging channels (gatewayApi.listAccounts, channel_oauth), Memory Drive mounts, bot projects, MCP connectors and Subscription Fabric logins. Runtime-backed sources are marked unavailable without making the call when no computer is reachable. buildConnectedGraph() marks nodes new (this session), conn, inc (included) or avail, caps side groups at four, and always includes a Main bot node.
Main bot step (Meet your bots)
MAIN_BOT_STEP_ENABLED is on: the order is ai → phone → mainbot → connected (setupStepOrder; the old Where and Style steps and SetupGraph.tsx were removed with the old connect screens, and a new account’s theme is System). The mainbot step renders MeetYourBotsCard with entry="setup" (see Meet your bots), on desktop, the ai.allternit.com phone layout and PhoneOnboardingFlow. Its main-bot page drives the shared picker hook useBotSetup({ context: 'onboarding' }) (see Bot setup picker). The card creates nothing until Start the job; the step stays optional (Skip and Next both move on). Its done button continues to the connected view.
Hand-off (Open Allternit)
ConnectedView’s Open Allternit calls handleOpen, which reads the viewport centres of the connected .as-g-node elements and calls startSetupHandoff() from setup/SetupHandoff.tsx. The film is a port of the brand intro (Brand/Allternit/motion/lib/allternit-motion.js). It is driven by requestAnimationFrame in its own React root on document.body, so it survives setup unmounting. Its beats:
- 0–1.0 s: the nodes collapse into blocks that build the A:// mark.
- The coral core pops and lands.
- 1.1 s: shockwave rings and a coral flash. 1.45–2.05 s: a light sweep.
- 1.5–2.05 s:
WELCOME, <name>types out with the name as the user gave it, unchanged apart from trimming and a 24-character cap (handoffNameFrom). The name is the profilepreferred_namefromagentPreferencesApi.get(), else the first word of the profilefull_name, elseusePlatformUser().user.firstName, else the Desktop session name. With none, it shows justWELCOME. 2.55 s: the core heartbeats. - 2.95–3.3 s: the
://dissolves. 3.3–4.3 s: the A flies to the first visible[data-handoff-orb].
onOpen runs once, at 3.3 s, so Home mounts under the overlay. The flight target is the launch screen’s pixel-A logo in views/chat/main/LaunchHeader.tsx (data-handoff-orb="matrix"), which serves Desktop, the phone layout and the PWA. With no target by 3.65 s, the A fades out at the top centre.
- Skip: a tap, click or Escape finishes at once.
- Reduced motion: a 0.8 s still mark.
- Failure: a hidden tab, a mount failure or a render error finishes immediately. Backup timers finish at 4.0 s and remove the overlay at 6.0 s.
- Tests: in
MODE === 'test'the hand-off is skipped.
Tests
setup/setupModel.test.ts, setup/connectedInventory.test.ts, setup/FirstRunSetup.test.tsx and fabric-session/phone/PhoneFirstRun.test.tsx cover the step machine, result cards, the haptic rule, subscription honesty, connected-view mapping, the phone gate and completion.
Seeing it locally
Run the Vite dev server, clearallternit-onboarding-storage and allternit-platform-mode from localStorage, and load /shell. Abort /api/onboarding/config to force the local-store path. For the phone shell, start Vite with VITE_DEV_AUTH_BYPASS=1 and use phone emulation on /.
Your own server on web and phone
ServerPairPanel (src/components/onboarding/setup/ServerPairPanel.tsx) handles Your own server wherever the local runtime API is off (hosted web, phone layout, PWA). It snapshots listPairedComputers(), calls createPairingCode() (cloud POST /api/v1/computers/pairing-codes), shows the command, and polls the paired list every 4 s until a new computer id appears (outcome paired), the code expires (error), or the request fails (error). Desktop keeps the SSH and backend-URL forms. NEXT_PUBLIC_ALLTERNIT_RUNTIME_API stays off on the hosted build: it would also enable budget, prewarm, replay and runtime-settings calls that only a paired runtime can answer.