feat: Guided Tours Framework (Subgraphs)#2365
Conversation
🎩 PreviewA preview build has been created at: |
49656f5 to
a182d2f
Compare
57b8cdd to
afb2772
Compare
a182d2f to
5adf525
Compare
113a417 to
78cc132
Compare
5adf525 to
514c488
Compare
78cc132 to
7767801
Compare
514c488 to
05098d2
Compare
7767801 to
ee03e31
Compare
05098d2 to
b571f54
Compare
ee03e31 to
8dd2a4e
Compare
b571f54 to
0124745
Compare
8dd2a4e to
d60f1d2
Compare
0124745 to
75ab404
Compare
d60f1d2 to
721f5de
Compare
677a1a3 to
601b598
Compare
4ee52d2 to
65b41d0
Compare
0bf07b8 to
ccceaaf
Compare
108348f to
f153d01
Compare
ccceaaf to
d97d028
Compare
354c787 to
a87f286
Compare
3f6cba6 to
90ca438
Compare
a87f286 to
e2e270d
Compare
490aab5 to
a823d2b
Compare
024fa81 to
5b3c86f
Compare
a823d2b to
084077f
Compare
5b3c86f to
53954e7
Compare
24c1b06 to
b29b14d
Compare
53954e7 to
7309ada
Compare
b29b14d to
5e3cb0e
Compare
7309ada to
8f77f57
Compare
5e3cb0e to
3327563
Compare
8f77f57 to
90e6c78
Compare
3327563 to
892742c
Compare
90e6c78 to
421444d
Compare
892742c to
3598673
Compare
421444d to
e5c0b36
Compare
3598673 to
36905f7
Compare
e5c0b36 to
419ef51
Compare
| }; | ||
| } | ||
|
|
||
| if (interaction === "navigate-into-subgraph") { |
There was a problem hiding this comment.
🤖 This is an AI-generated code review comment.
This PR adds five more interaction branches directly inside EditorTourBridge, raising the file from 526 to 676 lines, cyclomatic complexity from 118 to 142, and FTA from 76.27 to 81.86. The file was already high, but this diff materially worsens the central orchestrator and duplicates local helpers like countSubgraphTasks, making future tour interactions harder to reason about and test.
Suggestion: Extract the subgraph-specific interaction tracking into co-located pure helpers or small handler functions, and share the countSubgraphTasks helper between create/unpack paths. Keep EditorTourBridge as the orchestration layer that delegates each interaction family.
Rule: static-analysis skill thresholds; tangle-ui-review Readability & Component Size; .cursorrules Code Quality prefers reducing nesting and extracting duplicated logic

Description
The subgraph-specific interaction mechanics for the guided-tour framework, layered on the framework stack (#2348 / #2299 / #2347 / #2340). Foundation for the Subgraphs tour (#2366) — this PR adds the interaction types and the bridge logic that detects them; the tour content lands in #2366.
Five new tour interactions cover navigating and authoring subgraphs, plus a canvas re-measurement fix so spotlights track the viewport when navigation changes the view.
What changed
Interaction vocabulary (
src/components/Learn/tours/registry.ts)Five new
TourStep.interactionvalues, plus atargetMinCountfield:navigate-into-subgraph— descends a level (optionally gated to a specifictargetTaskName)navigate-to-root— returns to the top levelunpack-subgraph— the active spec's subgraph-task count drops (a subgraph was flattened)multi-select-tasks— ≥targetMinCount(default 2) task nodes are selectedcreate-subgraph— the subgraph-task count rises (a subgraph was created)Bridge handlers (
src/routes/v2/pages/Editor/components/EditorTourBridge.tsx)Each interaction is detected by observing the existing MobX stores —
navigation.navigationDepth/navigationPathfor level changes,navigation.activeSpec.tasks(countingsubgraphSpec) for unpack/create, andeditor.multiSelectionfor multi-select. Following the model from #2299, a detected interaction marks the step complete in the shared tour-progress state (it does not advance the tour itself); already-satisfied-on-entry states are marked complete immediately. Gated "Next" / auto-advance (#2340) handle progression.Contextual checklist labels
Adds the checklist copy for these interactions (using the contextual bold-target support from #2340):
navigate-into-subgraph→ "Open the {targetTaskName} subgraph"multi-select-tasks→ "Select {targetMinCount} tasks"navigate-to-root→ "Return to the top level"unpack-subgraph→ "Unpack the subgraph"create-subgraph→ "Create a subgraph from the selected tasks"Spotlight re-measurement while navigating
resizeevent (viarequestAnimationFrame) whenever the xyflow viewport pans/zooms during an open tour, so reactour re-positions the highlight/popover after navigating into a subgraph shifts the canvas.ensureWindowRestorednow waits for the target DOM to actually appear — the step's ownselector, else the dock window — polling up to 1.5s before forcing a re-measure, instead of measuring against a not-yet-rendered target.Related Issue and Pull requests
Progresses https://github.com/Shopify/oasis-frontend/issues/583
Builds on the framework stack (#2348 / #2299 / #2347 / #2340); consumed by the Subgraphs tour in #2366.
Type of Change
Checklist
Test Instructions
The registry is otherwise inert in this PR — the interactions are exercised end-to-end by the Subgraphs tour in #2366. To verify in isolation:
ensureWindowRestoredsteps, and the dock/window highlight steps still work.Additional Comments
Selector/anchor additions and the seed pipeline for the subgraph tour live in #2366, following the convention that tour-specific DOM anchors ship alongside the tour that needs them.