…021 dataset of its object (objectui#11576)
The dialog wrote `chart: { chartType, xAxisField, yAxisFields }`, which the
spec's strict list chart block refuses by name, so the view write door
refused every chart view created from the console (both doors).
The chart picks are now `dataset` (only datasets whose base `object` is the
view's object, through useDatasetCatalog), `values` and optional `dimensions`
(the chosen dataset's members, through useDatasetSemantics). An object with no
dataset disables the chart type through the existing unavailable path. The
four axis i18n keys leave all ten packs; eight dataset-binding keys join.
The catalog entry carries the served base `object`.
Claude-Session: https://claude.ai/code/session_01FjqrwXPfSMkSfkKYDSRkN2
Co-authored-by: Claude <noreply@anthropic.com>
Fixes #11576
Clause-②: no
The console's Create View dialog now authors the spec's ADR-0021 chart binding,
chart: { chartType, dataset, values, dimensions? }, and nothing else. Until now it wrotechart: { chartType, xAxisField, yAxisFields }, which@objectstack/spec17.6.0's strictListChartConfigSchemarefuses by name. So the platform's view write door refused every chart view the console created.Shape: option A of the seat's answer on the card (comment
5973755839, amending claim5973664751), under triage5973399361.What users see today (ruling step 1, measured before any edit)
Measured at objectui
main0903617(= this branch's base). The realObjectDataPageand the real dialog were mounted, with a realMetadataClientwhose fetch replays the platform's view gate (the installed spec 17.6.0getMetadataTypeSchema('view')) at the network boundary:PUT …/meta/view/crm_deal.KEY?mode=draftwithconfig.chart = {chartType: bar, xAxisField: stage, yAxisFields: [amount]}.unrecognized_keys [xAxisField, yAxisFields]anddataset/valuesmissing, and the client throws a 422./data, with no navigation, no toast and no alert. The only trace isconsole.error('[ObjectDataPage] Failed to save view:').ObjectView.handleViewCreate(the view tab bar's add button) has the same catch-and-log shape.That silent failure is a defect of its own and outlives this payload change. It is not addressed here: the seat files it as its own card.
What changed
CreateViewDialog. The chart type's picks are now:chartType, unchanged;dataset: only the ADR-0021 datasets whose baseobjectis the view's object, never the whole catalog;values: one of the chosen dataset's measures, required, written as a one-element list;dimensions: one of its dimensions, optional, shown only when the dataset declares any, and omitted from the payload when empty.useDatasetCatalog()/useDatasetSemantics(), the pair the dashboard widget editor binds with. A closed dialog, or one with noobjectDef, fetches nothing. A dataset, measure or dimension name counts only while it is among the current options, so a stale or foreign name can neither open Create nor reach the payload. Choosing another dataset clears the measure and dimension picked from the last one.xAxisField/yAxisFieldsare gone from the dialog. There is no dual spelling.chart, and says in writing that no test drives the other types' payloads through the dialog against the spec (AGENTS.md 完善设计器的每一个细节 #9).useDatasetCatalog.DatasetCatalogEntrygains an optionalobject, the served document's base object;toCatalogEntrykeeps it when served. No other consumer reads it.@object-ui/i18n. The four axis keys (console.objectView.xAxisField,xAxisFieldHelp,yAxisField,yAxisFieldHelp) leave all ten packs; the dialog was their only reader. Eight keys label the new picks:dataset,datasetHelp,chartMeasure,chartMeasureHelp,chartDimension,chartDimensionHelp,viewTypeUnavailableDataset,noDatasetMeasure. Terms follow each pack's existing dashboard dataset vocabulary.objectView-config-keys-retired-4730.test.tsowns this namespace's arithmetic, so it moves with them: 123 retired, 102 surviving, 225 total.@object-ui/app-shelland@object-ui/i18n.Clause-② stays
no.CreateViewDialogPropsis unchanged. NeitherDatasetCatalogEntrynoruseDatasetCatalog(norCreateViewDialogitself) is exported frompackages/app-shell/src/index.ts, and the package'sexportspublishes only..Pins
CreateViewDialog.chartBinding-11576.test.tsx:DatasetSchemadocuments (control);toCatalogEntrycarriesobject;crm_dealdataset and never thecrm_accountone;dimensionsis omitted when the dataset declares none;ObjectDataPage.buildSaveAsViewSpec: the payload parses against the 17.6.0ListViewSchema, and its envelope passesViewItemSchema;…/view/crm_deal.KEY?preview=draft).ObjectView.createChartView-11576.test.tsx:ObjectView.handleViewCreate: a chart view is created through the tab bar's add button with the realObjectViewand the real dialog. The body handed tometadataClient.savepassesListViewSchema(config) andViewItemSchema(envelope), with no legacy key.ObjectChartthrough the dataset branch (dataset/values/dimensions; noobjectName/aggregate).Evidence
Red first, at base
0903617:Tests 9 failed | 4 passed (13). Every failure is "no dataset / values picker exists", or (the unavailable-card case) "the old dialog reads no catalog". The 4 passes are the 3 fixture controls and "no catalog while closed", which the old dialog satisfies trivially.Ablation, at
5db856f, run by objectstack'sscripts/ablation-replace.mjswith anEXIT INT TERMrestore trap:subConfig.xAxisField = 'stage'into the dialog's payload: anchor 1 to 0, bloba8cc632cto6b44f4a0, "mutation landed".Tests 5 failed | 9 passed (14).refused by the spec: unrecognized_keys), DOOR 1 (unrecognized_keys), the 2xx door (expected 422 to be 200) and DOOR 2 (ListViewSchemarefusal).a8cc632c== HEAD blob,git diff HEADempty, marker count 0.Green, every run below at
5db856f(git rev-parse --short HEAD):pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build: exit 0.pnpm --filter @object-ui/app-shell --filter @object-ui/i18n type-check: both echoedtype-check: Done.tsc -p tsconfig.test.json --listFilesOnlycounts both new pins (app-shell) and the 4730 pin (i18n) in the checked program.pnpm exec vitest run --maxWorkers=2over 140 files: everyCreateViewDialog*,ObjectDataPage*andObjectView*suite in app-shell, every suite naming the catalog reader, and the wholepackages/i18n/(all-locales parity included). Result:Test Files 140 passed (140),Tests 2012 passed | 13 skipped (2025). This is a declared narrowing: the rest of app-shell's suites are CI's.check:control-bytes(OK);check:new-line-citations(VERDICT … 0 new citation(s));check:changeset-claims(report-only);check:pending-changeset-literals(No test source names a pending changeset);check:i18n-keys(every call-site key resolves against the en pack);check:i18n-drift(No en value changed in this range);check:i18n-designer-parity;check:vi-mock-specifiers,check:vi-mock-inherit,check:vi-mock-override-shape;check:test-path-roots;check:metadata-write-doors;check:unreferenced-sources;node scripts/check-changeset-presence.mjs(15 source file(s) of 2 released package(s) changed, and this change declares 1 changeset(s)).@object-ui/consolebuild (check:eager-closure,check:eager-locale-catalogues), exit 0:eslint.config.jsfiles: ['**/*.{ts,tsx}']blocks; the packages carry no config of their own.--format jsonlinted 15 files with 0 errors.parserOptions.project/projectService(no type-aware linting), and no rule undereslint-rules/reads another file, so this diff cannot move a verdict in an untouched file.no-explicit-anyin the two new test files.Acceptance notes
UnifiedViewConfig.chartin@object-ui/types(packages/types/src/designer.ts) still declareschartType,xAxisField,yAxisFields,aggregation,series,configandfilter, and nodataset/values. It is exported from the package index and has zero consumers in this repo. Noted, not changed here.ObjectView's non-dataset chart branch (the "Translate here" block overxAxisField/yAxisFields/aggregation);ListView'scase 'chart'fallback ("Legacy inline aggregate (deprecated …) Kept as a fallback").t()throughREQUIRED_FIELDS_BY_TYPE'si18nKey, socheck:i18n-dead-keys(report-only) lists six of them as needs-review. That is the same tier the dialog's existing keys (chartType,groupByField,startDateField, …) already sit in.useDatasetCatalog, which resolves an author'sI18nLabelin the designer locale (en-USorzh-CN), as the dashboard and report editors show them. A de or ja session therefore sees a dataset's English label where the author declared one.Write route:
objectstack-fleet[bot]through the fleet-write relay. Sessionhttps://claude.ai/code/session_01FjqrwXPfSMkSfkKYDSRkN2.Generated by Claude Code