fix(design-templates): emit landing placeholders as .svg without png alias - #6477
fix(design-templates): emit landing placeholders as .svg without png alias#6477YOMXXX wants to merge 1 commit into
Conversation
β¦alias placeholder.ts no longer writes SVG payload under a .png alias β browsers sniff .png by extension and refuse SVG bytes, breaking every placeholder image (nexu-io#5903). compose.ts now references slot imagery with a strategy-aware extension: .svg for the placeholder strategy, .png for generate/bring-your-own, so placeholder and real imagery never mix extensions.
|
Thanks @YOMXXX β splitting placeholder outputs to real .svg files while keeping generated or user-supplied imagery on .png is the right shape for this bug. Iβm routing this through the normal review and validation flow now. |
|
π§ͺ This PR has changes that need a manual QA pass before merge β please hold off self-merging for now; we'll loop QA in once it's merge-ready. |
|
Heads-up: PR #5936 is also open against this area. Both PRs touch |
PerishCode
left a comment
There was a problem hiding this comment.
@YOMXXX This cleanly fixes the placeholder rendering failure by emitting SVG assets under truthful .svg filenames and making the composer select extensions from the imagery strategy while preserving PNG references for generated and bring-your-own assets. I verified all changed ranges and ran the generator/composer end to end: all 16 placeholder references resolve to emitted SVGs, no PNG aliases remain, and both real-image strategies still render 16 PNG references. Nice focused fix and clear documentationβthank you for tracking the browser-facing failure through both sides of the template workflow.
|
Closing this PR β #5936 by @vinkiYu (opened two weeks earlier) already fixes the same issue #5903 with broader coverage: it updates both the Landing and Landing Deck composers, adds the strategy-aware extension switch, and ships a red/green e2e suite ( |
|
Duplicate of #5936; closing in favor of the earlier, more complete fix. |
Fixes #5903
Why
The "Open Design Landing" skill's
placeholderstrategy materialized everyslot asset as
assets/<id>.pngwhose bytes were actually SVG XML β the old"png alias for compatibility" behavior. Browsers sniff
.pngby extension andrefuse the SVG payload, so every placeholder image rendered broken in the
generated artifact (exactly the broken-artifact screenshot in #5903).
I hit this while exercising the placeholder strategy end-to-end; the render
looked broken even though every expected filename existed.
What users will see
Generating a landing page with the placeholder image strategy now produces
working frames. The 16 placeholder slots are written as
assets/<id>.svgandthe composed HTML references them as
.svg; for thegenerate/bring-your-ownstrategies the HTML still references.png(real PNGbytes). Placeholder and real imagery never share an extension, so a browser
can no longer be asked to parse SVG bytes as PNG.
Surface area
design-templates/open-design-landing/Screenshots
Not applicable β no web UI surface changed. The change is visible in
generated artifacts produced by the skill.
Bug fix verification
design-templates/open-design-landinghasno test harness (no package.json / tests/ in the skill directory), so a red
spec wasn't cheap to write.
file-style check on the buggy behavior: placeholder output written undera
.pngfilename contained<?xml ...?><svgbytes.scripts/placeholder.tsinto a temp dir β writes 16.svgfiles, no.pngaliases.scripts/compose.tstwice (inputs withstrategy: placeholderandstrategy: bring-your-own) into temp HTML outputs; grepped<img src>tags: placeholder emits all 16
.svg, bring-your-own emits all 16.png.tsc --noEmiton both scripts passes.Validation
npx tsc --noEmit --strict ... scripts/compose.ts scripts/placeholder.tsβ clean.svg, bring-your-own β.png) β pass