Skip to content

finding(types): the zod DataTableSchema mirror declares rowActions as an array, while the TS declaration and every reader treat it as a boolean #6638

Description

@os-sales

Found while implementing #6459 (typing the data-table schema slot in plugin-grid). Filed unassigned, observational — recording a mirror drift, not proposing a shape.

Measured (at 38a123cac)

The two declared surfaces of DataTableSchema.rowActions disagree:

  • TS interface (packages/types/src/data-display.ts): rowActions?: boolean — "Show row actions (edit/delete)".
  • Zod mirror (packages/types/src/zod/data-display.zod.ts:222): rowActions: z.array(z.any()).optional().describe('Row action buttons') — an array.

Both real ends of the seam side with the TS interface:

  • Producer: plugin-grid's ObjectGrid.tsx passes rowActions: !!(inlineEditable && hasActions) — a boolean.
  • Consumer: components' data-table.tsx destructures rowActions = false off the schema and branches on it as a boolean.

So a metadata author validating against the zod mirror is told to write an array of "action buttons" that nothing reads, and a spec-compliant boolean would be rejected by that mirror while being the only value the renderer understands. This is the declared != enforced family, in the same shape as #4605 (closed) — the zod BaseSchema mirror drifting from the TS declarations — one interface further down the same file pair.

Scope note

Deliberately not fixed in #6459's PR: that card's fence is packages/plugin-grid/src/ObjectGrid.tsx only, and packages/types is published, human-floor surface. Whichever way the repair goes (align the zod mirror to boolean, or rule that the mirror is authoritative and the TS declaration plus both readers are wrong), it is a one-line-plus-pin change in packages/types with its own review floor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions