diff --git a/surfsense_web/components/onboarding-tour.tsx b/surfsense_web/components/onboarding-tour.tsx index 077a93be3..1e7be0f44 100644 --- a/surfsense_web/components/onboarding-tour.tsx +++ b/surfsense_web/components/onboarding-tour.tsx @@ -16,7 +16,7 @@ const TOUR_STEPS: TourStep[] = [ target: '[data-joyride="connector-icon"]', title: "Connect your data sources", content: - "Click this icon to connect and sync data from GitHub, Slack, Notion, Jira, Confluence, and more.", + "Connect and sync data from Gmail, Drive, Slack, Notion, Jira, Confluence, and more.", placement: "bottom", }, { @@ -78,18 +78,21 @@ function calculatePosition(targetEl: Element, placement: TourStep["placement"]): function Spotlight({ targetEl, isDarkMode, - stepIndex, + currentStepTarget, }: { targetEl: Element; isDarkMode: boolean; - stepIndex: number; + currentStepTarget: string; }) { const rect = targetEl.getBoundingClientRect(); const padding = 6; const shadowColor = isDarkMode ? "#172554" : "#0c1a3a"; - // Check if this is the connector icon step (stepIndex === 0) - const isConnectorStep = stepIndex === 0; + // Check if this is the connector icon step - verify both the selector matches AND the element matches + // This prevents the shape from changing before targetEl updates + const isConnectorSelector = currentStepTarget === '[data-joyride="connector-icon"]'; + const isConnectorElement = targetEl.matches('[data-joyride="connector-icon"]'); + const isConnectorStep = isConnectorSelector && isConnectorElement; // For circle, use the larger dimension to ensure it's a perfect circle const circleSize = isConnectorStep ? Math.max(rect.width, rect.height) : 0; @@ -135,7 +138,6 @@ function TourTooltip({ stepIndex, totalSteps, position, - targetRect, onNext, onPrev, onSkip, @@ -243,7 +245,7 @@ function TourTooltip({