Skip to content

fix: improve onboarding flow navigation from step 1 to step 3 - #137

Merged
Anushreebasics merged 2 commits into
itzzavdhesh:mainfrom
Smrithi-krishna:feat/improve-onboarding-step-flow
Jun 7, 2026
Merged

fix: improve onboarding flow navigation from step 1 to step 3#137
Anushreebasics merged 2 commits into
itzzavdhesh:mainfrom
Smrithi-krishna:feat/improve-onboarding-step-flow

Conversation

@Smrithi-krishna

@Smrithi-krishna Smrithi-krishna commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

🚀 Program

GSSoC

📝 Description

This PR enhances the Onboarding.jsx experience by adding an auto-playing onboarding preview slider in the header banner.
When the onboarding screen loads, the header automatically cycles through Step 1 → Step 2 → Step 3 at a fixed interval (5 seconds) to give users a quick preview of the onboarding flow.
To ensure a smooth user experience, the autoplay is disabled immediately upon user interaction, allowing users to take full control of the onboarding process.
User interactions that stop autoplay include:

  • Clicking inside the voice profile input field
  • Clicking step navigation indicators
  • Starting the voice cloning process

🔗 Related Issue

Closes #129

🔄 Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🔍 SEO improvement
  • 🎨 Style / UI improvement
  • ♿ Accessibility improvement
  • 📝 Documentation
  • ⚙️ CI / configuration
  • 🧹 Refactor / cleanup

🧪 How to Test

  1. Open http://localhost:5173 in a browser
  2. Observe the header automatically cycling through onboarding steps every 5 seconds
  3. Interact with any onboarding element (input field / step dots / clone button)
  4. Verify that autoplay stops immediately and user regains manual contro

📸 Screenshots (if applicable)

Recording.2026-06-06.144622.mp4

✅ Checklist

  • I am contributing under GSSoC, NSOC, SSOC, or ELUSOC
  • My code follows the project's existing style
  • I have tested my changes in a browser
  • I have linked the related issue above
  • My PR title follows Conventional Commits format (e.g. feat: add voice preview)

Summary by cubic

Refactors onboarding into a gated, persistent 3-step flow with step-aware headers, accessible step dots, and clearer progress. On clone success, navigation now reliably advances to Step 2; users can proceed to Step 3 and finish setup.

  • New Features

    • Persist activeStep/maxUnlockedStep in localStorage, clamp to unlocked max, and restore on load; restrict manual navigation to unlocked steps.
    • Per-step header copy and progress bars; Step 1 requires an API key + recording and disables inputs during cloning; success card with “Continue to Step 2”; Back/Continue in Steps 2–3; final “Complete Setup & Go to Call”.
  • Bug Fixes

    • Reliable Step 1 → 2 advance on clone success; locked steps can’t be opened.
    • API key warning is Step 1-only; API errors show inline next to recorder/clone.

Written for commit cc0fc2d. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Redesigned onboarding as an explicit 3-step flow with persistent progress, clickable unlocked navigation dots, and label-driven progress display
    • Step-specific UI: recorder, API-key warning, clone controls and success panel in Step 1; simplified Step 2/3 with Back/Continue and final ready action
  • Bug Fixes

    • Clone errors now surface in Step 1 alongside recorder/clone controls
    • Successful clone unlocks and advances the user to Step 2 (progress persisted)

@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

@Smrithi-krishna is attempting to deploy a commit to the itzzavdhesh's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

DCO Sign-off Needed

Hi @Smrithi-krishna, one or more commits need a Signed-off-by: line.

Fix these commits:

  • cc0fc2d Merge branch 'main' into feat/improve-onboarding-step-flow

For the latest commit:

git commit --amend --signoff
git push --force-with-lease

For multiple commits, replace N with the number to update:

git rebase --signoff HEAD~N
git push --force-with-lease

This comment will update after you push.

VoiceForge automation

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Onboarding.jsx now uses persisted explicit steps (activeStep, maxUnlockedStep) to drive a step-configured header, progress fills, and clickable step dots. Cloning is guarded by API key + recording; success stores successProfile, unlocks Step 2 and advances to it. Steps 2–3 are placeholder UIs with gated navigation and final onReady.

