From 9b24d9ec0937ad4f9aa3f462ac9f3367e767ad29 Mon Sep 17 00:00:00 2001 From: abhishek Date: Tue, 1 Sep 2026 13:05:37 +0530 Subject: [PATCH] changes --- src/features/setup/SetupTour.tsx | 131 +++++++++++++++++++++--- src/features/setup/stepGuidance.test.ts | 83 +++++++++++++++ src/features/setup/storeUserSteps.ts | 25 +++++ src/features/store-admin/setupSteps.ts | 82 +++++++++++++++ 4 files changed, 309 insertions(+), 12 deletions(-) create mode 100644 src/features/setup/stepGuidance.test.ts diff --git a/src/features/setup/SetupTour.tsx b/src/features/setup/SetupTour.tsx index 515573c..021a15e 100644 --- a/src/features/setup/SetupTour.tsx +++ b/src/features/setup/SetupTour.tsx @@ -24,7 +24,7 @@ import { Button } from '@astryxdesign/core/Button'; import { HStack } from '@astryxdesign/core/HStack'; import { Text } from '@astryxdesign/core/Text'; import { VStack } from '@astryxdesign/core/VStack'; -import { ArrowRight, Check, Sparkles } from 'lucide-react'; +import { ArrowRight, Check, ChevronDown, ChevronUp, Info, Sparkles } from 'lucide-react'; import type { SetupStep } from '@/features/store-admin/setupSteps'; import { declineTour, @@ -49,6 +49,9 @@ export function SetupTour({ userid, tenantid, steps, home }: SetupTourProps) { const navigate = useNavigate(); const { pathname } = useLocation(); const [tour, setTour] = useState(() => readTour(userid, tenantid)); + /* Sticky across steps. Somebody who opened the guide once wants it for the + next step too; making them reopen it seven times teaches them not to. */ + const [isOpen, setIsOpen] = useState(false); /* The step being walked through: the first that is neither done nor skipped. Derived on every render, which is what makes completing the work advance @@ -95,7 +98,7 @@ export function SetupTour({ userid, tenantid, steps, home }: SetupTourProps) { return ( !step.done)?.title ?? ''} + steps={steps} onStart={() => { walkedTo.current = null; setTour(startTour(userid, tenantid)); @@ -140,6 +143,18 @@ export function SetupTour({ userid, tenantid, steps, home }: SetupTourProps) { + {/* Collapsed by default. The bar sits on every page for the whole + walkthrough, so a permanently open panel would be a paragraph + between the header and the work on every screen. Open, it stays + open across steps — somebody who wants the detail wants it for + all of them. */} +