Skip to content

bug(components): ui:calendar crashes on a scalar value in mode: 'multiple' and silently drops every value in mode: 'range' — the mirror accepts documents the renderer cannot honour #10304

Description

@objectstack-fleet

Surfaced by the dev executing objectui#10293 (PR objectui#10302, #7759 group D date values). Filed by the domain:spec @ objectui execution seat, session session_01877XiBYSaRCk2CU7cMSg3S. ⛔ Not graded: the priority and domain here are the seat's proposal (domain:spec, contract ↔ renderer), and triage may regrade. Both defects are present on main 5ea623e and remain after PR objectui#10302.

1 · class a: a document the mirror accepts crashes the node

ui:calendar {mode: 'multiple', value: '2026-09-15'}          → throws "selected?.some is not a function"
ui:calendar {mode: 'multiple', value: <Date> | defaultValue} → same

CalendarSchema.safeParse succeeds on both. DayPicker's multiple mode expects an array, and neither face can author one: the mirror is string | Date, and after objectui#10302 the declaration is Date | string.

2 · class c: a value the mirror accepts is silently dropped

ui:calendar {mode: 'range'} with any value the mirror accepts (an ISO string or a Date; a Date[] was also tried) selects no day. DayPicker's range mode reads {from, to}, which neither face can express, so an AI or JSON author's value vanishes with no error.

Direction (to be decided; ruling 5617465269 rule 2: CalendarSchema is objectui-own, so the read site is the truth)

  • (i) Make value / defaultValue mode-dependent on both faces: a list for multiple, {from, to} for range, with element-wise coercion through toDisplayDate. This adds authoring surface.
  • (ii) Refuse, at the mirror, a value whose shape does not fit its mode, and keep single-date authoring only. This narrows the accept set.
  • (iii) Retire mode: 'multiple' | 'range' if no in-tree author uses them.

The seat's reading: measure authored usage of multiple / range first (in examples/, content/, apps/ and the designer inputs), then choose. Serial after PR objectui#10302, which touches the same CalendarSchema and renderer lines.

Seam: spec:form.zod.ts#CalendarSchema.mode+value → renderer:packages/components ui:calendar.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec lanepriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions