Skip to content

feat(onboarding): remove referral step, drop welcome network gate#765

Closed
jwalin-shah wants to merge 1 commit into
tinyhumansai:mainfrom
jwalin-shah:feat/onboarding-cleanups
Closed

feat(onboarding): remove referral step, drop welcome network gate#765
jwalin-shah wants to merge 1 commit into
tinyhumansai:mainfrom
jwalin-shah:feat/onboarding-cleanups

Conversation

@jwalin-shah
Copy link
Copy Markdown
Contributor

@jwalin-shah jwalin-shah commented Apr 22, 2026

Summary

  • Remove the referral code step from the onboarding flow. New path: Welcome → Skills → Context Gathering.
  • Drop the referralApi.getStats() prefetch that was disabling Welcome's Next button with "Checking account…" — the main perceived-load gate on signed-in first-open.
  • ReferralApplyStep.tsx is preserved on disk, just no longer imported, so the step can return later without a rewrite.
  • referralApi is untouched; still consumed by Rewards, Invites, and Billing.

Problem

  1. [Feature] Remove referral code step from onboarding flow #752 — Referral step adds friction to onboarding and should be disabled.
  2. When we open the app for the first time the onboarding screen takes a while to show up. Make it instant ideally. #692 — First-open onboarding feels slow. The Welcome step's Next button was gated on an async referralApi.getStats() round-trip ("Checking account…"), which is exactly the perceived-load hit users noticed.

Solution

Single-file change in app/src/pages/onboarding/Onboarding.tsx:

  • Strip referralApi / ReferralApplyStep imports.
  • Remove hasReferralFromProfile, resolveOnboardingStep, skipReferralStep, referralStatsToken, skipReferralFromStats, referralAppliedThisSession, and referralGateReady.
  • Drop the prefetch useEffect.
  • Renumber steps: 0 Welcome → 1 Skills → 2 Context.
  • Welcome no longer receives nextDisabled / nextLoading / nextLoadingLabel — Next is immediately interactive.
  • handleBack simplified; back/forward navigation through the 3-step flow works as expected.

Overlap with #759

None at the file level — #759 touches WelcomeStep.tsx, ContextGatheringStep.tsx, and privacy components; this PR only edits Onboarding.tsx. The only interaction is that Welcome's optional nextDisabled / nextLoading props are no longer passed. Merge order doesn't matter.

Submission Checklist

  • Unit testsyarn test:unit src/pages/onboarding green (9/9 across SkillsStep.test.tsx and LocalAIStep.test.tsx). No referral-specific unit test existed; none removed.
  • Typecheck / lint / formatyarn compile, yarn lint, prettier --check all clean.
  • E2Elogin-flow.spec.ts (touched by feat(onboarding,ui): trust-first onboarding + Button primitive + honest privacy surface #759) does not assert on the referral step. Manual verification pending on a built bundle; deferring to CI.
  • Doc comments — Behavior is self-evident from the simplified switch and navigation helpers.

Impact

  • Runtime: frontend only. No Tauri / core / JSON-RPC changes.
  • User-visible: (1) referral step no longer appears during onboarding; (2) Welcome's Next is instantly interactive on first open — no "Checking account…" delay.
  • Migration: none. Users who already applied a referral keep their state (referralApi is still wired everywhere else).
  • Follow-ups: deeper first-open wins (bootstrap snapshot fetch, 3s profile-load timeout in OnboardingOverlay) left for a separate PR to keep this cut minimal.

Related

Summary by CodeRabbit

  • Refactor
    • Streamlined the onboarding flow by removing the referral application step, resulting in a simplified 3-step process with improved navigation.

Onboarding flow is now Welcome -> Skills -> Context. The referral
prefetch (referralApi.getStats()) was the only async gate disabling
Welcome's Next button ("Checking account..."), so removing it also
materially speeds up perceived first-open load.

- Strip referral state, effect, and navigation fork from Onboarding.tsx
- Keep ReferralApplyStep.tsx on disk, unimported (referral may return)
- referralApi untouched (still used by Rewards/Invites/Billing)

Closes tinyhumansai#752. Addresses tinyhumansai#692 for the signed-in first-open path.
@jwalin-shah jwalin-shah requested a review from a team April 22, 2026 07:18
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 81a1d5c3-a7d8-4cef-a965-4b2a742c43c9

📥 Commits

Reviewing files that changed from the base of the PR and between 100b5b7 and 850e102.

📒 Files selected for processing (1)
  • app/src/pages/onboarding/Onboarding.tsx

📝 Walkthrough

Walkthrough

Removed referral gating and step from onboarding flow in Onboarding.tsx. Deleted helper functions for referral state detection and step index resolution. Eliminated async referral stats prefetch and associated React state. Simplified navigation to linear 3-step sequence using direct step increment/decrement.

Changes

Cohort / File(s) Summary
Onboarding Referral Removal
app/src/pages/onboarding/Onboarding.tsx
Removed referral prefetch async call (referralApi.getStats()), eliminated state variables for referral tokens and skip decisions, deleted resolveOnboardingStep and referral detection helper functions, simplified handleNext/handleBack to direct step increment/decrement, removed ReferralApplyStep from render switch, and adjusted step indices so SkillsStep is step 1 and ContextGatheringStep is step 2.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • PR #557: Modifies onboarding step navigation and step rendering, including remapping steps and changing handleNext/handleBack logic.
  • PR #457: Cleans up the referral step UI/behavior and onboarding referral flow integration.
  • PR #410: Removes an onboarding step and updates step indices and control flow in the stepper.

Poem

🐰 Hopping through onboarding with glee,
Three steps now flow, referral-code free,
Welcome, then Skills, then Context so bright,
Navigation simplified, linear and light,
Cleaner and swifter, just how it should be! 🌱

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing the referral step and the welcome network gate (prefetch logic) from onboarding.
Linked Issues check ✅ Passed The PR fully addresses #752's coding requirements: removed ReferralApplyStep from flow, preserved the file, eliminated referral logic/prefetch, adjusted step numbering, and enabled proper navigation without referral gates.
Out of Scope Changes check ✅ Passed All changes are scoped to onboarding referral removal. Only app/src/pages/onboarding/Onboarding.tsx was modified; no unrelated code changes detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jwalin-shah
Copy link
Copy Markdown
Contributor Author

withdrawn for review

@jwalin-shah jwalin-shah deleted the feat/onboarding-cleanups branch April 23, 2026 21:24
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.

[Feature] Remove referral code step from onboarding flow

2 participants