Skip to content

Commit 752d043

Browse files
waleedlatif1claude
andcommitted
chore(tour): address second round of PR review comments
- Remove unnecessary 'use client' from workflow layout (children are already client components) - Fix ref guard timing issue in TourTooltipAdapter that could prevent Joyride from tracking tooltip on subsequent steps Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9c9c1f8 commit 752d043

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

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

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

3-
import { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react'
3+
import { createContext, useCallback, useContext, useEffect, useState } from 'react'
44
import type { TooltipRenderProps } from 'react-joyride'
55
import { TourTooltip } from '@/components/emcn'
66

@@ -60,10 +60,8 @@ export function TourTooltipAdapter({
6060
}: TooltipRenderProps) {
6161
const { isTooltipVisible, isEntrance, totalSteps } = useContext(TourStateContext)
6262
const [targetEl, setTargetEl] = useState<HTMLElement | null>(null)
63-
const hasSetRef = useRef(false)
6463

6564
useEffect(() => {
66-
hasSetRef.current = false
6765
const { target } = step
6866
if (typeof target === 'string') {
6967
setTargetEl(document.querySelector<HTMLElement>(target))
@@ -76,9 +74,8 @@ export function TourTooltipAdapter({
7674

7775
const refCallback = useCallback(
7876
(node: HTMLDivElement | null) => {
79-
if (!hasSetRef.current && tooltipProps.ref) {
77+
if (tooltipProps.ref) {
8078
;(tooltipProps.ref as React.RefCallback<HTMLDivElement>)(node)
81-
hasSetRef.current = true
8279
}
8380
},
8481
[tooltipProps.ref]

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use client'
2-
31
import { WorkflowTour } from '@/app/workspace/[workspaceId]/components/product-tour'
42
import { ErrorBoundary } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/error'
53

0 commit comments

Comments
 (0)