Skip to content

The first-run tour picks its script by the layout's own rule - #648

Merged
MerciHanrim merged 1 commit into
mainfrom
t1-tour-script-by-layout
Nov 22, 2026
Merged

MerciHanrim merged 1 commit into
mainfrom
t1-tour-script-by-layout

Conversation

@MerciHanrim

Copy link
Copy Markdown
Owner

Part of #610 (review item T1).

What was wrong

Start tour on the first-run Welcome card picked its script with innerWidth < 768 (GuidedTour.tsx:18), while the layout follows MOBILE_MEDIA_QUERY (src/ui/media.ts): max-width: 720px, or max-height: 500px and max-width: 950px with a coarse pointer, a phone held sideways. The two disagreed in two ranges. Reproduced on main f0415d17 with a fresh browser per window, the real first-run card, and Start tour clicked:

Window Layout Tour Steps on their target
844 × 390, touch phone desktop 1 of 6
932 × 430, touch phone desktop 1 of 6
740 × 800 desktop phone 2 of 6
767 × 800 desktop phone 2 of 6

On the phone held sideways, step 1 was the desktop's "Pieces — Click one, or drag it onto the canvas, to add it" on the phone layout, which cannot edit, as a centred card with nothing highlighted.

The change

  • GuidedTour.tsx: PLATFORM() reads MOBILE_MEDIA_QUERY, the layout's own rule, when Start tour is pressed. The 768 rule is gone; nothing else used it.
  • The replays are unchanged: Help's Restart the tour exists only in the desktop layout and runs the desktop script, More's only in the phone layout and runs the phone script.
  • docs/guided-tour.md §GT3 says which rule picks the script.

Out of scope, as decided:

Tests

e2e/guided-tour.spec.ts, "guided tour — the script follows the layout (review T1, #610)", two tests through the real Welcome card:

  • 844 × 390 with touch: the phone layout gets the phone script, all six steps on their targets.
  • 740 × 800: the desktop layout gets the desktop script; every step but the Inspector one on its target, and the Inspector one on the fallback card, pinned as it is.

Both failed on main's code (platform was desktop on the phone held sideways and mobile at 740 px), and both pass now.

The ten windows of the reproduction, run again on this branch: every one has the layout and the tour agreeing.

  • The phones held sideways (844 × 390, 932 × 430, 740 × 360), 390 × 844 and 720 × 800 get the phone script, 6 of 6 steps on their targets.
  • 740, 767 and 768 px desktop windows get the desktop script, 5 of 6 (the Inspector step).
  • 1024 × 768 with touch and 1280 × 800 get the desktop script, 6 of 6.

Local:

  • every check:* script: 0 failed;
  • tsc -b: clean;
  • lint: 88 warnings, the baseline;
  • unit: 5718 passed;
  • related e2e, one worker, no retries:
    • chromium, 108 passed: guided-tour, tour-announcement, contextual-inline-help, share, share-protected, portable-file;
    • mobile project, 105 passed: mobile-inspector-overlay (the tour over a selection) and mobile, whose screenshot comparisons ran against their committed images.

Part of #610 (review T1). Start tour on the Welcome card chose the script with innerWidth < 768, while the layout follows MOBILE_MEDIA_QUERY: a phone held sideways got the desktop script on the phone layout, and a 721-767 px window the phone script on the desktop layout. It now reads the layout's query. Two e2e cases through the real Welcome card fail on the previous code.
@MerciHanrim MerciHanrim added the bug Something isn't working label Nov 22, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying cozy-loop-studio with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8550fde
Status: ✅  Deploy successful!
Preview URL: https://4ca0ce9d.cozy-loop-studio.pages.dev
Branch Preview URL: https://t1-tour-script-by-layout.cozy-loop-studio.pages.dev

View logs

@MerciHanrim
MerciHanrim merged commit 5fe30b7 into main Nov 22, 2026
13 checks passed
@MerciHanrim
MerciHanrim deleted the t1-tour-script-by-layout branch November 22, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant