Skip to content

finding(plugin-dashboard): two more private copies of the reference-bearing field family — #5312's "LAST private copy" claim is false #5692

Description

@os-sales

Measured while implementing #4914's ruled gate (the six predicate faces). Filed unassigned, out of that card's ruled scope — recording it rather than widening a 7-package diff.

What is there

@object-ui/core's EXPANDABLE_FIELD_TYPES (packages/core/src/utils/expand-fields.ts) is documented as the reference-bearing field family, with a long docblock recording what happened the last time this table was hand-copied per consumer (#4770 / #4790 / #4815). Two consumers were re-pointed at it and each carries an identity pin (a spy on its .has) so a member-identical private copy fails rather than quietly re-forking.

packages/plugin-dashboard holds two more copies that were never converted, and neither derives from nor pins against the shared set:

  1. packages/plugin-dashboard/src/recordFields.tsxconst LOOKUP_TYPES = new Set([...]), read by isLookupType.
  2. packages/plugin-dashboard/src/ObjectDataTable.tsx — an inline const isLookup = (t) => t === 'lookup' || … inside computeLookupExpand.

Both are $expand-driving decisions, which is EXPANDABLE_FIELD_TYPES' own stated job ("buildExpandFields below ("expandable")").

Why it is not merely duplication — the sets genuinely differ

EXPANDABLE_FIELD_TYPES (core)LOOKUP_TYPES (recordFields)inline isLookup (ObjectDataTable)
lookup
master_detail
user
tree
reference

So they are not in a subset relation in either direction — the exact shape #4790 recorded for the form layer's copy, and the reason a gate could not say so. Today a tree (self-referencing hierarchy) column is $expand-ed by the form/grid road and not by the dashboard table, while a reference column is expanded by the dashboard and is not a member of the family core publishes.

The claim this falsifies

#5312 (closed) states paramToField was "now the LAST private copy of the reference-bearing rule". It was not — these two predate it and were not in that sweep's file surface. Worth recording so the next consolidation does not start from the same false premise.

Not fixed here, deliberately

#4914's ruling scoped a retirement gate ahead of these predicates, not a re-homing of the family they read. Converting them is a behaviour change in both directions (tree gains expansion, reference loses it) and needs its own call on which set is right — most likely EXPANDABLE_FIELD_TYPES gains reference, since two independent consumers reached for it. The gate landed by #4914's PR runs ahead of both predicates and is unaffected by whichever way this goes.

Related: #4770, #4790, #4815, #5312 (the four earlier copies), #4914 (this measurement's origin).

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions