Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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>
  • Loading branch information
waleedlatif1 and claude committed Mar 24, 2026
commit 752d0438ab15b9bf79233272242cb52ad10a0eee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

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

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

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

const refCallback = useCallback(
(node: HTMLDivElement | null) => {
if (!hasSetRef.current && tooltipProps.ref) {
if (tooltipProps.ref) {
;(tooltipProps.ref as React.RefCallback<HTMLDivElement>)(node)
hasSetRef.current = true
}
},
[tooltipProps.ref]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use client'

import { WorkflowTour } from '@/app/workspace/[workspaceId]/components/product-tour'
import { ErrorBoundary } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/error'

Expand Down
Loading