|
| 1 | +--- |
| 2 | +"@object-ui/types": minor |
| 3 | +--- |
| 4 | + |
| 5 | +feat(types): derive `ListViewSchema` from `@objectstack/spec/ui` instead of a hand-written copy (#2231) |
| 6 | + |
| 7 | +`@object-ui/types` shipped a hand-written mirror of the spec's UI ListView zod |
| 8 | +(`packages/types/src/zod/objectql.zod.ts`) plus a parallel hand-written TS `interface` |
| 9 | +(`objectql.ts`). Both had drifted from the authoritative `@objectstack/spec/ui` |
| 10 | +`ListViewSchema`, with nothing enforcing they stay in sync. |
| 11 | + |
| 12 | +- The zod `ListViewSchema` now **derives** from the spec's `ListViewSchema`: spec-owned |
| 13 | + fields (`filter`, `sort`, `selection`, `navigation`, `pagination`, `grouping`, |
| 14 | + `rowColor`, `userActions`, `appearance`, `tabs`, `addRecord`, `rowHeight`, `sharing`, |
| 15 | + `chart`/`tree` configs, `responsive`, `performance`, …) flow in **by reference** instead |
| 16 | + of being re-typed. The component envelope (`type: 'list-view'` discriminator + |
| 17 | + `objectName`) and the legacy objectui vocabulary (`viewType`, `fields`, `filters`, the |
| 18 | + `show*` toolbar flags, `densityMode`, `color`, …) plus the configs whose objectui shape |
| 19 | + is intentionally broader than spec's (`userFilters`, `sharing`, `aria`, |
| 20 | + `conditionalFormatting`, `exportOptions`, `kanban`/`calendar`/`gantt`/`gallery`/ |
| 21 | + `timeline`) remain as sanctioned local `.extend()`s. Existing payloads keep validating; |
| 22 | + spec-canonical payloads (`columns`/`filter`/`userActions`) now validate too. |
| 23 | +- The hand-written TS `interface ListViewSchema` is replaced by |
| 24 | + `z.infer<typeof ListViewSchema> & ListViewRuntimeProps`, so the type can no longer drift |
| 25 | + from the schema. Non-serializable runtime-only props (`onNavigate`, `onDensityChange`, |
| 26 | + `refreshTrigger`) live in `ListViewRuntimeProps`. |
| 27 | +- Added a drift-guard test (`list-view-spec-parity.test.ts`) that fails if the spec grows a |
| 28 | + field objectui hasn't triaged, renames an aliased anchor (`type`/`columns`/`filter`), or |
| 29 | + an objectui-only field is added outside the sanctioned-local set. |
| 30 | +- Bumped the `@objectstack/spec` dependency `^14.6.0` → `^15.1.0` across the workspace |
| 31 | + (15.1.0 carries the framework#3021 `lazySchema`/`z.toJSONSchema` identity fix that the |
| 32 | + spec-derived Page/View inspectors depend on). |
| 33 | + |
| 34 | +Migrating the legacy vocabulary to the spec-canonical keys and adopting spec's narrower |
| 35 | +sub-shapes are deferred follow-ups (see #2231). No runtime behavior change. |
0 commit comments