Skip to content

fix(onboarding): remove referral code step from onboarding flow#772

Merged
graycyrus merged 1 commit into
tinyhumansai:mainfrom
graycyrus:fix/remove-referral-onboarding-step
Apr 22, 2026
Merged

fix(onboarding): remove referral code step from onboarding flow#772
graycyrus merged 1 commit into
tinyhumansai:mainfrom
graycyrus:fix/remove-referral-onboarding-step

Conversation

@graycyrus
Copy link
Copy Markdown
Contributor

@graycyrus graycyrus commented Apr 22, 2026

Summary

  • Remove the referral code step (ReferralApplyStep) from the onboarding overlay, simplifying the flow from 4 steps to 3: Welcome → Skills → Context Gathering
  • Clean up referral-related state, effects, and navigation logic from Onboarding.tsx
  • Remove unused nextDisabled/nextLoading/nextLoadingLabel props from WelcomeStep
  • Update E2E test to reflect the new 3-step flow

Test plan

  • yarn typecheck passes
  • yarn lint passes
  • yarn format:check passes
  • yarn build passes
  • yarn tauri dev launches successfully
  • ReferralApplyStep.tsx preserved but unused
  • No referral API calls during onboarding
  • Back/forward navigation correct with new step numbering (0→1→2)
  • Manual: verify onboarding flows Welcome → Skills → Context Gathering

Closes #752

Summary by CodeRabbit

  • Refactor

    • Streamlined onboarding flow by removing the referral application step, reducing the process from multiple steps to a cleaner 3-step experience.
  • Tests

    • Updated end-to-end tests to reflect the simplified onboarding journey.

Simplify onboarding from 4 steps to 3: Welcome → Skills → Context Gathering.
The referral step added unnecessary friction; the feature may return later
so ReferralApplyStep.tsx is preserved but unused.

Closes tinyhumansai#752
@graycyrus graycyrus requested a review from a team April 22, 2026 08:27
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

📝 Walkthrough

Walkthrough

The PR removes the referral-step from the onboarding flow by eliminating referral-gating logic, state management, and the ReferralApplyStep component render from the Onboarding controller. The WelcomeStep props interface is simplified by removing loading/disabled state controls. E2E tests and documentation are updated to validate the new 3-step flow (Welcome → Skills → Context Gathering).

Changes

Cohort / File(s) Summary
Documentation & Guidance
.claude/memory.md
Updated onboarding documentation to reflect the removal of the Referral step, clarifying the new 3-step flow and associated state/logic changes.
Core Onboarding Flow
app/src/pages/onboarding/Onboarding.tsx
Removed referral profile detection, async referral stats prefetch, resolveOnboardingStep helper, and related state variables (referralStatsToken, skipReferralFromStats, referralAppliedThisSession). Deleted ReferralApplyStep render branch. Remapped step indices: SkillsStep → step 1, ContextGatheringStep → step 2.
Welcome Step Component
app/src/pages/onboarding/steps/WelcomeStep.tsx
Simplified props interface by removing optional nextDisabled, nextLoading, and nextLoadingLabel properties. Reduced OnboardingNextButton usage to only label and onClick props.
E2E Testing
app/test/e2e/specs/login-flow.spec.ts
Removed all ReferralApplyStep walkthrough logic and test comments. Updated step-order documentation from 4 steps to 3. Adjusted step numbering in the test flow to align with removed referral step.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 The referral step hops away,
Three steps now light the onboarding day,
Welcome → Skills → Context so clear,
Simpler journeys, users cheer! 🌟

🚥 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 accurately summarizes the main change: removing the referral code step from the onboarding flow, which is the primary objective of this PR.
Linked Issues check ✅ Passed The PR implementation fully satisfies all acceptance criteria from issue #752: removed referral step logic, preserved ReferralApplyStep.tsx unused, eliminated referral API calls from onboarding, simplified flow to Welcome→Skills→Context Gathering, and updated tests accordingly.
Out of Scope Changes check ✅ Passed All code changes are directly related to removing the referral step: modifications to Onboarding.tsx, WelcomeStep.tsx props, test expectations, and documentation align precisely with the stated objectives.
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

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/src/pages/onboarding/steps/WelcomeStep.tsx`:
- Line 86: The CTA label in WelcomeStep was changed to "Let's Start" causing E2E
tests that click the "Continue" button to fail; update the OnboardingNextButton
usage in WelcomeStep (the component named OnboardingNextButton) to use the
original/expected label text used by the E2E test suite (or add a data-test-id
prop) so the test can reliably find it—either restore the label prop to
"Continue" or add a stable selector (e.g., data-testid or data-cy) on the
OnboardingNextButton and update/onNext accordingly so the E2E step selection
targets that selector instead of visible text.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 88041c0b-3e7e-4869-94af-d80911612a68

📥 Commits

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

📒 Files selected for processing (4)
  • .claude/memory.md
  • app/src/pages/onboarding/Onboarding.tsx
  • app/src/pages/onboarding/steps/WelcomeStep.tsx
  • app/test/e2e/specs/login-flow.spec.ts

loading={nextLoading}
loadingLabel={nextLoadingLabel}
/>
<OnboardingNextButton label="Let's Start" onClick={onNext} />
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

CTA label change breaks existing onboarding E2E step selection.

Line 86 changed the button text to "Let's Start", but the onboarding walkthrough still clicks "Continue" on step 0. That can leave the flow stuck on Welcome during E2E runs.

💡 Proposed fix
-      <OnboardingNextButton label="Let's Start" onClick={onNext} />
+      <OnboardingNextButton label="Continue" onClick={onNext} />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<OnboardingNextButton label="Let's Start" onClick={onNext} />
<OnboardingNextButton label="Continue" onClick={onNext} />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/pages/onboarding/steps/WelcomeStep.tsx` at line 86, The CTA label in
WelcomeStep was changed to "Let's Start" causing E2E tests that click the
"Continue" button to fail; update the OnboardingNextButton usage in WelcomeStep
(the component named OnboardingNextButton) to use the original/expected label
text used by the E2E test suite (or add a data-test-id prop) so the test can
reliably find it—either restore the label prop to "Continue" or add a stable
selector (e.g., data-testid or data-cy) on the OnboardingNextButton and
update/onNext accordingly so the E2E step selection targets that selector
instead of visible text.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a regression from this PR — the label was already "Let's Start" on main before this change (see git show main:app/src/pages/onboarding/steps/WelcomeStep.tsx line 95). The E2E test's clickFirstMatch(['Continue']) is a pre-existing mismatch that doesn't block the test (it returns null gracefully and the flow continues). Out of scope for this PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@graycyrus, thanks for the correction — you're right, this is not a regression from this PR. I apologize for the noise.


✏️ Learnings added
Learnt from: graycyrus
Repo: tinyhumansai/openhuman PR: 772
File: app/src/pages/onboarding/steps/WelcomeStep.tsx:86-86
Timestamp: 2026-04-22T08:39:00.335Z
Learning: In `app/src/pages/onboarding/steps/WelcomeStep.tsx`, the `OnboardingNextButton` label on `WelcomeStep` has always been `"Let's Start"` on `main` (not `"Continue"`). This is a pre-existing state and should not be flagged as a regression in any future PR. The E2E helper `clickFirstMatch(['Continue'])` returns `null` gracefully when no match is found, so the label mismatch is non-blocking for the test flow.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: graycyrus
Repo: tinyhumansai/openhuman PR: 307
File: app/src/components/ConnectionIndicator.tsx:29-36
Timestamp: 2026-04-03T14:57:27.517Z
Learning: In `app/src/components/ConnectionIndicator.tsx`, the `description` prop was intentionally removed from `ConnectionIndicatorProps` as part of the light-theme redesign (PR `#307`). The component now renders only as a compact pill badge; any surrounding description text is the responsibility of the parent component (e.g., `Home.tsx`). Do not flag the absence of `description` rendering as a regression.

Learnt from: graycyrus
Repo: tinyhumansai/openhuman PR: 167
File: app/src/components/OnboardingOverlay.tsx:30-39
Timestamp: 2026-04-01T13:52:17.936Z
Learning: In React components, do not perform synchronous `setState` (or other state-updating calls) directly inside `useEffect` bodies. The lint rule `react-hooks/set-state-in-effect` (enforced in this codebase) disallows patterns such as resetting state flags at the top of an effect before returning. Refactor to avoid calling state setters in the effect; prefer deriving state from props/render, using refs, or restructuring logic so state updates occur outside `useEffect`.

@graycyrus graycyrus merged commit 8ab8c59 into tinyhumansai:main Apr 22, 2026
7 of 8 checks passed
senamakel added a commit to jwalin-shah/openhuman that referenced this pull request Apr 22, 2026
… WelcomeStep test

- Rebase onto upstream/main (20 commits since PR merge base)
- Resolve PrivacyPanel.tsx conflict: keep upstream capability-backed dynamic
  privacy list (PR tinyhumansai#760) rather than the static whatLeavesItems fallback —
  the dynamic system supersedes the static one
- Resolve WelcomeStep.tsx conflict: keep simplified interface from upstream
  (nextDisabled/nextLoading/nextLoadingLabel removed) plus WhatLeavesLink
  footer from this PR
- Resolve login-flow.spec.ts conflict: remove ReferralApplyStep comment
  (step was removed in upstream PR tinyhumansai#772), keep ContextGatheringStep
  user-driven gate copy from this PR
- Fix WelcomeStep.test.tsx: remove test that passes now-removed props
  (nextDisabled, nextLoading, nextLoadingLabel) — update to verify CTA
  is always enabled in simplified interface
- Apply Prettier formatting across files reformatted post-rebase
- All quality checks pass: typecheck clean, lint 0 errors, format
  unchanged, 534 unit tests passed (2 pre-existing skips)
AusAgentSmith pushed a commit to AusAgentSmith/openhuman that referenced this pull request May 23, 2026
…humansai#772)

Simplify onboarding from 4 steps to 3: Welcome → Skills → Context Gathering.
The referral step added unnecessary friction; the feature may return later
so ReferralApplyStep.tsx is preserved but unused.

Closes tinyhumansai#752
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

1 participant