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.

Activity

  1. huangyiirene commented on Aug 28, 2026

    @huangyiirene
    Collaborator

    分诊:与 #6033 的 B4 行重复,关闭并归并

    本卡记录的缺陷已经是 #6033 的 B4 行,逐项对得上:

    #6033 B4 #6638(本卡)
    键 data-display.zod.ts#DataTableSchema.rowActions 同
    TS 声明 boolean rowActions?: boolean
    zod 镜像 any[] z.array(z.any()).optional()
    消费侧读数 data-table.tsx rowActions = false,只当布尔分支,从不索引元素 同(rowActions = false 解构后按布尔分支)

    #6033 是 #5927 group B/C 的伞卡,携带八行的渲染器读数等待逐键裁决;本卡是其中一行被独立重填。

    ⭐ 但本卡带了一条 #6033 B4 没有的新证据,已转录过去

    #6033 的 B4 只测了消费侧。本卡测了生产侧:

    plugin-grid / ObjectGrid.tsx —— rowActions: !!(inlineEditable && hasActions)
    

    ⇒ 这把 B4 从「消费者按布尔读」加强成「seam 两端都是布尔,只有镜像是数组」。#6033 B4 原本推断的方向(撤回镜像的数组方言)因此多了一条独立支撑。已在 #6033 上留言转录,⛔ 不让它随本卡关闭而丢失。

    ⛔ 本席不裁 B4 本身 —— 它是已发布镜像的 accept 集变更,按 #5927 的裁决归决策入口,与其余七行一起走。


    Generated by Claude Code

  2. huangyiirene commented on Aug 28, 2026

    @huangyiirene
    Collaborator

    ⚠️ 更正上一条评论的最后一句。 我写的是「B4……按 #5927 的裁决归决策入口,与其余七行一起走」—— 这是错的,B4 已经裁过了。

    维护者 2026-08-25 在 #6033 上对全部八行逐键裁决(原文「其他同意」),B4 的处置是:

    DataTableSchema.rowActions | renderer implements boolean ⇒ mirror aligns to boolean, arrays reject loudly

    同一条裁决记录里写明 needs-user-decision → pm:queue 的状态转移是刻意的。⇒ #6033 现在在队列里等实施,不在决策入口等裁决。

    所以本卡的正确归并说明是:本卡与 #6033 的 B4 行重复,而 B4 已有裁决、方向就是本卡正文推断的那个(镜像收敛到 boolean)。本卡带来的生产侧读数(ObjectGrid.tsx 的 rowActions: !!(inlineEditable && hasActions))已转录到 #6033,作为该裁决的第二端证据。

    其余部分不变,按重复关闭。


    Generated by Claude Code

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

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