From 5b880d5be3ee52307e131e718c57804c40010eed Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sun, 28 Sep 2025 06:35:30 +0000 Subject: [PATCH] Set onboarding completion flag and improve performance of onboarding animations cgen-cd5ce32b298e42ee820c90218644e7ec --- client/pages/Onboarding.tsx | 60 ++++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 20 deletions(-) diff --git a/client/pages/Onboarding.tsx b/client/pages/Onboarding.tsx index 74094aa9..ea9b6f36 100644 --- a/client/pages/Onboarding.tsx +++ b/client/pages/Onboarding.tsx @@ -2,6 +2,7 @@ import { useState, useEffect } from "react"; import { Link, useNavigate } from "react-router-dom"; import Layout from "@/components/Layout"; import LoadingScreen from "@/components/LoadingScreen"; +import { useMemo } from "react"; import { SkeletonOnboardingStep } from "@/components/Skeleton"; import UserTypeSelection from "@/components/onboarding/UserTypeSelection"; import PersonalInfo from "@/components/onboarding/PersonalInfo"; @@ -166,6 +167,11 @@ export default function Onboarding() { aethexAchievementService.checkAndAwardOnboardingAchievement(user.id), ]).catch(() => undefined); + // Mark onboarding complete locally (UI fallback) + try { + localStorage.setItem("onboarding_complete", "1"); + } catch {} + // Refresh profile so UI updates immediately await refreshProfile(); @@ -179,7 +185,7 @@ export default function Onboarding() { navigate("/dashboard", { replace: true }); setTimeout(() => { if (location.pathname.includes("onboarding")) { - window.location.assign("/dashboard"); + window.location.replace("/dashboard"); } }, 400); } catch (e) { @@ -244,7 +250,7 @@ export default function Onboarding() {
(
@@ -266,7 +272,7 @@ export default function Onboarding() {
{/* Step Content */} -
+

{steps[currentStep].title} @@ -297,21 +303,35 @@ export default function Onboarding() { )}

- {/* Floating particles effect */} -
- {[...Array(15)].map((_, i) => ( -
- ))} -
+ {/* Floating particles effect (performance-friendly) */} + {(() => { + const particles = useMemo( + () => + Array.from({ length: 8 }).map(() => ({ + left: `${Math.floor(Math.random() * 100)}%`, + top: `${Math.floor(Math.random() * 100)}%`, + delay: `${Math.random().toFixed(2)}s`, + duration: `${3 + Math.floor(Math.random() * 2)}s`, + })), + [], + ); + return ( +
+ {particles.map((p, i) => ( +
+ ))} +
+ ); + })()}