Skip to content

feat(#2811): load tutorial-variables island in QA preview - #2855

Merged
jung-thomas merged 1 commit into
DEVfrom
qa-tutorial-variables-island
Oct 20, 2026
Merged

jung-thomas merged 1 commit into
DEVfrom
qa-tutorial-variables-island

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Problem

Tutorial authors using the new variables: feature (#2811) with {{var:NAME}} tokens cannot verify it in the QA preview channel (/tutorials-qa/). Reported against dev-garage-customer-request.

Root cause: the island loader in hugo/layouts/tutorials/u1-object-page.html was gated by (not site.Params.qa) (not site.Params.previewMode). hugo.qa.toml sets qa = true, so the <script> was never emitted on QA. The panel div and config JSON still rendered (gated only by .Params.variables), but nothing mounted them — so expandSentinels()/applyValue() never ran. Net effect, confirmed live on step 5: {{var:userNumber}} flattened to the frontmatter placeholder XX (...UserXX) with no input field and no live substitution.

Fix

Drop the qa/previewMode conditions from the tutorial-variables island loader, keeping the .Params.variables guard so variable-free tutorials still ship no extra script.

Why this is sufficient

  • Panel div (:345) and config JSON (:510) are already gated only by .Params.variables → already present on QA.
  • scripts/sync-island-manifest-qa.cjs copies the whole island manifest into hugo/data-qa/, so the tutorial-variables fingerprint is already available to the QA build — no allowlist to update.

Scope note

This intentionally diverges from the other after-content islands (pip, rating, code-check, related-graph, learning-path), which remain QA-suppressed. Variables is an authoring-correctness feature authors need to preview before promoting, so enabling it on QA is deliberate.

Verification

Template change only; proven conditional syntax. Real validation is post-deploy on DEV: load /tutorials-qa/dev-garage-customer-request#step-5 and confirm an input field renders (label "Your user number", placeholder XX, maxLength 3) and typing propagates to ...User<typed> across the step. Pre-change: no input, static XX.

The tutorial-variables island JS was gated by (not site.Params.qa)
(not site.Params.previewMode), so interactive {{var:NAME}} fields never
mounted on /tutorials-qa/ — the token flattened to its frontmatter
placeholder with no input field. Authors previewing a tutorial in the QA
channel could not verify the variables feature before promoting to prod.

Drop the qa/previewMode conditions from the island loader, keeping the
.Params.variables guard so variable-free tutorials still ship no extra
script. The panel div and config JSON were already gated only by
.Params.variables (render on QA), and sync-island-manifest-qa.cjs copies
the whole island manifest, so the tutorial-variables fingerprint is
already available to the QA build — no other wiring needed.
@jung-thomas
jung-thomas merged commit 5277fa3 into DEV Oct 20, 2026
5 checks passed
@jung-thomas
jung-thomas deleted the qa-tutorial-variables-island branch October 20, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant