Skip to content

finding(plugin-grid): ObjectGrid builds its data-table schema as const dataTableSchema: any, so the DataTableSchema it imports is never applied #6459

Description

@claude

Found while implementing #6004. Filed unassigned. Observational — recording a hole one level above the one #6004 closed, not proposing a change.

Measured (at 129c7a9e7)

#6004 typed what generateColumns() emits. But the object that emit is handed to is itself untyped — packages/plugin-grid/src/ObjectGrid.tsx:3210:

constdataTableSchema: any={type: 'data-table',caption: schema.label||schema.title,columns: orderedColumns,
data,
...
};

@object-ui/types declares DataTableSchema (packages/types/src/data-display.ts:562, columns: TableColumn[]), and ObjectGrid.tsx:25 already imports it — it is simply never used as this object's annotation. So the ~30 keys assembled here (pagination, manualPagination, rowCount, frozenColumns, renderCellEditor, onRowSave, …) are checked against nothing, and neither is the columns slot itself.

The related cast two hops later, :3268:

columns: (dataTableSchema.columnsasany[]).map((c: any)=>({})),

exists only because the surrounding value is any.

Why it is worth recording separately

#6004 made the PRODUCER's output type real; this is the SLOT it fills. Typing the emit and leaving the receiver any still leaves the two sides unable to disagree out loud — the emit type is enforced only up to orderedColumns, and this line is where that enforcement stops. It is the same declared != enforced family (#5453, #6373, #6424, #6425), one level up: a declared interface exists, is imported, and is not applied.

Deliberately not folded into #6004: that card's fence was generateColumns() and its call sites, and this annotation would surface a different key census — the schema-level keys, not the column-level ones — including several the grid passes that DataTableSchema may not declare (renderCellEditor, singleClickEdit, selectionResetKey, disableInnerScroll, borderless). That triage is the substance, so it needs sizing rather than a one-line annotation.

⚠️ Sizing note, measured on #6004: at this seam a bare annotation is likely to be inert for the same reason it was there — TypeScript's excess-property check is a freshness check, and several of these values arrive through spreads (buildGroupTableSchema does { ...dataTableSchema, … }). Whoever takes this should measure before assuming an annotation enforces anything; see the docblock above GridColumnDraft in ObjectGrid.tsx for the method.

Related


Generated by Claude Code


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions