Repository navigation
watch: embed local images in PNG previews - #2947
Open
dajiaohuang wants to merge 1 commit into
Open
dajiaohuang wants to merge 1 commit into
dajiaohuang wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Fixes #2945.
Problem
With
d2 --watch input.d2 output.png, a localshape: imageicon is written correctly into the PNG, but the SVG sent to the watch viewer still has its relativehref. The browser requests that path from the watch server, which interprets it as a board name and reportsrender target "…" not found.Change
Bundle the PNG preview with the same resolver used to build its raster scene, reusing
bundleRasterPreviewas GIF and paged exports already do. The exported PNG and preview therefore share the resolved image snapshot. No layout, browser-serving policy, flags, or help/manpage semantics change. Add a local-image PNG/preview regression and a changelog entry.Validation
6a7b4837838a3907604a1d9eec57ee98b6f3cd01with a generated 1×1 PNG: the preview had a relative URL, the authenticated asset GET returned HTML, and the next WebSocket update reported the missing render target.go test ./d2cli -count=1 -timeout=120s: only two Windows Unix-permission assertions fail (TestBoardOutputPublicationRollsBackWholeTransaction,TestIsometricImageAtomicReplacement); both also fail on unmodified master. Other package tests pass.go install .andgit diff --checkpass. Go 1.27.0, Windows amd64. Full./make.sh, JS/WASM/race suites and cross-platform visual acceptance were not run.