Skip to content

finding(plugin-grid): ObjectGrid's generateColumns() is untyped (any[]), so nothing type-checks what it writes into DataTableSchema.columns: TableColumn[] — the hole that hid #5853 and #5453 #6004

Description

@yinlianghui

Found while measuring #5853 (TableColumn.type's three-way divergence). Filed unassigned, deliberately NOT absorbed into #5853, whose fence is data-display.ts + its zod mirror + data-table.tsx. This card is in plugin-grid and is the structural reason that class of drift stays invisible.

Measured (at 8d3a5294a)

packages/types/src/data-display.ts:487 types the boundary strictly:

columns: TableColumn[];

But the producer that fills it is untyped — packages/plugin-grid/src/ObjectGrid.tsx:1495:

constgenerateColumns=useCallback(()=>{

No return-type annotation, and its call site at :2197 re-widens explicitly:

constcolumns=generateColumns().map((col: any)=>{

So every column object ObjectGrid hands to data-table reaches a TableColumn[] slot as any. tsc checks nothing there.

Why it matters

The untyped boundary is not cosmetic — it is what lets producer/consumer vocabularies drift with a green build. Two independently-filed cards are the same hole seen from two sides:

Typing the boundary turns both classes into build errors at the point they are introduced, instead of findings discovered months later by hand.

Suggested direction (not a decision — needs sizing)

Annotate generateColumns(): TableColumn[] and drop the (col: any) at the call site. Expect this to go red immediately and usefully: the type widening decision in #5853 is a prerequisite for the type key specifically, and the extra keys ObjectGrid attaches (headerIcon, options, pinned, wrap, essential) each need a verdict — declare on TableColumn, or stop forwarding. That triage is the substance of the card, so it should be sized before dispatch rather than treated as a one-line annotation.

Related

Generated by Claude Code

Metadata

Metadata

Assignees

Labels

domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpm:dispatched

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions