diff --git a/src/components/OnboardingTour.tsx b/src/components/OnboardingTour.tsx index c1cef066..14907524 100644 --- a/src/components/OnboardingTour.tsx +++ b/src/components/OnboardingTour.tsx @@ -2,6 +2,7 @@ import { useEffect, useRef, useState, useCallback } from "react"; import { createPortal } from "react-dom"; +import { FocusTrap } from "focus-trap-react"; const TOUR_KEY = "reframe_onboarding_complete"; @@ -44,7 +45,7 @@ const TOUR_STEPS: TourStep[] = [ }, ]; -const PADDING = 12; // spotlight padding around target element +const PADDING = 12; const TOOLTIP_OFFSET = 16; interface Rect { @@ -76,16 +77,19 @@ function getTooltipStyle( top: sr.top - th - TOOLTIP_OFFSET, left: sr.left + sr.width / 2 - tw / 2, }; + case "left": return { top: sr.top + sr.height / 2 - th / 2, left: sr.left - tw - TOOLTIP_OFFSET, }; + case "right": return { top: sr.top + sr.height / 2 - th / 2, left: sr.left + sr.width + TOOLTIP_OFFSET, }; + case "bottom": default: return { @@ -126,13 +130,14 @@ function Spotlight({ rect }: SpotlightProps) { /> + - {/* Highlight ring */} + - {/* Progress bar */}
- {/* Step counter */}

Step {stepIndex + 1} of {totalSteps}

{step.title}

+

{step.description}

@@ -209,6 +213,7 @@ function Tooltip({ > Skip tour +