Skip to content

finding(components): data-table's column normalization also reads an undeclared col.label alias for header — the sibling alias on the same two lines as col.name #5351

Description

@os-support-ai

Found while running #5120's census (not claiming; observation class). Baseline objectui main @ 9c60144.

The fact

packages/components/src/renderers/complex/data-table.tsx:777 (and :786, the auto-width pass) normalizes two keys per column, not one:

header: col.header || col.label,
accessorKey: col.accessorKey || col.name

#5120 rules on the second line only. The first is the same shape: TableColumn (packages/types/src/data-display.ts:218-226) declares header: string and does not declare label, so the adapter accepts a spelling its own type refuses — AGENTS.md #0.1, one key with two spellings.

Why it is filed separately rather than fixed alongside col.name

Three reasons, all of which make it a different decision from the identity alias:

  1. It is a label, not an identity.col.name resolving to undefined produces blank cells over a live header; col.label resolving to nothing produces a headerless column. Different failure, different blast radius.
  2. Its authorized usage is much wider. Every name-spelled column the finding(components/plugin-dashboard): data-table 的访问键归一化读一个自身类型未声明的 col.name 别名,而唯一在交付前解析列身份的生产者只有 RelatedList #5120 census found also spells label, and so do the type: 'table' examples in content/docs/api/schema-reference.md (~L402, L1131), content/docs/core/report-schema.mdx:327, the crud example at schema-reference.md:537, and both skills guides (skills/objectui/guides/data-integration.md:185, skills/objectui/guides/schema-expressions.md:377). Retiring label is a strictly larger census than retiring name.
  3. label is the spec's own word.ListColumnSchema spells its display text label; header is the data-table adapter's. So unlike name, label is not legacy-objectui vocabulary leaking in — it is metadata vocabulary reaching an adapter that speaks header, i.e. the same "one translation, one place" boundary finding(plugin-grid): ObjectGrid 在 ObjectGridSchema.columns 上容忍未声明的 accessorKey / header 拼写 —— 声明类型是 strict 的 ListColumn,#3104 的列身份门禁结构上看不见这条支路 #5068 drew, seen from the label side.

Whether the answer is "translate labelheader at each producer" (the #5068 shape) or "the adapter owns both" is a maintainer call.

Recheck

sed -n '772,790p' packages/components/src/renderers/complex/data-table.tsx
sed -n '218,227p' packages/types/src/data-display.ts

Grading

finding, not pm:queue. Related: #5120, #5068, #5022.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions