feat(impl-generate): enable interactive HTML previews for JavaScript libs#8251
Merged
Merged
Conversation
…libs
The browser render harness already emits standalone plot-{light,dark}.html for
JS implementations, the GCS upload promotes them (gated only on file existence),
and the frontend renders preview_html when present — but the metadata HAS_HTML
allowlist only listed the 6 Python interactive libs, so preview_html_light/dark
were written as null for chartjs/d3/echarts. The interactive HTML sat in
production GCS unused (e.g. .../echarts/plot-light.html returns 200) and no
"Interactive" toggle appeared on the site.
Enable HTML for JavaScript libs in both the metadata block and the issue-preview
step. Gate on the plot-{light,dark}.html files actually existing (rather than
language alone), so a lib or render that produced no HTML can never point
preview_html at a 404. Verified all three current JS libs emit both theme HTMLs
(staging returns 200 for chartjs/d3, production for echarts).
Already-generated JS impls must be regenerated to pick up the URLs (the HTML
itself is already uploaded to GCS).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Enables the existing interactive HTML previews for JavaScript implementations (echarts/chartjs/d3) by allowing the pipeline to populate preview_html_light/dark in metadata and to include “Interactive” links in the issue preview comment, gated on the actual presence of the generated HTML files.
Changes:
- Extend the
HAS_HTMLlogic during metadata generation to include JavaScript implementations when bothplot-light.htmlandplot-dark.htmlexist. - Extend the issue preview comment generation to link interactive HTML for JavaScript implementations when both theme HTML files exist.
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.
Problem
Interactive JS charts (echarts/chartjs/d3) render no Interactive toggle on the site, even though the interactive HTML already exists in production GCS:
The pipeline already does the hard parts: the render harness emits standalone
plot-{light,dark}.html, the GCS upload promotes them (gated only on file existence, not library), and the frontend (themedPreview.ts+SpecDetailView/SpecOverview) renderspreview_htmlwhen present.The only gap: the metadata
HAS_HTMLallowlist lists only the 6 Python interactive libs, sopreview_html_light/darkare written asnullfor all JavaScript libs → the frontend never shows the toggle and the uploaded HTML sits unused.Fix
Enable HTML for JavaScript libs in both places that carried the allowlist:
HAS_HTML→preview_html_*)Gated on file existence, not language alone:
so a JS lib (or a failed render) that produces no HTML can never wire
preview_htmlto a 404 — strictly safer than the currentnull. Verified all three current JS libs emit both theme HTMLs (staging 200 for chartjs/d3, production 200 for echarts). The Python interactive allowlist is left untouched.Follow-up after merge
Re-dispatch
impl-generatefor echarts/chartjs/d3 on scatter-basic so their metadata picks up thepreview_htmlURLs (the HTML is already in GCS). No frontend change needed — theInteractivetoggle is already wired topreview_html.🤖 Generated with Claude Code