Skip to content

finding(plugin-timeline): a null gantt BAR (items: [{ items: [null] }]) is refused through malformedDate as "startDate is undefined, which is not a valid date" — the wrong fault, one level below #7164 #7365

Description

@os-litant

Found while implementing #7164. Not repaired there: the ruling named the ROW and row.items shapes (a row is an object; its items, when present, is an array) and the bars inside a row stay z.any() in the mirror. A bar that is not a bar is one level below that scope.

What is wrong

Measured in render through the real TimelineRenderer, on a67abdc88 (main) and on the #7164 branch at 8e1dc8274 — identical:

items: [{ label: 'R', items: [null] }]
  -> NAMED  Unusable gantt date range — items[0].items[0].startDate is undefined, which is not a valid date. …

The outcome is defined (no crash — findUnusableGanttDate reads rowItems[0]?.startDate, gets undefined, and refuses), but the copy names the WRONG fault: the bar is null, not an item whose startDate is missing. This is the same mis-naming class #7164 fixed for rows ("items[0] is null, which is not a valid date" named the wrong fault for a row that is not a row), one level down.

And validate accepts it: TimelineSchema.items[].items is z.array(z.any()), so a null bar is green at authoring time.

Options

Recommendation: at least B — an authored null bar is an error an AI-authored document should be told about at validate, not by a date diagnostic naming a key it never wrote.

Blocked-by: #7164 (the mirror's row declaration and classifyGanttRows both land there).

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions