Skip to content

finding(types): two widget prop types declare their schema as a hand-rolled inline object with no BaseSchema in its ancestry #6576

Description

@os-support-ai

Found while censusing bind declarations for #6357 (PR #6574). Filed separately — it is a different defect from that card's, and fixing it there would have been out of scope.

The fact

Two widget prop types declare the node they render as an inline object literal type, written by hand, that never references BaseSchema or any exported schema type:

  • packages/plugin-list/src/ObjectGalleryProps.schemapackages/plugin-list/src/ObjectGallery.tsx:18
  • packages/plugin-dashboard/src/ObjectDataTableProps.schemapackages/plugin-dashboard/src/ObjectDataTable.tsx:34

Compare the normal shape, where the widened type is anchored to a real schema — ObjectPivotTable uses PivotTableSchema & {…}, ObjectTimeline uses TimelineSchema & {…}, ObjectKanban is annotated KanbanSchema.

Why it matters

Because there is no BaseSchema in the ancestry, none of its 21 declared members exists on these two types. Every base key an author may legitimately write — id, className, visible, visibleWhen, hidden, disabled, testId, ariaLabel, label, style, … — is undeclared there, so each must be hand-copied into the literal when the component happens to need it.

That is measurable, not theoretical: it is exactly why both of these types carry their own bind member. The #6357 census found four local bind declarations across the repo; two of them are these, and they are the two that could not simply be deleted once BaseSchema declared the key — deleting the member would delete the declaration rather than inherit it. PR #6574 therefore ratchets them (with reasons) instead of removing them.

The two types also disagree with each other on strictness: ObjectDataTableProps.schema carries [key: string]: any, ObjectGalleryProps.schema does not. So the same class of author error is silently absorbed by one widget and a compile error on the other.

Why this is not #5155 / #6269

Adjacent, but distinct, and worth keeping separate:

Fixing #5155 would not touch these two; fixing these two would not touch #5155.

What needs measuring before anything is done

Deliberately no proposed patch — the anchor choice is the whole question.

Reproduce

sed -n '18,34p' packages/plugin-list/src/ObjectGallery.tsx
sed -n '34,50p' packages/plugin-dashboard/src/ObjectDataTable.tsx
git grep -n -F -- 'bind?:' packages
grep -rn "extends BaseSchema" packages/types/src/objectql.ts | head

Refs: #6357, PR #6574. Adjacent: #5155, #6269.

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