feat: Guided Tours Framework (First Pipeline)#2347
Conversation
🎩 PreviewA preview build has been created at: |
f262b2f to
42a8c86
Compare
64f6366 to
da1c54e
Compare
ebfb573 to
3fa9ad5
Compare
da1c54e to
019a78f
Compare
019a78f to
fe394fe
Compare
3fa9ad5 to
fd171b1
Compare
598d4be to
3e48035
Compare
3e48035 to
0dd9520
Compare
0dd9520 to
7a95d8f
Compare
16488a0 to
a7d61b9
Compare
603e882 to
12e6005
Compare
a7d61b9 to
0ec274f
Compare
12e6005 to
e77d84f
Compare
ce72fb2 to
c02f37b
Compare
95114fe to
c6fff29
Compare
4cbc7a2 to
49a9026
Compare
c6fff29 to
1faf568
Compare
| } | ||
| }, [isOpen, ensureWindowRestoredId, currentStep, windows]); | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
🤖 This is an AI-generated code review comment.
This PR grows EditorTourBridge from FTA 53.9/cyclo 32/155 lines to FTA 76.3/cyclo 118/526 lines. The added interaction branches, DOM observers, timers, MobX reactions, selection repair, drag gating, and count tracking all live in one component/effect, which is above the static-analysis strong-flag thresholds and makes the first-pipeline tour behavior difficult to reason about or safely extend.
Suggestion: Split the new behavior into co-located helpers/hooks keyed by interaction, e.g. a small interaction handler map plus focused hooks for library search reset, ring selectors, required selection, and spec-count progression. Keep EditorTourBridge as the orchestrator and add targeted tests around each extracted handler.
Rule: static-analysis skill: FTA > 60 and cyclomatic complexity > 20 are strong flags; tangle-ui review checklist: flag readability/component-size regressions and split large mode-switch

Description
The interaction primitives, popover positioning, and CSS utilities needed to power the second guided tour (#2312 — Build Your First Pipeline). No visible behavior on its own; all testing happens in #2312.
Builds directly on #2299 (the first three interactions). This PR introduces the remaining interactions a build-from-scratch tour needs, plus a handful of cross-cutting tour-step features.
What's new
New interaction types (
EditorTourBridge.tsx)Each is declared on a tour step via
interaction: "<name>". Following the model established in #2299, a detected interaction marks the step complete in the shared tour-progress state — it does not advance the tour itself; the gated "Next" / auto-advance in #2340 handle progression.expand-folder— completes when the named folder in the component library is expanded (matches[data-folder-name=...] [aria-expanded="true"]).library-search— completes when the search box value contains a target substring; debounced so the user finishes typing first.add-task— completes when a task whose name matches a target substring is added to the canvas. Baseline counted at step start so pre-existing tasks don't false-trigger.add-input/add-output— count-based: complete whenspec.inputs.length/spec.outputs.lengthincreases.connect-edge— completes when a specific edge is drawn, matched by(sourceTaskName, sourcePortName, targetTaskName, targetPortName). The target task/port pair is optional.set-argument— completes when a specific argument on any task is set to a non-empty string.Existing
select-task(from #2299) gets atargetTaskNamenarrowing — only the named task counts, not any task.Contextual checklist labels
Adds the checklist copy for the interactions this PR introduces (using the contextual bold-target support from #2340):
add-task→ "Add {targetTaskName} to the canvas"expand-folder→ "Open the {targetFolderName} folder"library-search→ "Search the library for {targetSearchTerm}"set-argument→ "Set the {targetArgumentName} value"add-input/add-output/connect-edge→ generic phrasingsEach falls back to a generic label when its target field isn't set.
Cross-cutting step features
ringSelectors— paint per-element rings via the new.tour-ringCSS class (reactour mergeshighlightedSelectorsinto one bounding box; per-handle rings need a separate mechanism).requiresTaskSelected— auto-rewind to a previousselect-taskstep if the required task is no longer selected.ensureWindowRestored— auto-restore a minimized/hidden dock window at step start.resetLibrarySearch— clear the component-library search box before the step's selector is queried.libraryDragAllow— block drags of library items that don't match the step's target.Popover positioning
computeDefaultPopoverPositiongets a symmetric left-anchored tall-strip branch (mirrors the right-anchored branch from feat: Guided Tours Foundation #2348) for steps that highlight the component library.POPOVER_STYLES.clickAreaset topointer-events: noneso the spotlight click-area doesn't intercept drags onto the canvas.Misc
TourStepregistry types extended with the new interaction fields (targetFolderName,targetSearchTerm,targetTaskName,targetComponentName,targetEdge,targetArgumentName, plus the cross-cutting flags above)..tour-ringCSS utility ineditor.css, with a React Flow handle override (position: absolute).defaultPipelineYamlWithNamenowJSON.stringifys the name (pipelines named with YAML-special characters were breaking the YAML).Related Issue and Pull requests
Progresses https://github.com/Shopify/oasis-frontend/issues/583
Builds on #2299. Consumed by #2312 (First Pipeline tour content).
Type of Change
Checklist
Test Instructions
No visible behavior on its own — every new utility is unused until #2312 lands. Regression-only checks in isolation:
select-taskwithouttargetTaskNamestill completes on click of any task (the narrowing is opt-in).Additional Comments
Originally bundled into #2312 alongside the tour content; split out so reviewers can read the mechanics and the tour JSON separately.