improvement(tour): fix tour auto-start logic and standardize selectors#3751
improvement(tour): fix tour auto-start logic and standardize selectors#3751waleedlatif1 merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Standardizes tour targeting to Updates settings tooltips to trigger from an info icon, tweaks Written by Cursor Bugbot for commit 7fddadf. Configure here. |
apps/sim/app/workspace/[workspaceId]/components/product-tour/use-tour.ts
Outdated
Show resolved
Hide resolved
Greptile SummaryThis PR makes several targeted fixes and improvements to the product tour system. The primary change — a module-level Key changes across the PR:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant C as Component Mount
participant H as useTour Hook
participant S as autoStartAttempted Set
participant LS as localStorage
participant RAF as rAF / setTimeout
C->>H: mount (disabled=false)
H->>S: has(storageKey)?
S-->>H: false
H->>LS: isTourCompleted(storageKey)?
LS-->>H: false
H->>RAF: setTimeout(autoStartDelay)
Note over C,H: Component remounts (e.g. navigation)
C->>H: unmount → cleanup clears timer
C->>H: remount (disabled=false)
H->>S: has(storageKey)?
S-->>H: false (add() not called yet)
H->>RAF: setTimeout(autoStartDelay) again ⚠️
RAF-->>H: timer fires
H->>H: check disabledRef.current
H->>S: add(storageKey)
H->>RAF: scheduleReveal() → rAF(outer) → rAF(inner) → setIsTooltipVisible(true)
Note over H,RAF: On step transition
H->>H: setIsTooltipVisible(false)
H->>RAF: cancelPendingTransitions() → clears transitionTimer + rafRef
H->>RAF: setTimeout(FADE_OUT_MS)
RAF-->>H: fires → setStepIndex, scheduleReveal()
Note over H,RAF: On pause/stop/unmount
H->>RAF: cancelPendingTransitions() → cancelAnimationFrame(rafRef.current)
Reviews (2): Last reviewed commit: "fix(tour): address PR review comments" | Re-trigger Greptile |
apps/sim/app/workspace/[workspaceId]/components/product-tour/tour-shared.tsx
Outdated
Show resolved
Hide resolved
apps/sim/app/workspace/[workspaceId]/components/product-tour/tour-shared.tsx
Show resolved
Hide resolved
apps/sim/app/workspace/[workspaceId]/components/product-tour/use-tour.ts
Outdated
Show resolved
Hide resolved
- Move autoStartAttempted.add() inside timer callback to prevent blocking auto-start when tour first mounts while disabled - Memoize setJoyrideRef with useCallback to prevent ref churn - Remove unused joyrideRef
|
@greptile |
|
@cursor review |
Summary
disabledRefso auto-start effect doesn't re-trigger on navigationdata-tourattributesloopprop to Tooltip.Preview (defaults to true), useloop={false}for auto-connectType of Change
Testing
Tested manually
Checklist