Skip to content

feat(impl-generate): enable interactive HTML previews for JavaScript libs#8251

Merged
MarkusNeusinger merged 1 commit into
mainfrom
fix/impl-generate-js-html-preview
Jun 2, 2026
Merged

feat(impl-generate): enable interactive HTML previews for JavaScript libs#8251
MarkusNeusinger merged 1 commit into
mainfrom
fix/impl-generate-js-html-preview

Conversation

@MarkusNeusinger
Copy link
Copy Markdown
Owner

Problem

Interactive JS charts (echarts/chartjs/d3) render no Interactive toggle on the site, even though the interactive HTML already exists in production GCS:

.../plots/scatter-basic/javascript/echarts/plot-light.html → 200
.../plots/scatter-basic/javascript/echarts/plot-dark.html  → 200

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) renders preview_html when present.

The only gap: the metadata HAS_HTML allowlist lists only the 6 Python interactive libs, so preview_html_light/dark are written as null for 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:

  • the metadata block (HAS_HTMLpreview_html_*)
  • the issue-preview step (cosmetic "Interactive" links)

Gated on file existence, not language alone:

if [ "$LANGUAGE" = "javascript" ] && [ -f "$IMPL_DIR/plot-light.html" ] && [ -f "$IMPL_DIR/plot-dark.html" ]; then
  HAS_HTML="true"
fi

so a JS lib (or a failed render) that produces no HTML can never wire preview_html to a 404 — strictly safer than the current null. 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-generate for echarts/chartjs/d3 on scatter-basic so their metadata picks up the preview_html URLs (the HTML is already in GCS). No frontend change needed — the Interactive toggle is already wired to preview_html.

🤖 Generated with Claude Code

…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>
Copilot AI review requested due to automatic review settings June 2, 2026 22:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_HTML logic during metadata generation to include JavaScript implementations when both plot-light.html and plot-dark.html exist.
  • Extend the issue preview comment generation to link interactive HTML for JavaScript implementations when both theme HTML files exist.

@MarkusNeusinger MarkusNeusinger merged commit 31afb9b into main Jun 2, 2026
8 checks passed
@MarkusNeusinger MarkusNeusinger deleted the fix/impl-generate-js-html-preview branch June 2, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants