Skip to content

Commit fd51d05

Browse files
chore: fix review changes
1 parent 338f884 commit fd51d05

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

apps/sim/app/workspace/[workspaceId]/components/product-tour/product-tour.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'
44
import { createLogger } from '@sim/logger'
55
import dynamic from 'next/dynamic'
6+
import { usePathname } from 'next/navigation'
67
import type { TooltipRenderProps } from 'react-joyride'
78
import { TourTooltip } from '@/components/emcn'
89
import { navTourSteps } from '@/app/workspace/[workspaceId]/components/product-tour/nav-tour-steps'
@@ -125,17 +126,17 @@ function NavTooltipAdapter({
125126
)
126127
}
127128

128-
/**
129-
* Navigation tour that walks through sidebar items on first workspace visit.
130-
* Runs once automatically and cannot be retriggered.
131-
*/
132129
export function NavTour() {
130+
const pathname = usePathname()
131+
const isWorkflowPage = /\/w\/[^/]+/.test(pathname)
132+
133133
const { run, stepIndex, tourKey, isTooltipVisible, isEntrance, handleCallback } = useTour({
134134
steps: navTourSteps,
135135
storageKey: NAV_TOUR_STORAGE_KEY,
136136
autoStartDelay: 1200,
137137
resettable: false,
138138
tourName: 'Navigation tour',
139+
disabled: isWorkflowPage,
139140
})
140141

141142
const tourState = useMemo<TourState>(

apps/sim/app/workspace/[workspaceId]/components/product-tour/use-tour.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ interface UseTourOptions {
2222
triggerEvent?: string
2323
/** Identifier for logging */
2424
tourName?: string
25+
/** When true, suppresses auto-start (e.g. to avoid overlapping with another active tour) */
26+
disabled?: boolean
2527
}
2628

2729
interface UseTourReturn {
@@ -77,6 +79,7 @@ export function useTour({
7779
resettable = false,
7880
triggerEvent,
7981
tourName = 'tour',
82+
disabled = false,
8083
}: UseTourOptions): UseTourReturn {
8184
const [run, setRun] = useState(false)
8285
const [stepIndex, setStepIndex] = useState(0)
@@ -131,7 +134,7 @@ export function useTour({
131134

132135
/** Auto-start on first visit */
133136
useEffect(() => {
134-
if (hasAutoStarted.current) return
137+
if (disabled || hasAutoStarted.current) return
135138
hasAutoStarted.current = true
136139

137140
const timer = setTimeout(() => {
@@ -151,7 +154,7 @@ export function useTour({
151154
}, autoStartDelay)
152155

153156
return () => clearTimeout(timer)
154-
}, [storageKey, autoStartDelay, tourName])
157+
}, [storageKey, autoStartDelay, tourName, disabled])
155158

156159
/** Listen for manual trigger events */
157160
useEffect(() => {

0 commit comments

Comments
 (0)