refactor(#447): move shop-charts.json/ontime-charts.json to Dashboard v2 - #507
Conversation
…oard v2 Completes the phase-3 example rewrite spec-examples.test.js's pinned-version test had been waiting on: shop-charts.json and ontime-charts.json move to portable-bundle v2 / Dashboard document v2, dropping their curated `filters` arrays in favor of inferred Variables, matching clickhouse-operations.json's earlier migration (#458 follow-up). Audited every from/to/country/category/carrier/origin filter's `targets` list against the {name:Type} placeholders actually present in each tile's SQL: they already matched exactly, so removing the curated model changes no runtime variable-to-query assignment. build-ontime-charts.mjs now threads its bundle's own `version` through to writeExampleBundle instead of silently reverting to v1 on regeneration. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011sMwR4BHM85MExSBYXzTYj
…riables The v2 migration left every Array/enum-shaped variable (country/category, carrier/origin, user/query_kind/exception_code/query_hash/metric/ is_initial_query) as bare freeform-text input, with no configured variableConfigs. This wasn't new breakage from the v2 move itself: #447's mechanical minimum pass had already dropped every curated filter's sourceQueryId, and the pre-#447 option-source queries (shop-filter-options, ontime-filter-options, gco-filter) returned one row of ARRAY-typed columns -- a shape the v2 option-SQL contract (one row per option, two String columns: value, then label) can't reuse directly. Port each old option-source query into its own variableConfigs[name].sql under the new contract, restoring the searchable (multi-)select these variables used to have before #447. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011sMwR4BHM85MExSBYXzTYj
|
Added a follow-up commit: the v2 migration left every Array/enum-shaped variable ( Verified the full compiled option batch ( |
Summary
shop-charts.jsonandontime-charts.jsonmove to portable-bundle v2 / Dashboard document v2, dropping their curatedfiltersarrays in favor of inferred Variables — completing the "phase 3" example rewritespec-examples.test.jshad been pinning them against, followingclickhouse-operations.json's earlier move (feat(#447): inferred Dashboard Variables, replacing the curated filter model (phase 1) #458 follow-up).from/to/country/category/carrier/originfilter'stargetslist against the{name:Type}placeholders actually present in each tile's SQL: they already matched exactly, so this is a mechanical model migration with no change to which variables apply to which tiles.build-ontime-charts.mjs: it wasn't threadingversionthrough towriteExampleBundle, so regenerating the file would have silently reverted it to v1.examples/mjs/normalize-examples.mjs,examples/mjs/README.md, andtests/unit/spec-examples.test.jsto reflect the new pinned versions.Test plan
node examples/mjs/normalize-examples.mjs --checknpx tsc --noEmitnode build/compile-json-schemas.mjs --checknode build/check-boundaries.mjsTZ=America/New_York npx vitest run --config tests/vitest.config.ts(5935/5935 passing)🤖 Generated with Claude Code
https://claude.ai/code/session_011sMwR4BHM85MExSBYXzTYj