Repository navigation
Promote directive-demo fixes to main (7 broken demos → all verified on DEV) - #3097
Merged
Merged
Conversation
…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 ({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
(\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
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.
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]diff markers preserved, file-tree depths + state prefixes (fixed reversedstrings.TrimLeft), walkthrough line-click.linespanshana-cloud-tutorial-1→ realhana-cloud-mission-trial-1;catalogBySlugwired so dead:tutorial/::requiresrefs 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 throughwriteHugoPage)wrapStandAloneImageWithinParagraph=false+ images.ts transform) — 3 overlay dots render<footer>)sync-approuter-css.cjsprefers 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
getComputedStyle(Joule docking)Post-merge
PROD full deploy + rebuild. Fail-loud cross-ref validation will hard-fail the rebuild if any dead slug remains.