Repository navigation
feat(#2811): load tutorial-variables island in QA preview - #2855
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.htmlwas gated by(not site.Params.qa) (not site.Params.previewMode).hugo.qa.tomlsetsqa = 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 — soexpandSentinels()/applyValue()never ran. Net effect, confirmed live on step 5:{{var:userNumber}}flattened to the frontmatter placeholderXX(...UserXX) with no input field and no live substitution.Fix
Drop the
qa/previewModeconditions from thetutorial-variablesisland loader, keeping the.Params.variablesguard so variable-free tutorials still ship no extra script.Why this is sufficient
:345) and config JSON (:510) are already gated only by.Params.variables→ already present on QA.scripts/sync-island-manifest-qa.cjscopies the whole island manifest intohugo/data-qa/, so thetutorial-variablesfingerprint 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-5and confirm an input field renders (label "Your user number", placeholderXX, maxLength 3) and typing propagates to...User<typed>across the step. Pre-change: no input, staticXX.