feat: unify first-run activation, welcome, and onboarding flow#26
Merged
feat: unify first-run activation, welcome, and onboarding flow#26
Conversation
m0r6aN
pushed a commit
that referenced
this pull request
Apr 3, 2026
Implements the raw localStorage module tested in tests/unit/activation/activation-flag.test.ts (present since PR #26). Exports: ACTIVATION_COMPLETE_KEY, markActivationComplete, isActivationComplete, clearActivationFlag. Use useFirstRunState() in component code — this is the storage layer beneath the first-run routing system. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Unifies Keon Control’s first-run experience behind a single deterministic flow:
magic link -> /activate -> /welcome -> /setup -> appThis removes the previous parallel entry paths and establishes one source of truth for provisioning, onboarding completion, readiness, and next-route resolution.
What changed
src/lib/first-run/state.tsxprovisioningCompleteonboardingCompletereadyStatestagenextRoute/welcome/activate/welcome/setupAppReadyGate/,/get-started, and/onboardingUser-facing outcome
A first-time user can no longer bypass onboarding or land directly in advanced product surfaces.
The enforced path is now:
/activate/welcome/setupWhy this matters
Before this change, activation, welcome, setup, and app entry existed as partially parallel surfaces. That allowed drift, conflicting readiness logic, and route shortcuts that could expose the app shell before the user was actually ready.
This change makes first-run entry deterministic and gives the product one clear authority for setup state.
Key files
src/lib/first-run/state.tsxsrc/components/providers.tsxsrc/components/onboarding/route-gates.tsxsrc/components/activation/ActivationFlow.tsxsrc/components/layout/shell.tsxsrc/app/activate/page.tsxsrc/app/welcome/page.tsxsrc/app/setup/page.tsxsrc/app/get-started/page.tsxsrc/app/onboarding/page.tsxtests/unit/first-run/state.test.tsTesting
Attempted:
node .\node_modules\.pnpm\vitest@4.0.18_@types+node@20.19.33_jiti@1.21.7_jsdom@28.1.0\node_modules\vitest\vitest.mjs run tests/unit/first-run/state.test.ts tests/unit/onboarding/entry-routing.test.tsEnvironment issue:
Assertion failed: ncrypto::CSPRNG(nullptr, 0)So this PR includes test additions/updates, but I could not complete local execution from this shell.
Follow-up
Recommended hardening after this lands:
/activate -> /welcome -> /setup -> app