Skip to content

Promote directive-demo fixes to main (7 broken demos → all verified on DEV) - #3097

Merged
jung-thomas merged 8 commits into
mainfrom
DEV
Nov 11, 2026
Merged

jung-thomas merged 8 commits into
mainfrom
DEV

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Summary

DEV→main promotion of the directive demo-tutorial fixes. All 7 broken demos are verified rendering on DEV (browser + screenshots). Bundles PRs #3091–#3094.

What's fixed

  • code-blocks: console line horizontal scroll (CSS), cds // [!code] diff markers preserved, file-tree depths + state prefixes (fixed reversed strings.TrimLeft), walkthrough line-click .line spans
  • content-reuse: dead hana-cloud-tutorial-1 → real hana-cloud-mission-trial-1; catalogBySlug wired so dead :tutorial/::requires refs now fail the rebuild loudly; xref + prereq card show the real title; prereq card CSS (was 0×0); "Tested with" panel (testedWith/requires were never forwarded through writeHugoPage)
  • rich-media: 8 placeholder assets (meta-tutorials#17); image hotspots now attach (wrapStandAloneImageWithinParagraph=false + images.ts transform) — 3 overlay dots render
  • ui-instructions: Joule chat input docked in the panel (autohide-footer rule was hijacking the nested <footer>)
  • rebuild pipeline: sync-approuter-css.cjs prefers source-built CSS when the approuter already serves that hash (breaks the stale-hash loop that stopped CSS-only fixes from reaching HANA pages)

Verification

  • All fixes confirmed in the live DEV browser with screenshots (prereq card, tested-with panel, hotspot dots) + getComputedStyle (Joule docking)
  • New regression tests: hotspot attr transform (4), catalog title capture (1), testedWith/requires frontmatter threading (4), highlight-cds diff-skip (1)
  • Full DEV deploy + content rebuild green

Post-merge

PROD full deploy + rebuild. Fail-loud cross-ref validation will hard-fail the rebuild if any dead slug remains.

…epths, line spans, diff markers

Fixes #3076 and step-2/4/5 bugs verified in browser:

- Step 1 (CSS): add white-space:pre + overflow-x:auto to .code-block-body pre for console line wrap
- Step 2 (highlight-cds): guard Shiki replacement on diff-marker presence; skip blocks with Chroma diff-* line classes so // [!code focus] annotations survive
- Step 4 (tree fence): fix reversed strings.TrimLeft arg order (was wrong order → garbage depth); add state-prefix (+/-/~) handling to preserve branch marks
- Step 5 (walkthrough): use highlight() instead of markdownify to emit .line spans for JS line-click handlers

All 4 code-blocks sub-fixes verified in live browser render (tree structure, depths, icons, state classes, line annotations, css classes, cds diff-focus intact). Tests pass 19/19.
…-render

fix(directive-demos): 7 broken tutorials — code-blocks + rich-media + content-reuse
…pages

Two gaps found while verifying the directive-demo fixes on DEV:

1. sync-approuter-css.cjs self-perpetuating stale-hash loop: a CSS-only SOURCE
   change ships on deploy (build:css rotates the fingerprinted file, which IS
   served), but every rebuild re-pins the OLD hash it scrapes from still-stale
   HANA pages — so the new CSS never reaches published pages. Fix: build from
   source first, and if the approuter already SERVES the source-built hash (200),
   keep the source build. This propagates the new CSS AND cannot 404 (the deploy
   shipped that exact file). Falls through to the #2920 sync path unchanged when
   source is ahead of the deploy (preserves the anti-drift invariant).

2. xref/prereq cards rendered the raw slug instead of the tutorial title on
   slug-targeted rebuilds — the referenced tutorial's <slug>.md isn't fetched to
   CACHE_DIR, so catalogBySlug fell back to slug-as-title. Fix: thread
   tutorials[].title through fetchBuildCatalog → CatalogTutorialMeta, and seed
   catalogBySlug from the CAP catalog titles (on-disk frontmatter still overrides
   where cached). The CAP /build/catalog carries a title for EVERY slug.

Verified against live DEV: source CSS hash 863da9b0 (console line-wrap fix) is
served 200 by the approuter → prefer-source path keeps it. 70/70 directive +
catalog tests pass.
…-render

fix(rebuild): propagate deployed CSS hash + real xref titles to HANA pages
…ots, Joule footer scope

Four demo-tutorial features were broken (verified in live browser, not just HTML):

1. Prereq card (::requires) rendered 0x0 — .tut-prereq-card/.prereq-* had NO CSS
   rule in any shipped stylesheet. Added rules to directives-ui.css (bundled).

2. "Tested with" panel never appeared — render-frontmatter.ts emits the
   testedWith param but nothing invoked the shortcode. Render it inline in
   u1-object-page.html from .Params.testedWith + added .tut-tested-with CSS.

3. Image hotspots (![](img){hotspots="..."}) leaked as raw text — goldmark only
   attaches {attr} blocks to BLOCK elements, not inline images. images.ts now
   moves a standalone image's trailing {...} onto the next line so goldmark
   attaches it and render-image.html emits the .tut-hotspot overlay anchors.
   In-prose images left untouched. +4 unit tests.

4. Joule chat input spanned the whole viewport — the autohide-footer rule in
   ui5-overrides.css targeted a bare `footer` descendant, which also matched the
   Joule panel's nested <footer class="joule-panel__footer"> and forced it
   position:fixed/left:0/right:0. Scoped the rule to `body > footer.site-footer`.
   Verified live: input now docks inside the 420px panel (was 1263px full-width).

40/40 image tests pass; Joule selector + geometry verified via live getComputedStyle.
…-render

fix(directive-demos): prereq card CSS, tested-with panel, hotspots, Joule footer
…ge hotspot attrs

Two remaining demo breakages, both root-caused by live DEV inspection + a local
Hugo render harness (not HTML grep):

1. Tested-with panel never populated: testedWith (and requires) were parsed,
   composed, and ACCEPTED by renderHugoFrontmatter (render-frontmatter.ts:114/
   120/274-275) — but writeHugoPage() in fetch-tutorials.ts never forwarded them
   from the composed result, so .Params.testedWith was always empty. Added both
   to the writeHugoPage signature, the renderHugoFrontmatter call, and the fetch
   call site. +4 regression tests asserting the rendered frontmatter carries them
   (the only prior testedWith test covered freshness-checking, not generation —
   which is why the drop was invisible).

2. Image hotspots: a standalone image's following block-attribute line
   (![](img)\n{hotspots=…}, produced by the images.ts transform in the prior
   commit) only reaches the image render hook's .Attributes when the image is NOT
   wrapped in a <p>. Verified with a local Hugo 0.147 harness: with
   wrapStandAloneImageWithinParagraph at its default (true) the attr never
   attaches; set false and render-image.html emits .tut-hotspot-wrap +
   data-hotspots + 3 .tut-hotspot anchors. Set the flag in hugo.toml. No CSS
   depends on p>img (checked); render hooks already emit their own wrappers.

Verified end-to-end in a local Hugo render; 4/4 new tests pass.
…-render

fix(directive-demos): tested-with param threading + image hotspot attr attachment
@jung-thomas
jung-thomas merged commit 3453938 into main Nov 11, 2026
10 checks passed
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