feat(#506): add Import example dashboard to the File menu - #510
Merged
Conversation
Adds a File ▾ → Import example dashboard… action that opens a modal listing the three shipped flagship examples (ClickHouse Operations, Shop Charts, OnTime Charts) from a checked-in manifest, and imports the selected one through the existing Dashboard import/codec/validation/commit pipeline — purely additive, so an existing Dashboard is never replaced or merged. The catalogue is generated at build time (build/compile-example-dashboards.mjs -> src/generated/example-dashboards.ts, mirroring the JSON-Schema pipeline) so it ships embedded in the single-file artifact; npm run check:examples (wired into prebuild/pretest) fails on a missing, malformed, or stale example. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P47CfxtXoAC2WiPKDiWudp
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 & why
Adds File ▾ → Import example dashboard… — a modal that lists the three
shipped flagship example dashboards (ClickHouse Operations, Shop Charts,
OnTime Charts) from a checked-in manifest, and imports the selected one
through the existing Dashboard import/codec/validation/dependency-closure/
commit pipeline. It's purely additive (same rule as the existing Import
dashboard… row): an existing Dashboard is never replaced or merged into,
and Cancel/Escape/an outside click leave the workspace untouched.
The catalogue (
examples/dashboard-manifest.json+ the three referencedexamples/*.jsonfiles) is compiled at build time by the newbuild/compile-example-dashboards.mjsinto a checked-in generated module(
src/generated/example-dashboards.ts), mirroring the existing JSON-Schemageneration pipeline (
build/compile-json-schemas.mjs) — so it ships embeddedin the single-file production artifact rather than as separate served files.
npm run check:examples(wired intoprebuild/pretest, alongsidecheck:schemas) fails the build on a missing, malformed, or stale example soone can't ship unnoticed.
Closes #506
Checklist
npm testpasses (the per-file coverage gate is non-negotiable)npm run buildsucceeds (single-filedist/sql.html)src/core/, network insrc/net/(injected fetch), DOM insrc/ui/CHANGELOG.md([Unreleased]) updatedTest plan
npm test— 5961 unit tests, 100%/100% statements/lines per-file coverage gate greennpm run pretest— schemas, examples, arch boundaries,tsc --noEmitall greennpm run build— artifact builds (~2 MiB raw / ~585 KiB gzip)--workers=1) — 481 passed, 2 skipped (unrelated), 0 failed, including the newtests/e2e/import-example-dashboard.spec.js(first-ever File-menu e2e spec: dialog listing/selection, Cancel-no-change, Escape-no-change, Import-appends-and-opens)