You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d8a9cc5
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(plugin-calendar,plugin-gantt)!: retire the flat fallback read; the calendar and gantt renderers read the block only (#27026)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBFijSMgUXzsRVhP3BchJpt1)_
Part of #25923
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — skills/objectstack-ui/rules/list-views.md:290-301
and skills/objectui/guides/page-builder.md:291-305 already teach the
block only
## 维护者速读
- 改了什么:日历和甘特图组件只从 `calendar` / `gantt`
配置块读取字段绑定,不再读取写在节点顶层的平铺字段;规范里两条拒收提示同步改掉了“渲染器仍会读取平铺写法”这半句。
-
为什么改:平铺写法早已被规范拒收、类型包也不再声明,两个视图生产者都只写配置块;对全部可达元数据的普查没有找到一行平铺存储,留着这条读取只是第二种方言(#12)。
- 风险与回滚:直接挂载 `ObjectGantt` / `ObjectCalendar`
组件并写平铺字段的宿主会看到“需要配置”提示而不是图表;回滚即还原本 PR,无存储数据迁移。
- 先看:`ui/packages/plugin-gantt/src/ObjectGantt.tsx`(`getGanttConfig` 与
`warnOnFlatGanttKeys`)、`ui/packages/plugin-calendar/src/ObjectCalendar.tsx`(`getCalendarConfig`)、`packages/spec/src/ui/component.zod.ts`(两条拒收提示)。
- 两分钟验证:`cd ui && pnpm exec vitest run
packages/plugin-gantt/src/ObjectGantt.blockPrecedence.test.tsx
packages/plugin-calendar/src/ObjectCalendar.unconfiguredRefusal-7029.test.tsx`,预期全绿:平铺节点被拒并提示配置块,配置块节点正常绘制。
- 需要你做的:无,席位落地
## What changes
- `@object-ui/plugin-calendar`: `getCalendarConfig` reads the `calendar`
block only. A node that writes `startDateField` / `endDateField` /
`titleField` / `colorField` / `allDayField` flat with no block reaches
the "Calendar configuration required" screen, whose hint names the
`calendar` block. The package-local `ObjectCalendarFlatFields` and
`ObjectCalendarHandoff` types are removed;
`ObjectCalendarProps['schema']` is the published `ObjectCalendarSchema`.
- `@object-ui/plugin-gantt`: `getGanttConfig` reads the `gantt` block
only. Flat `GanttConfig` keys with no block reach "Gantt configuration
required", which now names the `gantt` block. The dev warning
`warnOnFlatGanttKeys` names every flat key the chart did not read, with
or without a block beside it. The legacy singular `dependencyField` is
read nowhere. `ObjectGanttFlatFields` is replaced by
`ObjectGanttSearchFields`, which carries only the `search` /
`searchableFields` pair that `ListView` writes at runtime.
- `@objectstack/spec`: only the false clause of the `object-calendar`
and `object-gantt` flat-key refusal texts is rewritten (they said the
renderer still reads the flat spelling). The prescription itself, write
the keys in the block, is unchanged.
- The three comment polishes from 6437594464: the dated #25923 notes in
`calendar-flat-color-allday-8466.test.ts` merged and its read-census
rows inverted; `objectql.ts` gantt block note; the `objectql.zod.ts`
binding bullet and view-level arms note.
- Renderer and mirror tests that mounted a flat node now write the
block; the tests that pin the refusal keep a flat node on purpose.
- READMEs of both plugins and the gantt demo moved to the block.
## Tests
- New and inverted pins: a flat calendar node and a flat gantt node are
each REFUSED with a hint naming the block
(`ObjectCalendar.unconfiguredRefusal-7029`,
`ObjectGantt.blockPrecedence`), with a CONTROL that the same keys moved
into the block draw. `ganttHandoff-25923.test.ts` (renamed from
`ganttHandoffFlatFields-25923`) pins that the hand-off type carries only
the search pair and that a flat `startDateField` is a compile error.
`ObjectGantt.dependencyAlias` pins the singular alias as not read when
written flat and refused by name inside the block.
- Census before and after (TS AST + JSON + YAML walk over 19,856 files,
14 parse failures, all JSONC tsconfigs): flat calendar nodes 12 to 7,
flat gantt nodes 23 to 9; every remaining site is a test that pins the
refusal or a type-level mirror pin. Zero sites in examples, apps, the
console's shipped metadata, ui/examples, seeds, platform-objects or
fixtures, before and after.
## Acceptance notes
- `packages/spec/src/kernel/functional-completeness.ts` and
`packages/spec/liveness/view.json` are in the amended surface but were
not edited: their calendar/gantt rows are dated readings pinned at
objectui `b9814b334`, and no sentence in them becomes false with this
change.
- No reference doc or refusal-text snapshot carries the old wording; the
only other copy is the earlier
`.changeset/25923-calendar-gantt-flat-keys-handoff.md`, left as written.
- `@object-ui/types`, `@object-ui/plugin-list` and
`@object-ui/plugin-view` carry a `patch` entry. Their code changes are
only comments and tests (in `@object-ui/types`), or none at all, but the
item-1 changeset compiles into their changelogs too. So the Supersedes
paragraph has to land beside it there as well.
- Both plugin entries are graded `patch`: `Metadata-protocol: none`
takes patch under ruling A. The BREAKING banner and the ADR-0087 marker
stay.
- The item-1 changeset `25923-calendar-gantt-flat-keys-handoff.md` says
the renderers still read the flat spelling. This PR does not edit it,
because `check-empty-changeset` refuses a change to a changeset the
merge base already carries. This PR's own changeset instead names the
sentences it supersedes, in the same release.
- Unreachable for the census: hotcrm, tenant `sys_metadata` rows, cloud.
- Out of this PR, per the order: the `FormField` index signature, the
`immutable` render-or-refuse follow-up, work item 2, and the list
`options` bag (PR 2 closes the spec door with an ADR-0087 fold; PR 3
deletes the objectui readers).
## Verification
<details><summary>ui tests (os-verify-lock)</summary>
- calendar + gantt + consumer set: `Test Files 818 passed | 3 skipped
(821)` · `Tests 18599 passed | 211 skipped` · VERDICT command-exit 0
- wider registry-reaching set: `Test Files 75 passed (75)` · `Tests 1693
passed | 12 skipped` · VERDICT command-exit 0
- five nodes moved after the after-census: `Test Files 5 passed (5)` ·
`Tests 111 passed` · exit 0
- plugin-gantt rerun after the `Reflect.get` fix: `Test Files 101 passed
| 1 skipped (102)` · `Tests 768 passed | 114 skipped` · exit 0
</details>
<details><summary>type-check and spec tests</summary>
- `pnpm --filter @object-ui/types --filter @object-ui/plugin-calendar
--filter @object-ui/plugin-gantt --filter @object-ui/plugin-list
--filter @object-ui/app-shell run type-check` (each runs `tsc --noEmit`
and `tsc -p tsconfig.test.json`): VERDICT command-exit 0
- `pnpm --filter @objectstack/spec test`: `Test Files 738 passed (738)`
· `Tests 22130 passed | 1 todo` · exit 0
</details>
<details><summary>dispatch gates</summary>
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`: 84 commands, each run with its exit code
recorded.
- `--ran`: 84 derived, 83 run, 1 NOT-MEASURED, 0 UNRUN. All 83 measured
exit 0.
- NOT-MEASURED: `pnpm check:dual-build-cjs-loads` exit 3 (prerequisite:
a full `pnpm build`; no package it judges is in this diff). CI runs it.
- `node scripts/check-platform-checklist.mjs --changed-from
origin/main`: OK, exit 0.
</details>
<details><summary>review rounds (heads 25a73f4, 0226b9c)</summary>
- Lint UI: `ObjectCalendar.tsx` imported `ObjectCalendarBlockConfig`,
which only the removed hand-off types used; the import is dropped. `pnpm
--filter` lint over types, plugin-calendar, plugin-gantt, plugin-list,
app-shell and console: 0 errors, exit 0.
- `check-changeset-no-major.mjs --base origin/main` with this PR body as
the event: exit 0 (exit 1 on 6001470, the `minor` grades).
`check-adr-0087-registration`, `check-empty-changeset`,
`check:changeset-fixed`, `check:changeset-gate-self-tests`,
`check:nul-bytes`: exit 0.
- 0226b9c adds the three packages at `patch`. The same changeset
checks all exit 0 again.
- plugin-calendar tests `Test Files 64 passed (64)` · `Tests 458 passed
| 95 skipped`, then plugin-calendar type-check: VERDICT command-exit 0.
</details>
<details><summary>dogfood battery</summary>
Head `6001470dc`, closure `pnpm --filter '@objectstack/dogfood^...'
build` (exit 0), then `pnpm --filter @objectstack/dogfood test` under
the lock: VERDICT command-exit 1 · `Test Files 1 failed | 343 passed | 3
skipped (347)` · `Tests 2 failed | 2782 passed | 20 skipped (2804)`.
The two failures are both in
`test/packaged-action-disabled-dispatch-live.dogfood.test.ts` (#26572):
acceptance[0] read the showcase task's `done` as true before the
disabled action ran, and acceptance[5]/[2] found a row id where it
expected none. That file passes alone on the same head (`Test Files 1
passed (1)`, `Tests 8 passed (8)`, exit 0). This diff touches no server,
action or showcase package. It is the known flake #26952: the test picks
an unordered `showcase_task?$top=1` and fails when that seed task is
already done, and it is red on main too.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufzevL8Q6rTfGz2XHXGT)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
refactor(plugin-calendar,plugin-gantt)!: the calendar and gantt renderers read their binding from the `calendar` / `gantt` block only; the flat fallback read is retired (#25923)
11
+
12
+
Clause-②: no (narrowing)
13
+
Metadata-protocol: none
14
+
15
+
<!-- adr-0087: not-required (no-migration-prescription) No `@objectstack/spec` key, accepted value, stored row or stored shape moves. The spec's `ComponentPropsMap['object-calendar']` and `['object-gantt']` rows already refuse every flat key this change stops reading, `@object-ui/types` stopped declaring them in the earlier slice of #25923, and both producers in the console (`ListView` and `ObjectView`) already write the block, so no metadata the spec accepts reaches the retired read. A stored-row census over every metadata source this repository reaches (examples, apps, the console's shipped metadata, seeds, fixtures, platform-objects) found no stored view or node that writes the binding flat, so `objectstack migrate meta` has nothing to rewrite. What narrows is the drawing outcome for a host that mounts `ObjectCalendar` or `ObjectGantt` directly with a flat node: it now reaches the refusal screen. The `@objectstack/spec` half is prose only: the two refusals no longer say the renderer still reads the flat spelling. The other categories are closed on facts: the packages publish (not unpublished); no ADR-0087 id covers this change (not registered or already-registered); the narrowed type members are package-local hand-off types that neither package's entry exports (not type-surface-only or runtime-export-retired). -->
16
+
17
+
`ObjectCalendar` and `ObjectGantt` kept a second, flat reading of their field binding for a host that mounts them directly with the keys written on the node. The spec refuses those keys on the node, `@object-ui/types` no longer declares them, and no producer writes them, so that read was a second dialect nothing should reach. It is retired.
18
+
19
+
-**`@object-ui/plugin-calendar`**: `getCalendarConfig` reads the `calendar` block only. A node that writes `startDateField`, `endDateField`, `titleField`, `colorField` or `allDayField` flat, with no block, shows the "Calendar configuration required" screen, whose hint names the `calendar` block. The package-local `ObjectCalendarFlatFields` and `ObjectCalendarHandoff` types are gone, and `ObjectCalendarProps['schema']` is the published `ObjectCalendarSchema`.
20
+
-**`@object-ui/plugin-gantt`**: `getGanttConfig` reads the `gantt` block only. A node that writes its `GanttConfig` keys flat, with no block, shows the "Gantt configuration required" screen, which now names the `gantt` block, and in development a warning names every flat key the chart did not read, with or without a block beside it. The legacy singular `dependencyField` is read nowhere (the spec spells it `dependenciesField`, inside the block). The package-local `ObjectGanttFlatFields` type is gone; `ObjectGanttProps['schema']` keeps the two search keys `ListView` writes at runtime, now on `ObjectGanttSearchFields`.
21
+
-**`@objectstack/spec`**: the `object-calendar` and `object-gantt` flat-key refusals no longer say the renderer still reads the flat spelling. The prescription is unchanged: write the keys in the `calendar` / `gantt` block.
22
+
23
+
**Supersedes, in the same release:**`25923-calendar-gantt-flat-keys-handoff.md` (the earlier slice of #25923) says the calendar and gantt renderers are unchanged and still read the flat spelling a host hands them, that `ObjectCalendarProps['schema']` and `ObjectGanttProps['schema']` carry the flat keys, and that the spec refusals call the flat spelling a fallback the renderer still reads. This change retires that read, so those sentences no longer hold: the renderers read the block only, the props types carry no flat binding key, and the refusals no longer say it.
24
+
25
+
**BREAKING** for code that mounts `<ObjectCalendar>` or `<ObjectGantt>` with a flat node.
26
+
27
+
-**Before.**`<ObjectGantt schema={{ type: 'object-gantt', objectName: 'task', startDateField: 's', endDateField: 'e' }} />` drew a chart, and the flat keys compiled against `ObjectGanttProps['schema']`.
28
+
-**Now.** The flat keys are a compile error on the props type, and the node shows the configuration-required screen.
29
+
-**Fix.** Write the binding in the block: `{ type: 'object-gantt', objectName: 'task', gantt: { startDateField: 's', endDateField: 'e', titleField: 'name' } }` (the `gantt` block requires `titleField`; the flat branch used to floor it at `'name'`), and `{ type: 'object-calendar', calendar: { startDateField: 'start' } }` for a calendar.
0 commit comments