Skip to content

feat: Guided Tours Custom Navigation#2340

Open
camielvs wants to merge 1 commit into
06-02-feat_guided_tours_foundationfrom
05-29-feat_guided_tours_navigation_dots_track_progress
Open

feat: Guided Tours Custom Navigation#2340
camielvs wants to merge 1 commit into
06-02-feat_guided_tours_foundationfrom
05-29-feat_guided_tours_navigation_dots_track_progress

Conversation

@camielvs

@camielvs camielvs commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Description

Replaces reactour's default Prev/Next with a custom tour navigation and the interactive-step UX layer that sits on top of it: progress dots, a completion-gated "Next", an action checklist in the popover, and auto-progress. Visible behavior becomes observable once the registry has tours (#2306 onwards).

What's in it

Custom navigation

  • Progress dots between Prev and Next, one per step, colored by visit state (current / visited / unvisited). Non-clickable — bouncing between arbitrary steps would leave reactour inconsistent on tours with interaction gates.
  • The furthest-reached step is tracked at module level so the indicator survives popover remounts and stays accurate on tours that swap step content via setSteps.
  • Visit-aware Next: a "Next" text label on the furthest-reached step, a chevron-only button on revisits.

Step completion + gated "Next"

  • TourProgressContext tracks per-step completion (a Set of completed step indices), reset whenever a tour opens.
  • On an interactive step, "Next" is disabled until the step's interaction is reported complete (the editor bridge in feat: Guided Tours Framework (Navigating the Editor) #2299 reports completion). On non-interactive steps, and on already-complete/revisited steps, it's enabled.

Action checklist

Auto-progress

  • TourAutoAdvance advances ~800ms after a fresh completion — long enough to see the tick register. Steps already complete on arrival (e.g. revisited via Back) stay on a manual click; clicking "Next" advances immediately and cancels the pending auto-advance.

File layout

  • Navigation components live in TourNavigation.tsx (TourNavigation, NavButton, GatedNextButton/renderNextButton, TourStepChecklist, TourAutoAdvance, and the module-level visit-tracking helpers).
  • TourPopover.tsx keeps popover styling/positioning, the viewport clamp bridge, and the completion actions.
  • TourProgressContext.tsx holds the completion state + useTourProgress hook. Tests: TourNavigation.test.tsx and TourProgressContext.test.tsx.

Popover polish

  • The navigation row fills the popover width, and the checklist is spaced from the step content above it.

Related Issue and Pull requests

Progresses https://github.com/Shopify/oasis-frontend/issues/583

Depends on #2348 (foundation). The interaction detection that drives completion lands in #2299; interaction-specific checklist labels are authored in #2299 / #2347 / #2365.

Type of Change

  • New feature

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Test Instructions

With a tour registered (use this branch with #2306 on top):

Dots

  • Step through the tour. Each dot fills in as you reach it — current is enlarged + saturated, visited is lighter blue, unvisited is zinc-gray. Clicking a dot does nothing (intentionally disabled).

Checklist + gated Next

  • On an interactive step (e.g. step 7's "click the Greet task"), a checklist row shows the required action and "Next" is disabled.
  • Complete the action — the row ticks (check animation + strike-through) and, after ~800ms, the tour auto-advances. Clicking "Next" while it's enabled advances immediately.
  • A step whose action is already satisfied on arrival shows pre-checked with "Next" enabled.

Visit-aware Next + revisits

  • On the furthest step reached, "Next" shows a text label; stepping back via Prev collapses it to a chevron. Revisited (already-complete) steps do not auto-advance — they wait for a manual click.

Reset between tours

  • Finish a tour, return to /learn/tours, start a different one. Completion + visited-max reset for the new tour.

@github-actions

github-actions Bot commented May 29, 2026

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: 05-29-feat_guided_tours_navigation_dots_track_progress/ed43073

camielvs commented May 29, 2026

Copy link
Copy Markdown
Collaborator Author

@camielvs camielvs mentioned this pull request May 29, 2026
3 tasks
@camielvs camielvs added the #gsd:50583 Learning Hub label May 29, 2026 — with Graphite App
@camielvs camielvs changed the title feat: Guided Tours Navigation Dots Track Progress feat: Guided Tours Custom Navigation May 29, 2026
@camielvs camielvs force-pushed the 05-29-feat_guided_tours_navigation_dots_track_progress branch 2 times, most recently from 7f83eb8 to 9899ee2 Compare May 29, 2026 19:18
@camielvs camielvs force-pushed the 05-20-feat_learning_hub_tour_framework_and_first_tour branch from 84f39e0 to d6d13ae Compare May 29, 2026 19:24
@camielvs camielvs force-pushed the 05-29-feat_guided_tours_navigation_dots_track_progress branch from 9899ee2 to a773cce Compare May 29, 2026 19:24
@camielvs camielvs force-pushed the 05-20-feat_learning_hub_tour_framework_and_first_tour branch from d6d13ae to e97b036 Compare May 29, 2026 21:22
@camielvs camielvs force-pushed the 05-29-feat_guided_tours_navigation_dots_track_progress branch from a773cce to b9acf61 Compare May 29, 2026 21:22
@camielvs camielvs mentioned this pull request May 29, 2026
3 tasks
@camielvs camielvs force-pushed the 05-20-feat_learning_hub_tour_framework_and_first_tour branch from e97b036 to d308ae7 Compare May 29, 2026 21:29
@camielvs camielvs force-pushed the 05-29-feat_guided_tours_navigation_dots_track_progress branch 2 times, most recently from 9b16f8f to fadf84a Compare May 29, 2026 22:33
@camielvs camielvs force-pushed the 05-20-feat_learning_hub_tour_framework_and_first_tour branch 2 times, most recently from 95b9b2a to 01da4c7 Compare May 29, 2026 23:19
@camielvs camielvs force-pushed the 05-29-feat_guided_tours_navigation_dots_track_progress branch from fadf84a to 5cd15ef Compare May 29, 2026 23:19
@camielvs camielvs force-pushed the 05-20-feat_learning_hub_tour_framework_and_first_tour branch from 01da4c7 to d9c0e95 Compare May 29, 2026 23:34
@camielvs camielvs force-pushed the 06-02-feat_guided_tours_foundation branch from dd40a33 to 47cfe52 Compare June 3, 2026 19:56
@camielvs camielvs force-pushed the 05-29-feat_guided_tours_navigation_dots_track_progress branch from febd689 to 68175d1 Compare June 3, 2026 19:57
@camielvs camielvs force-pushed the 06-02-feat_guided_tours_foundation branch from 47cfe52 to 606887b Compare June 3, 2026 20:02
@camielvs camielvs force-pushed the 05-29-feat_guided_tours_navigation_dots_track_progress branch from 68175d1 to aaa1a46 Compare June 3, 2026 20:02
@camielvs camielvs force-pushed the 06-02-feat_guided_tours_foundation branch from 606887b to d29cf67 Compare June 3, 2026 20:08
@camielvs camielvs force-pushed the 05-29-feat_guided_tours_navigation_dots_track_progress branch 2 times, most recently from 6b7ed93 to af8b204 Compare June 3, 2026 22:40
@camielvs camielvs force-pushed the 06-02-feat_guided_tours_foundation branch from d29cf67 to 5455cd2 Compare June 3, 2026 22:40
@camielvs camielvs force-pushed the 05-29-feat_guided_tours_navigation_dots_track_progress branch from af8b204 to 7938fe4 Compare June 4, 2026 18:58
Comment thread src/providers/TourProvider/TourNavigation.tsx
Comment thread src/providers/TourProvider/TourNavigation.tsx Outdated
Comment thread src/providers/TourProvider/TourNavigation.tsx Outdated
Comment thread src/providers/TourProvider/TourNavigation.tsx Outdated
Comment thread src/providers/TourProvider/TourNavigation.tsx Outdated
Comment thread src/providers/TourProvider/TourNavigation.tsx Outdated
);
}