Changes

Persisted 3-step onboarding

Layer / File(s) Summary
State, persistence, and step content
client/src/pages/Onboarding.jsx
Adds activeStep and maxUnlockedStep initialization/clamping from localStorage, stepContent dictionary, and effects to persist state; switches clone error usage to apiError.
Clone handler and step navigation
client/src/pages/Onboarding.jsx
Adds guarded handleClone that requires ElevenLabs API key and a recording before calling cloneVoice; on success sets successProfile, unlocks Step 2 and sets activeStep = 2; adds handleManualStepNavigation restricting jumps to unlocked steps.
Header, progress bars, and navigation dots
client/src/pages/Onboarding.jsx
Replaces header/progress with stepContent[activeStep] banner, label-based progress fills, and a tablist of step dots disabled for locked steps; updates imports to include ArrowRight.
Step 1 UI: recorder, clone action, and errors
client/src/pages/Onboarding.jsx
Renders Step 1 only when activeStep === 1: API-key warning, VoiceRecorder, voice-name input, Clone button disabled without API key/recording or while cloning, displays apiError, and shows Continue to Step 2 on success.
Step 2 controls
client/src/pages/Onboarding.jsx
Placeholder Step 2 with "Back to Profile" (activeStep = 1) and "Continue to Step 3" (sets maxUnlockedStep = 3 and activeStep = 3).
Step 3 completion actions
client/src/pages/Onboarding.jsx
Placeholder Step 3 with "Back to Settings" (activeStep = 2) and "Complete Setup" which calls onReady.

Sequence Diagrams

sequenceDiagram
  actor User
  participant UI as Onboarding.jsx
  participant CloneHook as useVoiceClone / cloneVoice
  participant Storage as localStorage

  User->>UI: Open onboarding page
  UI->>Storage: read activeStep, maxUnlockedStep
  User->>UI: Record sample (VoiceRecorder)
  User->>UI: Click "Clone voice"
  UI->>CloneHook: handleClone(recording, voiceName) [requires API key + recording]
  alt API key + recording present
    CloneHook->>CloneHook: call cloneVoice(recording, voiceName)
    CloneHook-->>UI: returns successProfile
    UI->>Storage: persist maxUnlockedStep=2, activeStep=2
  else missing API key or recording or clone fails
    CloneHook-->>UI: returns apiError
  end
  User->>UI: Click step dot
  UI->>UI: handleManualStepNavigation (checks maxUnlockedStep)
  User->>UI: Finish Step 3
  UI->>User: call onReady()
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

type:refactor

"I hopped in code with careful paws, saved steps beside my tree,
I nudged the clone with hopeful nose — keys checked, then set step three.
Dots to click, a carroted flow, localStorage keeps the trail,
A rabbit's cheer for onboarding done — hop forward, never fail!"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: improve onboarding flow navigation from step 1 to step 3' accurately reflects the main objective of implementing multi-step navigation with step persistence and gated progression.
Linked Issues check ✅ Passed The PR implementation meets all core coding objectives from issue #129: enables multi-step navigation with automatic/manual/hybrid approach, implements step locking based on prerequisites, adds API key validation with disabled Clone button when missing, provides visual progress indicators, and persists state in localStorage across refreshes.
Out of Scope Changes check ✅ Passed All changes are scoped to the onboarding flow. The PR adds autoplay preview cycling, step persistence, gated navigation, error handling, and UI reorganization—all directly addressing the linked issue #129 objectives and PR description.

✏️ 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.

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

PR Ready For Mentor Review

Hi @Smrithi-krishna, your PR passed automated validation and moved into the GSSoC review queue.

@sabeenaviklar @1754riya @Anushreebasics @itsdakshjain, this GSSoC PR is ready for review.

Mentor next steps: confirm scope, review behavior and tests, then approve, comment, or request changes.

This does not mean the PR is approved yet. Please wait for mentor feedback before expecting merge. If changes are requested, update the same branch and keep the PR focused on the linked issue.

