Repository navigation
fix(types): type dueLike by reference and declare settledWhen on date and datetime field metadata (objectui#12297) - #12861
Conversation
… and datetime field metadata (objectui#12297) DateFieldMetadata and DateTimeFieldMetadata now take dueLike from @objectstack/spec's FieldSchema instead of a local boolean, and declare settledWhen beside it by the same reference. settledWhen is declared, not yet rendered: the date cells' read belongs to objectui#11815. Claude-Session: https://claude.ai/code/session_01Qe458QJ3QyHSzgf9t1dDEH Co-authored-by: Claude <noreply@anthropic.com>
… (objectui#12297) The date and datetime field pages and the schema reference name both keys as FieldSchema members, say the spec reads an absent dueLike as "not a deadline" while today's cells still apply the field-name fallback, and say settledWhen is declared and not yet rendered. Claude-Session: https://claude.ai/code/session_01Qe458QJ3QyHSzgf9t1dDEH Co-authored-by: Claude <noreply@anthropic.com>
|
changeset-claim-re-read
|
席位核对 — ACCEPT · objectui#12297 · head
|
Contract reviewServed-tier: Face: the Inputs read:
Nothing was built or run locally. ① Derived judgments
② Semver levelOne changeset: ③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
✅ 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
|
Landing · head
|
Fixes #12297
Clause-②: yes
What changed
@object-ui/types,packages/types/src/field-types.tsDateFieldMetadata.dueLikeandDateTimeFieldMetadata.dueLikeare typed by reference,SpecField['dueLike']. This is the file's existing idiom (import type { Field as SpecField } from '@objectstack/spec/data', the same onevisibleWhen,currencyConfigandinlineHelpTextuse).Fieldis the spec'sz.inputface, so the authored shapes are what the type admits. The value type is unchanged.settledWhenis new on both interfaces, typedSpecField['settledWhen']. That is the spec's expression input: a bare CEL string or the{ dialect, source }envelope. The doc comments follow the spec: a CEL predicate overrecord, display only,date/datetimeonly, and accepted only besidedueLike: true.falsedueLikeas 'not a deadline', but today's date cells still fall back to the field-name convention. Second,settledWhenis declared, not yet rendered. Both reads belong to objectui#11815, which is not addressed here and remains open.Faces left as they are, and why
DetailViewFieldSchema.dueLike(views.tsand itszod/views.zod.tsmirror) is not re-typed. The spec declaresdueLikeonly onFieldSchema. The detail-view entry is an objectui view key of the same name, with its own documented precedence and fallback, and its type already equals the spec'sboolean | undefined. Typing it by reference would claim a spec row that does not exist, and nosettledWhenis added there for the same reason.packages/types/src/zod/, so nothing was added there.Docs
content/docs/fields/date.mdxandcontent/docs/fields/datetime.mdxname both keys asFieldSchema.dueLike/FieldSchema.settledWhenand add a typedsettledWhensnippet each (bare string on date, envelope on datetime). They state the spec's 'absent is not a deadline' alongside today's name fallback, and thatsettledWhenis declared and not yet rendered.content/docs/api/schema-reference.md: the detail-viewdueLikenote adds thatsettledWhenis an object-metadata key (a detail-view entry does not carry it), declared and not yet rendered.A stale header in
field-metadata-family-retired-12242.test.tssaid the installed spec refusesdueLike. It now points at this card's pin.Spec version and where each reference resolves
The installed
@objectstack/specis18.0.0-next.2;packages/types/package.jsondeclares^18.0.0-next.2. In itssrc/data/field.zod.ts,FieldSchemadeclares:dueLike: z.boolean().optional().describe("Deadline semantic (date / datetime only): TRUE declares this date a deadline ...")settledWhen: EvaluatedExpressionInputSchema.optional().describe("Predicate (CEL) — the deadline is SETTLED while TRUE ...")The type-only export
Field = z.input of FieldSchemais whatSpecFieldnames.Test evidence (HEAD 868d7b8)
packages/types/src/__tests__/field-metadata-deadline-by-reference-12297.test.ts:Equalchecks thatDateFieldMetadataandDateTimeFieldMetadatadueLike/settledWhenequalSpecFieldof the same key.keyof TimeFieldMetadataorkeyof TextFieldMetadata, and freshtime/textliterals carrying them are refused.FieldSchema: accepts both keys in both wire shapes; refusesdueLikeontimeandsettledWhenwithoutdueLike: true, each beside an accepting control.DateFieldMetadata'sSpecField['settledWhen']with a localstringmadetsc -p tsconfig.test.jsonexit 2 with TS2344 on exactly thatEqualrow. Restored, with the file's HEAD blob hash matching andgit diff HEADempty.pnpm --filter @object-ui/types test: 386 files, 10513 tests passed.pnpm --filter @object-ui/types type-check,lint(0 errors; the 3 warnings onfield-types.tsare pre-existing) andbuild: exit 0.pnpm check:spec-symbols: exit 0, output identical before and after.check:doc-snippets(801 of 801 blocks),check:doc-examples,check-doc-json-fences,check-doc-links,check-doc-component-types,check-doc-example-ids, pluscheck-control-bytes,check-changeset-presenceandcheck:new-line-citations: exit 0.No screenshots: this change moves no pixel.
Implemented in session
https://claude.ai/code/session_01Qe458QJ3QyHSzgf9t1dDEH.🤖 Generated with Claude Code
Generated by Claude Code