export function TourNavigation(props: NavigationProps) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 This is an AI-generated code review comment.

This PR adds new exported React components/hooks under src/providers/TourProvider, but react-compiler.config.js is unchanged and src/providers/TourProvider is not covered by REACT_COMPILER_ENABLED_DIRS. The review standard treats missing compiler coverage for new components/hooks as High because it bypasses the project's incremental React Compiler adoption.

Suggestion: Add the new TourProvider files, or the cleaned-up TourProvider directory, to react-compiler.config.js after fixing compiler-incompatible patterns in this PR.

Rule: tangle-ui-review: React Compiler adoption; .claude/skills/react-patterns/SKILL.md: Adding Files to React Compiler


const stepsLength = steps.length;

recordTourVisited(currentStep);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 This is an AI-generated code review comment.

recordTourVisited(currentStep) mutates module-level state while TourNavigation renders. This is not React Compiler compatible and also makes visited navigation state global to the module instead of scoped to a TourProvider instance.

Suggestion: Keep visited progress in provider-scoped React state/context, and update it from an effect or navigation action rather than mutating module state during render.

Rule: .claude/skills/react-patterns/SKILL.md: React Compiler compatible code must not mutate values during render

);
}

export function TourNavigation(props: NavigationProps) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 This is an AI-generated code review comment.

FTA reports TourNavigation.tsx at 61.75 with cyclomatic complexity 40 across 280 lines, which is over the strong-flag thresholds. The new file combines navigation buttons, revisit tracking, checklist rendering, progress dots, and auto-advance timing.

Suggestion: Split this into smaller sibling components/hooks, e.g. TourNavButton, TourProgressDots, useVisitedTourSteps, and TourAutoAdvance, so each unit has one responsibility and lower complexity.

Rule: static-analysis skill: FTA > 60 and cyclomatic complexity > 20 are strong flags; tangle-ui-review: Readability & component size

stepIndex: number;
}) {
const { isStepComplete } = useTourProgress();
const interactiveStep = step as ChecklistStep | undefined;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 This is an AI-generated code review comment.

The new checklist casts StepType to ChecklistStep instead of narrowing or typing the tour step metadata at the source. That bypasses the TypeScript standard's preference for type guards and proper source typing over as Type assertions.

Suggestion: Define a project tour-step type that extends Reactour's StepType with the supported interaction metadata, or add a small type guard that checks interaction before passing the step to tourActionLabel.

Rule: .claude/skills/typescript-standards/SKILL.md: avoid unsafe type casting; prefer proper typing/type guards

<InlineStack
gap="2"
blockAlign="center"
className="rounded-md bg-muted px-3 py-2"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 This is an AI-generated code review comment.

The new navigation UI passes Tailwind className values into Tangle UI primitives such as InlineStack, Icon, Text, BlockStack, and Badge. The UI primitive standard says to use semantic props, tone, variants, or a local raw-HTML primitive rather than styling primitives through className.

Suggestion: Move layout/background needs into supported primitive props or a small local wrapper/pattern component, and use semantic tone/variant props for text/icon/dot colors instead of hardcoded color classes.

Rule: tangle-ui-review: UI primitives; .claude/skills/ui-primitives/SKILL.md: prefer primitives and semantic props over raw class styling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50583 Learning Hub

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants