Skip to content

Commit 00930cf

Browse files
committed
Fix tour stuck on step 1 and add Next button
1 parent 788a2c4 commit 00930cf

2 files changed

Lines changed: 29 additions & 10 deletions

File tree

apps/code/src/renderer/features/tour/components/TourOverlay.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,17 @@ export function TourOverlay() {
112112

113113
const el = document.querySelector(selector);
114114
if (el) {
115+
if (el.getAttribute("data-tour-ready") === "true") {
116+
tryAdvance();
117+
return;
118+
}
119+
115120
observer.observe(el, {
116121
subtree: true,
117122
childList: true,
118123
characterData: true,
119124
attributes: true,
120125
});
121-
resetTimer();
122126
}
123127

124128
return () => {
@@ -132,6 +136,13 @@ export function TourOverlay() {
132136
const overlayBlocked = settingsOpen || commandMenuOpen;
133137
const isActive = !!(tour && step && targetRect && !overlayBlocked);
134138

139+
const handleNext = () => {
140+
if (activeTourId && step) {
141+
advancedRef.current = true;
142+
advance(activeTourId, step.id);
143+
}
144+
};
145+
135146
return (
136147
<>
137148
<SpotlightOverlay targetRect={isActive ? targetRect : null} />
@@ -141,6 +152,7 @@ export function TourOverlay() {
141152
stepNumber={activeStepIndex + 1}
142153
totalSteps={tour.steps.length}
143154
onDismiss={dismiss}
155+
onNext={handleNext}
144156
targetRect={targetRect}
145157
/>
146158
)}

apps/code/src/renderer/features/tour/components/TourTooltip.tsx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ interface TourTooltipProps {
1111
stepNumber: number;
1212
totalSteps: number;
1313
onDismiss: () => void;
14+
onNext: () => void;
1415
targetRect: DOMRect;
1516
}
1617

@@ -150,6 +151,7 @@ export function TourTooltip({
150151
stepNumber,
151152
totalSteps,
152153
onDismiss,
154+
onNext,
153155
targetRect,
154156
}: TourTooltipProps) {
155157
const isDarkMode = useThemeStore((s) => s.isDarkMode);
@@ -259,15 +261,20 @@ export function TourTooltip({
259261
<Text size="1" style={{ color: "var(--gray-9)" }}>
260262
{stepNumber}/{totalSteps}
261263
</Text>
262-
<Button
263-
size="1"
264-
variant="ghost"
265-
color="gray"
266-
onClick={onDismiss}
267-
style={{ opacity: 0.5 }}
268-
>
269-
Skip tour
270-
</Button>
264+
<Flex align="center" gap="2">
265+
<Button
266+
size="1"
267+
variant="ghost"
268+
color="gray"
269+
onClick={onDismiss}
270+
style={{ opacity: 0.5 }}
271+
>
272+
Skip tour
273+
</Button>
274+
<Button size="1" variant="ghost" onClick={onNext}>
275+
Next
276+
</Button>
277+
</Flex>
271278
</Flex>
272279
</Flex>
273280
</motion.div>

0 commit comments

Comments
 (0)