Skip to content

fix: per-step skip advances onboarding instead of completing - #991

Merged
robertocarlous merged 1 commit into
Neurowealth:mainfrom
Ahassan017:fix-onboarding-per-step-skip-953
Oct 1, 2026
Merged

robertocarlous merged 1 commit into
Neurowealth:mainfrom
Ahassan017:fix-onboarding-per-step-skip-953

Conversation

@Ahassan017

Copy link
Copy Markdown
Contributor

Overview

This change addresses a bug in onboarding where each step's per-step skip button (WalletConnectStep's "Skip for Now", FirstDepositStep's "Skip for Now", StrategyOverviewStep's "Decide Later") was wired to the same handleSkip as the bottom "Skip All" button. handleSkip unconditionally set isCompleted = true, so skipping just the first step marked the entire flow complete and dropped the user on the dashboard, hiding the Strategy and Deposit steps for good.

The fix gives the per-step skip its own handleStepSkip handler that advances to the next step without completing the flow, while the bottom "Skip All" button keeps handleSkip and its existing "complete from anywhere" behavior.

Related Issue

Issue: #953 — Fix onboarding's per-step "Skip for Now" completing the entire onboarding flow

Changes

Per-step skip handler

  • [MODIFY] src/hooks/useOnboardingFlow.ts

    • Added handleStepSkip() to OnboardingFlowControls.
    • On any non-final step it advances currentStep to the next step and persists it with completed: false, so the flow stays open.
    • On the final step it preserves end-of-flow semantics (isCompleted = true, persisted completed: true, onComplete?.()), matching handleNext.
    • handleSkip() (Skip All) is unchanged: it completes unconditionally from any step and calls onSkip?.().
  • [MODIFY] src/components/onboarding/OnboardingFlow.tsx

    • Destructured handleStepSkip from the hook.
    • <CurrentStepComponent onSkip={handleStepSkip} …> — the per-step skip now advances.
    • The bottom "Skip All" button still uses onClick={handleSkip}.
  • [ADD] src/hooks/useOnboardingFlow.test.ts

    • Asserts a per-step skip on step 0 moves currentStep 0 → 1 with isCompleted still false.
    • Asserts the advanced step is persisted as completed: false.
    • Asserts repeated per-step skips advance to the final step without completing or firing onComplete/onSkip.
    • Asserts skipping the final step does complete the flow.
    • Asserts handleSkip (Skip All) still completes unconditionally from step 0.
  • [ADD] src/components/onboarding/OnboardingFlow.test.tsx

    • Flow-level test: clicking WalletConnectStep's "Skip for Now" renders the Strategy step (Choose Your Investment Strategy), never renders the completion screen, and persists completed: false.
    • Flow-level test: the bottom "Skip All" button still renders the "Welcome to NeuroWealth!" completion screen.
  • Unchanged: src/components/onboarding/OnboardingGate.tsx — it already passes a single handleDone as both onComplete and onSkip; the gate only needs to react once the flow genuinely completes. No change needed.

Verification Results

This change was produced against the repository via the GitHub REST API only — no local clone, install, or build was possible in this environment. Tests were not executed here; they follow the repo's existing node:test + @testing-library/react patterns and the package.json runner.

Run locally with:

yarn test        # TZ=UTC node --import tsx --test $(find src -name '*.test.ts' -o -name '*.test.tsx')
yarn typecheck   # tsc --noEmit

Acceptance criteria mapping:

Acceptance Criteria Status
Scope is limited to the files listed (or agreed alternatives in the PR) ✅ Changed src/hooks/useOnboardingFlow.ts + src/components/onboarding/OnboardingFlow.tsx only; OnboardingGate.tsx confirmed to need no change
A per-step skip advances currentStep without setting isCompleted ✅ handleStepSkip advances and persists completed: false; covered by useOnboardingFlow.test.ts and OnboardingFlow.test.tsx
Bottom "Skip All" still completes the flow ✅ handleSkip unchanged; covered by tests in both new test files
Change is verifiable ✅ New unit + flow-level tests added; not executed in this API-only environment
No behavior regressions in related user flows ℹ️ Reasoned: handleNext/handleBack/handleStepClick/resetFlow untouched; final-step per-step skip matches previous completion semantics
No new duplicate abstractions without a one-line rationale ✅ Reuses the existing hook, persist() and storage key; a one-line comment explains handleStepSkip

Closes #953

@drips-wave

drips-wave Bot commented Sep 26, 2026

Copy link
Copy Markdown

@Ahassan017 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@robertocarlous
robertocarlous merged commit 71226cc into Neurowealth:main Oct 1, 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.

Fix onboarding's per-step "Skip for Now" completing the entire onboarding flow

2 participants