Repository navigation
render-svg: --states, node states drawn through the client's own painter - #105
Merged
Merged
Conversation
For looking at a status source's answer without VS Code: `--states <file.json>` hands node states to the client as the webview would get them, through the overlay bridge's painter and GLSP feedback, so what is drawn is what the editor draws. It needs both the renderer (#91) and the status overlay (#101), so it waited for both to be on main. Claude-Session: https://claude.ai/code/session_01E8WfqKknDNN6xpNVcJL5K8
… inline JSON safely Review of #105: - A states file holding an object (`{"states": [...]}`) was dropped silently and the render drew no states; it is now refused, naming the file and what it holds. Malformed JSON in `--states` or `--families` now names the file too. - The schema, the client behaviour and the states were written raw into an inline `<script>`, so a `</script>` in a node id ended the script and the render failed with "nothing rendered". Every `<` is escaped. - The README and the usage block say a node id may be the producer's or the diagram's, that ids the view does not have are skipped, and that `idle` draws nothing. Without `--states` the output is byte-identical to before. Claude-Session: https://claude.ai/code/session_01E8WfqKknDNN6xpNVcJL5K8
This was referenced Oct 24, 2026
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.
What
scripts/render-svg/render.mjs --states <file.json>draws node states (a status source's answer,[{ nodeId, status }]) in the headless render. They reach the client the way the webview receives them: through the overlay bridge's painter and GLSP feedback, so the render shows what the editor draws (except arunningstate, whose ring the SVG export already draws wrong, in the editor's own Export as SVG too; that is a separate fix insvg-export.ts).It needs both the renderer (#91) and the status overlay (#101), so it waited until both were on
main. ndf-ide'snpm run render -- --coverageuses it.Three files under
scripts/render-svg(README,headless-entry.ts,render.mjs), 15 lines; no platform package changes.Review fixes
A states file that is not an array is refused, naming the file. Malformed JSON in
--statesor--familiesnames the file. Inline JSON escapes<. The README says how ids match, that unknown ids are skipped, and thatidledraws nothing.https://claude.ai/code/session_01E8WfqKknDNN6xpNVcJL5K8