VoiceForge automation

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@client/src/pages/Onboarding.jsx`:
- Around line 91-93: The auto-advance setTimeout that calls setActiveStep(2)
must be tracked and cleared to avoid jumping back when users navigate manually:
store the timer id in a ref (e.g., autoAdvanceTimerRef), assign the result of
setTimeout to it where you schedule the advance,
clearTimeout(autoAdvanceTimerRef.current) inside any manual navigation handler
(e.g., the "Continue Now" click handler) and in a useEffect cleanup on unmount;
apply the same pattern to the other timer occurrences referenced around lines
228-235 and 256-259 so all delayed advances are cancellable.
- Around line 81-86: The onboarding currently treats missing API key/recording
or cloneVoice failures as success by creating a mock profile; instead only allow
progress when cloneVoice actually succeeds. Update the logic in Onboarding.jsx
(places around the blocks using hasApiKey, recording, cloneVoice, profile,
voiceName — e.g., the if at lines ~81 and the similar blocks at ~95-101 and
~211-215) to: 1) call cloneVoice only when hasApiKey && recording, 2) await it
and on success set the real profile, 3) catch and surface any thrown error into
an error state (do not swallow), and 4) remove the artificial mock fallback so
Step 2 remains locked unless cloneVoice succeeded. Ensure any step-unlocking
logic reads the real success/error state rather than assuming a mock profile.
- Around line 169-179: The step-dot <button> elements are unlabeled and don't
expose the active state to assistive tech; update the button rendering in
Onboarding.jsx (the element using activeStep, stepNum, isAccessible, and
handleStepClick) to include an accessible name like aria-label={`Step ${stepNum
+ 1}`} (or a localized equivalent) and add aria-current="step" when activeStep
=== stepNum; keep aria-disabled or disabled as is for inaccessible steps. Ensure
the aria attributes are applied per-button so screen readers receive both the
label and the current-step state.
- Around line 47-55: Autoplay is advancing the shared activeStep and bypassing
the unlock guard (maxUnlockedStep), so change the effect and related UI to use a
separate preview state (e.g., previewStep) driven by the
React.useEffect/isAutoplayActive interval instead of setActiveStep, and keep
activeStep navigation constrained by maxUnlockedStep; update any header/preview
rendering to read previewStep while click handlers and the real step body still
validate against activeStep and maxUnlockedStep (also audit other uses around
the component, lines ~243-279, to ensure interactive controls always check
maxUnlockedStep before allowing navigation).
- Around line 16-22: activeStep is always initialized to 1 and never restored
from storage; change its initializer to read "voiceforge:onboardingStep" from
localStorage, parse it as an integer, read the stored maxUnlockedStep (or parse
"voiceforge:maxUnlockedStep") and clamp the restored activeStep to
Math.min(savedActive, savedMax) with a fallback of 1, then return that value
from the initializer used by React.useState so activeStep and setActiveStep
start correctly; apply the same restoration/clamping logic to the other
onboarding-step initialization spots in this file and keep referencing
activeStep, setActiveStep, maxUnlockedStep, and setMaxUnlockedStep.
🪄 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 Plus

Run ID: 34699f29-5cbf-4091-af6d-0a5abaf89b7c

📥 Commits

Reviewing files that changed from the base of the PR and between 6165ec7 and 2f0bc5e.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • client/src/pages/Onboarding.jsx

Comment thread client/src/pages/Onboarding.jsx Outdated
Comment thread client/src/pages/Onboarding.jsx Outdated
Comment thread client/src/pages/Onboarding.jsx Outdated
Comment thread client/src/pages/Onboarding.jsx Outdated
Comment thread client/src/pages/Onboarding.jsx
@Smrithi-krishna
Smrithi-krishna force-pushed the feat/improve-onboarding-step-flow branch from 2f0bc5e to 81af6c3 Compare June 6, 2026 09:26

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

4 issues found across 2 files

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Fix all with cubic | Re-trigger cubic

Comment thread client/src/pages/Onboarding.jsx Outdated
Comment thread client/src/pages/Onboarding.jsx Outdated
Comment thread client/src/pages/Onboarding.jsx Outdated
Comment thread client/src/pages/Onboarding.jsx Outdated
@Smrithi-krishna

Copy link
Copy Markdown
Contributor Author

Hi, it’s ready for review. Could you please take a look when you have time?

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@client/src/pages/Onboarding.jsx`:
- Around line 14-15: The code is checking the hasApiKey function object instead
of its boolean result; replace usages of the bare identifier hasApiKey with the
computed boolean apiKeyPresent (or call hasApiKey()) wherever gating UI/logic
(e.g., the warning render, clone button disabled state, and in handleClone) is
performed so the missing-API-key warning displays, the Clone button is disabled
when no key exists, and handleClone avoids making API calls without a key;
search for references to hasApiKey in Onboarding.jsx (including the branches
around the initial apiKeyPresent assignment and the logic near handleClone) and
update them to use apiKeyPresent or hasApiKey().
🪄 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 Plus

Run ID: bd0077c8-5989-4c9e-8136-c7637a39a42c

📥 Commits

Reviewing files that changed from the base of the PR and between 8a3feaa and cc0fc2d.

📒 Files selected for processing (1)
  • client/src/pages/Onboarding.jsx

Comment on lines 14 to 15
const apiKeyPresent = hasApiKey();

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use the boolean result of hasApiKey(), not the function object.

These branches are checking hasApiKey instead of apiKeyPresent/hasApiKey(), so the “missing API key” warning never renders, the clone button stays enabled without a key, and handleClone() still attempts the API call as long as a recording exists.

Suggested fix
   const { cloneVoice, status, error: apiError } = useVoiceClone();
   const isCloning = status === "cloning";
   const apiKeyPresent = hasApiKey();
@@
   async function handleClone() {
     // 1. Strict validation guards: Don't run without API key or a recorded sample
-    if (!hasApiKey || !recording) return;
+    if (!apiKeyPresent || !recording) return;
@@
-          {!hasApiKey && (
+          {!apiKeyPresent && (
@@
               <button
                 type="button"
                 onClick={handleClone}
-                disabled={isCloning || !hasApiKey || !recording}
+                disabled={isCloning || !apiKeyPresent || !recording}
                 className="inline-flex min-h-11 items-center justify-center gap-2 rounded-md bg-coral px-5 font-bold text-white transition hover:bg-coral/90 disabled:cursor-not-allowed disabled:opacity-50"
               >

Also applies to: 63-66, 159-160, 183-186

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/pages/Onboarding.jsx` around lines 14 - 15, The code is checking
the hasApiKey function object instead of its boolean result; replace usages of
the bare identifier hasApiKey with the computed boolean apiKeyPresent (or call
hasApiKey()) wherever gating UI/logic (e.g., the warning render, clone button
disabled state, and in handleClone) is performed so the missing-API-key warning
displays, the Clone button is disabled when no key exists, and handleClone
avoids making API calls without a key; search for references to hasApiKey in
Onboarding.jsx (including the branches around the initial apiKeyPresent
assignment and the logic near handleClone) and update them to use apiKeyPresent
or hasApiKey().

@Anushreebasics Anushreebasics left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@Anushreebasics
Anushreebasics merged commit 77ca5b3 into itzzavdhesh:main Jun 7, 2026
8 of 10 checks passed
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

PR Merged Successfully

Hi @Smrithi-krishna, thank you for your contribution to VoiceForge.

This pull request has been merged and marked complete. Linked issue(s): #129.

Maintainers may still handle final cleanup, release notes, or follow-up tracking after merge.

VoiceForge automation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility assignee-match bug Something isn't working client completed dco-missing docs-ok documentation Improvements or additions to documentation ELUSOC ELUSOC enhancement New feature or request gssoc:approved gssoc:approved gssoc26 gssoc26 Hard hard level:beginner level:beginner linked-issue-ok mentor:Anushreebasics GSSoC: Mentor-@Anushreebasics mentor:itsdakshjain GSSoC: Mentor-@itsdakshjain mentor:leonagoel GSSoC: Mentor-@leonagoel mentor:Nitya-003 Applied by mentor automation mentor:sabeenaviklar GSSoC: Mentor-@sabeenaviklar merged pr-merged pr-validated quality:clean quality:clean ready for review refactor size/m SSoC26 SSOC template-ok type:accessibility type type:bug type:bug type:feature type:feature type:performance type:performance type:refactor type:refactor VETERAN VETERAN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat:Add Navigation Flow Between Onboarding Steps

6 participants