From 2ba51935c00834408857283c3487cc25643c3150 Mon Sep 17 00:00:00 2001 From: dumbdev Date: Sun, 26 Jul 2026 00:31:01 +0100 Subject: [PATCH] fixed all issues --- .../components/OnboardingSkeletonLoader.tsx | 177 ++++++++++++++++++ frontend/src/components/onboarding-reducer.ts | 150 +++++++++++++-- 2 files changed, 315 insertions(+), 12 deletions(-) create mode 100644 frontend/src/components/OnboardingSkeletonLoader.tsx diff --git a/frontend/src/components/OnboardingSkeletonLoader.tsx b/frontend/src/components/OnboardingSkeletonLoader.tsx new file mode 100644 index 00000000..b2bc3d9c --- /dev/null +++ b/frontend/src/components/OnboardingSkeletonLoader.tsx @@ -0,0 +1,177 @@ +"use client"; + +/** + * OnboardingSkeletonLoader + * + * Renders a shimmer placeholder that matches the visual structure of the + * OnboardingProgressTracker while its data is loading. + * + * Design decisions: + * - Mirrors the card layout exactly (header, progress bar, N step rows) + * so the transition from skeleton → real content is smooth and non-jarring. + * - Uses a CSS keyframe shimmer (bg-gradient + animate-shimmer) defined in + * globals.css rather than a JS animation, keeping this component tiny. + * - Supports compact and orientation props so it is a drop-in replacement. + * - Fully accessible: role="status" + aria-label so screen readers announce + * "Loading onboarding steps" instead of reading the decorative bones. + * - prefers-reduced-motion: shimmer animation is disabled when the OS + * setting is active; bones remain but do not pulse. + */ + +import React, { memo } from "react"; + +// ── Shimmer bone primitives ─────────────────────────────────────────────────── + +/** A single animated shimmer rectangle. */ +const Bone = memo(function Bone({ + className = "", + "aria-hidden": ariaHidden = true, +}: { + className?: string; + "aria-hidden"?: boolean; +}) { + return ( +
+ ); +}); + +/** A circular shimmer bone (step indicator placeholder). */ +const CircleBone = memo(function CircleBone({ + size = "h-10 w-10", +}: { + size?: string; +}) { + return ( +