Skip to content

Commit 2129225

Browse files
chore: Tour Updates
1 parent 4cec083 commit 2129225

File tree

8 files changed

+111
-103
lines changed

8 files changed

+111
-103
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ export const navTourSteps: Step[] = [
88
'Your starting point. Describe what you want to build in plain language or pick a template to get started.',
99
placement: 'right',
1010
disableBeacon: true,
11+
spotlightPadding: 0,
1112
},
1213
{
1314
target: '[data-item-id="search"]',
1415
title: 'Search',
1516
content: 'Quickly find workflows, blocks, and tools. Use Cmd+K to open it from anywhere.',
1617
placement: 'right',
1718
disableBeacon: true,
19+
spotlightPadding: 0,
1820
},
1921
{
2022
target: '[data-item-id="tables"]',

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ export function NavTour() {
157157
callback={handleCallback}
158158
continuous
159159
disableScrolling
160+
disableScrollParentFix
160161
disableOverlayClose
161162
spotlightPadding={4}
162163
tooltipComponent={NavTooltipAdapter}
@@ -180,14 +181,18 @@ export function NavTour() {
180181
spotlight: {
181182
backgroundColor: 'transparent',
182183
border: '1px solid rgba(255, 255, 255, 0.1)',
183-
borderRadius: 6,
184+
borderRadius: 8,
184185
boxShadow: '0 0 0 9999px rgba(0, 0, 0, 0.55)',
186+
position: 'fixed' as React.CSSProperties['position'],
185187
transition:
186188
'top 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94), left 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94), width 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94), height 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94)',
187189
},
188190
overlay: {
189191
backgroundColor: 'transparent',
190192
mixBlendMode: 'unset' as React.CSSProperties['mixBlendMode'],
193+
position: 'fixed' as React.CSSProperties['position'],
194+
height: '100%',
195+
overflow: 'visible',
191196
},
192197
}}
193198
/>

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

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -87,25 +87,13 @@ export function useTour({
8787
const hasAutoStarted = useRef(false)
8888
const retriggerTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)
8989
const transitionTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)
90-
const prevOverflowRef = useRef('')
91-
92-
/** Lock page scroll to prevent scrollbar jitter from Joyride's overlay */
93-
const lockScroll = useCallback(() => {
94-
prevOverflowRef.current = document.documentElement.style.overflow
95-
document.documentElement.style.overflow = 'hidden'
96-
}, [])
97-
98-
const unlockScroll = useCallback(() => {
99-
document.documentElement.style.overflow = prevOverflowRef.current
100-
}, [])
10190

10291
const stopTour = useCallback(() => {
10392
setRun(false)
10493
setIsTooltipVisible(true)
10594
setIsEntrance(true)
106-
unlockScroll()
10795
markTourCompleted(storageKey)
108-
}, [storageKey, unlockScroll])
96+
}, [storageKey])
10997

11098
/** Transition to a new step with a coordinated fade-out/fade-in */
11199
const transitionToStep = useCallback(
@@ -115,7 +103,7 @@ export function useTour({
115103
return
116104
}
117105

118-
/** Fade out the current tooltip */
106+
/** Hide tooltip during transition */
119107
setIsTooltipVisible(false)
120108

121109
if (transitionTimerRef.current) {
@@ -129,7 +117,7 @@ export function useTour({
129117

130118
/**
131119
* Wait for the browser to process the Radix Popover repositioning
132-
* before fading in the tooltip at the new position.
120+
* before showing the tooltip at the new position.
133121
*/
134122
requestAnimationFrame(() => {
135123
requestAnimationFrame(() => {
@@ -148,12 +136,17 @@ export function useTour({
148136

149137
const timer = setTimeout(() => {
150138
if (!isTourCompleted(storageKey)) {
151-
lockScroll()
152139
setStepIndex(0)
153140
setIsEntrance(true)
154-
setIsTooltipVisible(true)
141+
setIsTooltipVisible(false)
155142
setRun(true)
156143
logger.info(`Auto-starting ${tourName}`)
144+
145+
requestAnimationFrame(() => {
146+
requestAnimationFrame(() => {
147+
setIsTooltipVisible(true)
148+
})
149+
})
157150
}
158151
}, autoStartDelay)
159152

@@ -173,14 +166,24 @@ export function useTour({
173166
clearTimeout(retriggerTimerRef.current)
174167
}
175168

169+
/**
170+
* Start with the tooltip hidden so Joyride can mount, find the
171+
* target element, and position its overlay/spotlight before the
172+
* tooltip card appears.
173+
*/
176174
retriggerTimerRef.current = setTimeout(() => {
177175
retriggerTimerRef.current = null
178-
lockScroll()
179176
setStepIndex(0)
180177
setIsEntrance(true)
181-
setIsTooltipVisible(true)
178+
setIsTooltipVisible(false)
182179
setRun(true)
183180
logger.info(`${tourName} triggered via event`)
181+
182+
requestAnimationFrame(() => {
183+
requestAnimationFrame(() => {
184+
setIsTooltipVisible(true)
185+
})
186+
})
184187
}, 50)
185188
}
186189

@@ -198,9 +201,8 @@ export function useTour({
198201
if (transitionTimerRef.current) {
199202
clearTimeout(transitionTimerRef.current)
200203
}
201-
unlockScroll()
202204
}
203-
}, [unlockScroll])
205+
}, [])
204206

205207
const handleCallback = useCallback(
206208
(data: CallBackProps) => {

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

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ export const workflowTourSteps: Step[] = [
1010
disableBeacon: true,
1111
},
1212
{
13-
target: '[data-tour="command-list"]',
14-
title: 'Quick Actions',
13+
target: '[data-tab-button="copilot"]',
14+
title: 'AI Copilot',
1515
content:
16-
'Keyboard shortcuts to get started fast. Press Cmd+K to search blocks, or Cmd+Y to browse templates.',
17-
placement: 'right',
16+
'Build and debug workflows using natural language. Describe what you want and Copilot creates the blocks for you.',
17+
placement: 'bottom',
1818
disableBeacon: true,
19+
spotlightPadding: 0,
1920
},
2021
{
2122
target: '[data-tab-button="toolbar"]',
@@ -24,14 +25,7 @@ export const workflowTourSteps: Step[] = [
2425
'Browse all available blocks and triggers. Drag them onto the canvas to build your workflow step by step.',
2526
placement: 'bottom',
2627
disableBeacon: true,
27-
},
28-
{
29-
target: '[data-tab-button="copilot"]',
30-
title: 'AI Copilot',
31-
content:
32-
'Build and debug workflows using natural language. Describe what you want and Copilot creates the blocks for you.',
33-
placement: 'bottom',
34-
disableBeacon: true,
28+
spotlightPadding: 0,
3529
},
3630
{
3731
target: '[data-tab-button="editor"]',
@@ -40,12 +34,13 @@ export const workflowTourSteps: Step[] = [
4034
'Click any block on the canvas to configure it here. Set inputs, credentials, and fine-tune behavior.',
4135
placement: 'bottom',
4236
disableBeacon: true,
37+
spotlightPadding: 0,
4338
},
4439
{
4540
target: '[data-tour="deploy-run"]',
46-
title: 'Run & Deploy',
41+
title: 'Deploy & Run',
4742
content:
48-
'Hit Run to test your workflow. When ready, Deploy it as an API, webhook, schedule, or chat widget.',
43+
'Deploy your workflow as an API, webhook, schedule, or chat widget. Then hit Run to test it out.',
4944
placement: 'bottom',
5045
disableBeacon: true,
5146
},
@@ -55,6 +50,7 @@ export const workflowTourSteps: Step[] = [
5550
content:
5651
'Switch between pointer and hand mode, undo or redo changes, and fit the canvas to your view.',
5752
placement: 'top',
53+
spotlightPadding: 0,
5854
disableBeacon: true,
5955
},
6056
]

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
'use client'
22

33
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'
4-
import { createLogger } from '@sim/logger'
54
import dynamic from 'next/dynamic'
65
import type { TooltipRenderProps } from 'react-joyride'
76
import { TourTooltip } from '@/components/emcn'
87
import { useTour } from '@/app/workspace/[workspaceId]/components/product-tour/use-tour'
98
import { workflowTourSteps } from '@/app/workspace/[workspaceId]/components/product-tour/workflow-tour-steps'
109

11-
const logger = createLogger('WorkflowTour')
12-
1310
const Joyride = dynamic(() => import('react-joyride'), {
1411
ssr: false,
1512
})
@@ -158,8 +155,9 @@ export function WorkflowTour() {
158155
callback={handleCallback}
159156
continuous
160157
disableScrolling
158+
disableScrollParentFix
161159
disableOverlayClose
162-
spotlightPadding={4}
160+
spotlightPadding={1}
163161
tooltipComponent={WorkflowTooltipAdapter}
164162
floaterProps={{
165163
disableAnimation: true,
@@ -183,12 +181,16 @@ export function WorkflowTour() {
183181
border: '1px solid rgba(255, 255, 255, 0.1)',
184182
borderRadius: 6,
185183
boxShadow: '0 0 0 9999px rgba(0, 0, 0, 0.55)',
184+
position: 'fixed' as React.CSSProperties['position'],
186185
transition:
187186
'top 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94), left 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94), width 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94), height 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94)',
188187
},
189188
overlay: {
190189
backgroundColor: 'transparent',
191190
mixBlendMode: 'unset' as React.CSSProperties['mixBlendMode'],
191+
position: 'fixed' as React.CSSProperties['position'],
192+
height: '100%',
193+
overflow: 'visible',
192194
},
193195
}}
194196
/>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ export default function WorkflowLayout({ children }: { children: React.ReactNode
77
return (
88
<main className='flex h-full flex-1 flex-col overflow-hidden'>
99
<ErrorBoundary>{children}</ErrorBoundary>
10-
<WorkflowTour />
10+
<div className='absolute h-0 w-0 overflow-hidden'>
11+
<WorkflowTour />
12+
</div>
1113
</main>
1214
)
1315
}

apps/sim/components/emcn/components/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ export { TimePicker, type TimePickerProps, timePickerVariants } from './time-pic
147147
export { ToastProvider, toast, useToast } from './toast/toast'
148148
export { Tooltip } from './tooltip/tooltip'
149149
export {
150+
TourCard,
151+
type TourCardProps,
150152
TourTooltip,
151153
type TourTooltipPlacement,
152154
type TourTooltipProps,

0 commit comments

Comments
 (0)