Repository navigation
fix(dashboard,core): one declaration of which chart families ignore compareTo; the dashboard stops running the comparison query for pie / donut / funnel / scatter (#7495) - #10400
Conversation
…ompareTo (objectui#7495) `chartTypeIgnoresCompareTo` in `@object-ui/core`'s chart-presentation is now the single answer to "which chart families ignore `compareTo`" (pie, donut, funnel, scatter). plugin-charts' ObjectChart reads it in place of its local `supportsCompareTo`, with byte-identical answers. plugin-dashboard's DatasetWidget drops its narrower `chartType === 'scatter'` copy and stops asking the executor for a comparison for a chart of those families: no `compareTo` in the selection and no window lowered into `timeDimensions`, so the comparison pass no longer runs. Metric and table widgets are unaffected. Claude-Session: https://claude.ai/code/session_01BA3nKVUwKQJf8DBxrSVtNC
…-predicate pin (objectui#7495) `funnel` reaches ObjectChart at run time through DashboardRenderer's object-chart path but is outside `ObjectChartSchema['chartType']`'s declared union, so the pin takes a bare string and casts at the one call. Claude-Session: https://claude.ai/code/session_01BA3nKVUwKQJf8DBxrSVtNC
|
changeset-claim-re-read
|
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Fixes #7495
Clause-②: yes
What this does
Ruling 5749199335 (letter A), ratified as 5809246443: one predicate in
@object-ui/core'schart-presentation, read by bothplugin-chartsandplugin-dashboard; the dashboard stops running the comparison query for pie, donut, funnel and scatter.@object-ui/core: new exportchartTypeIgnoresCompareTo(chartType)inchart-presentation.ts. It reaches the package entry through the existingexport * from './utils/chart-presentation.js', soindex.tsis not edited. It answerstrueforpie/donut/funnel/scatter, andfalsefor every other spec chart family, an unknown string, the empty string, a case variant, andundefined. The docblock states the rule, the reason per family and why it lives in core, and cites objectui#7495.@object-ui/plugin-charts: ObjectChart's localsupportsCompareTois deleted. Both call sites (the comparison fetch and the overlay-series synthesis) read!chartTypeIgnoresCompareTo(schema.chartType). The answers equal the retired predicate's for every input, so behaviour is unchanged.@object-ui/plugin-dashboard: DatasetWidget'schartIgnoresCompareTo = chartType === 'scatter'copy is deleted.compareTois now decided once, near the top of the component: it isundefinedwhen the widget reaches the chart branch (!isMetric && !isTable) and its chart family (afterCHART_TYPE_MAP:pyramidtofunnel,bubbletoscatter) ignorescompareTo. Every downstream reader follows from that one value: nocompareToin thequeryDatasetselection, no window lowered intotimeDimensions(the window stays inruntimeFilter, byte-identical to the same widget with nocompareTo), an emptycomparedValues, and no overlay series.chartTypemoved up from the chart branch to feed that decision, so it is still declared once.Done-when (mechanical). At HEAD,
git grep -nE "IgnoresCompareTo|supportsCompareTo|IGNORING_COMPARE_TO" -- 'packages/*/src/**' 'apps/*/src/**' ':!**/__tests__/**' ':!**/*.test.*'lists ONE list declaration (CHART_TYPES_IGNORING_COMPARE_TOin core's chart-presentation) and its readers: the exported function, two call sites in ObjectChart, and one in DatasetWidget. No=== 'scatter'compare-to guard remains in the dashboard.Behaviour change and risk reading
series[0], and objectui#7402 had already suppressed the scatter overlay.compareTothat has no single dated window (objectstackservice-analyticsdataset-executor.ts, "compareTo needs a dated window to shift"). The widget used to render that refusal in place of the chart. A widget of an ignoring family now draws its chart. This is pinned both ways: the pie renders, and the bar control still shows the refusal.compareToappears in 0 files underexamples/**in this repo, re-measured at3861a6a6d, while the control"type": "bar"hits 5examples/**/*.jsonfiles (the same reading as triage comment 5548747753). Tenant incidence is not measurable from here.compareTo.piewidget with NO dimensions renders as a metric tile, which shows the comparison as a delta, so it keeps it. The gate is the chart branch, not the widget type.Hunk positions (objectui#10169 overlap)
chart-presentation.ts: this PR's only hunk is@@ -440,3 +440,48 @@. The predicate is appended afterchartConfigPresentation, at the end of the file. #10169 edits@@ -84,@@ -105and@@ -217. Measured:git apply --checkof #10169's three chart-presentation hunks against this branch head exits 0.packages/core/src/index.tsis not edited.Tests (HEAD
3861a6a6d)New pins:
packages/core/src/utils/__tests__/chart-presentation.compareTo-7495.test.ts: the predicate over everyChartTypeSchema.optionsfamily from@objectstack/spec/ui(read at run time), plusundefined, an unknown string, the empty string, case variants, andbubble/pyramid(false, because the caller maps them to a family first). It also pins the package-entry export identity.packages/plugin-charts/src/__tests__/ObjectChart.compareTo.corePredicate-7495.test.tsx:packages/plugin-dashboard/src/__tests__/DatasetWidget.compareTo.ignoredFamilies-7495.test.tsx:compareToand notimeDimensions, it equals the no-compareTo selection, and the chart gets one series only.Runs, from the repo root through the verify lock, at
3861a6a6d:pnpm exec vitest run packages/core/src/utils/ packages/plugin-charts/plus the nine text-reading pins listed below:Test Files 161 passed (161),Tests 2484 passed (2484).pnpm exec vitest run packages/plugin-dashboard/:Test Files 124 passed (124),Tests 1213 passed (1213).turbo run build --filter='@object-ui/plugin-dashboard^...'(12 of 12 tasks successful): for core, plugin-charts and plugin-dashboard,tsc --noEmit && tsc -p tsconfig.test.jsonexits 0. The three new test files are in each package's test program (--listFilesOnly).Text-reading pins (from a repo-wide
git grepfor tests that readObjectChart.tsx,DatasetWidget.tsxorchart-presentationas text), all green in the run above:residue-namespaces-3546dashboard-widget-options-censusbase-bind-declaredchart-data-model-7113object-chart-undeclared-keys-8885widget-schema-anchors-7946zod-mirror-paritycheck-control-bytesunconsumed-widget-option-claim-6186Ablations
Each ablation ran after the fix was committed, with
scripts/ablation-replace.mjsfrom objectstack. Each restore was proven on disk.chartType === 'scatter'(anchor: thechartTypeIgnoresCompareTo(chartType)term in thecompareTodecision). Result: 13 failed, 13 passed of 26. Every pie, donut, funnel and pyramid pin (3 each) went red, and so did the undated-filter pie pin. The scatter and bubble pins and every control stayed green. Blob19d85e1ea29dwent toaa355d627edcand was restored to19d85e1ea29d, equal to HEAD, with an emptygit diff HEAD.git diff HEADis empty.No build was needed between the mutation and the run. The tests load the edited modules from
src: DatasetWidget and ObjectChart by relative import, and@object-ui/corethrough the root vitest alias topackages/core/src.Gates
pnpm check:control-bytes: OK.pnpm check:new-line-citations: 0 new, exit 0.node scripts/check-changeset-presence.mjs: passes (6 source files of 3 released packages, 1 changeset).node scripts/check-changeset-no-major.mjs: passes.pnpm check:changeset-claims: exit 0, and the self-contradiction reading is clean. 5 pending changesets nameDatasetWidget.tsxorObjectChart.tsx(7125, 8650, 8885, humanize-label-5444, objectchart-schema-anchor-7946). Each paragraph was re-read: none describes a line this PR changes, and all still hold.check:vi-mock-specifiers,check:vi-mock-inherit,check:vi-mock-override-shapecheck:test-path-roots,check:pending-changeset-literals,check:self-importcheck:phantom-deps,check:spec-symbols,check:esm-specifierscheck:unreferenced-sources,check:i18n-keyscheck:readme-exports: not run. No README is edited, and the gate judges only README imports.eslint.config.js. Every package'slintscript iseslint ., and core, plugin-charts and plugin-dashboard have no package-level config, so that script uses the root config.--format jsonover the 6 touched TS/TSX files reports 6 files, 0 errors and 59 warnings. Base vs head for the three edited sources:chart-presentation.ts0/0 to 0/0,ObjectChart.tsx0/36 to 0/36,DatasetWidget.tsx0/11 to 0/11.parserOptions.project, noprojectService), and no rule ineslint-rules/reads the filesystem. So this diff cannot move the verdict for any untouched file.Changeset
.changeset/7495-compareto-one-predicate.mddeclaresminoron@object-ui/core(a new export) and on@object-ui/plugin-dashboard(a query stops running).@object-ui/plugin-chartsis not declared: its behaviour is byte-for-byte unchanged (the same answers at both call sites), and the body says so.Acceptance notes
packages/plugin-dashboard/SKILL.mdalready says "Pie, donut, funnel and scatter charts ignorecompareTo". That was true of the drawing and is now true of the query as well. The file is not edited; it is outside the claim's file surface.ObjectChartSchema['chartType']omitsfunnel, yet DashboardRenderer's object-chart path passesfunnelthrough at run time. The new charts pin casts at one call and says why. Noted, not filed: nothing shows that the narrower prop type rejects or drops authored metadata.DatasetWidget.compareTo.scatter.test.tsxsays the executor "DID return" the__comparecolumn. Its double still returns that column unconditionally, so the sentence and its assertions remain true. Left as is.Generated by Claude Code