Skip to content

expand-fields.ts documents a rendering behaviour UserCellRenderer has never had — an unexpanded user id printed as bare text, not as "—" #8693

Description

@os-justin

Found while implementing objectui#8434 (a user reference that resolved to nothing rendered as a person). Filed rather than fixed there: that card's fix is confined to packages/fields, and correcting this would pull @object-ui/core into its published-source set for a comment-only edit.

The false claim

packages/core/src/utils/expand-fields.ts, in the docblock over EXPANDABLE_FIELD_TYPES:

 * `user` is a lookup specialised to `sys_user`: it carries the same `reference`
 * + id storage and the server resolves it through the same expand path as
 * `lookup` / `master_detail`, so a `user` column that is NOT requested for
 * expansion comes back as a raw user id and renders as "—" (objectui#2032).

The last clause is wrong and has been for as long as UserCellRenderer has existed. Measured on da5e4f69e by rendering getCellRenderer('user') against three unexpanded primitives:

value what UserCellRenderer actually rendered
'u_1' span class="block max-w-full truncate" title="u_1" containing u_1
'01HQZX9K2M4N6P8R' the same span, containing the raw ULID
'Ada Lovelace' the same span, containing the raw string

No em-dash, no muted treatment, nothing. UserCellRenderer has no resolver at all — no useLookupName, no isLikelyOpaqueId. The "—" behaviour the comment describes belongs to LookupCellRenderer, which does have both, and which returns a muted em-dash only for values that pass isLikelyOpaqueId.

Why it matters

This docblock is the argument for user being a member of EXPANDABLE_FIELD_TYPES, and the set is read by at least eight consumers (the docblock enumerates them). A reader reasoning about "what happens if a user column is not expanded" is told the UI degrades visibly. It did not — it printed the id as if it were a name, which is exactly the defect objectui#8434 was opened for. The false sentence is plausibly part of why nobody looked.

After objectui#8434

That card changes the answer again: an unexpanded user id now renders the unresolved-reference affordance (raw value kept, plus a stated sentence). So the clause is wrong both before and after, in different ways, and needs rewriting either way. lookup / master_detail / tree are unchanged and still behave as the "—" clause describes, for opaque-id-shaped values only.

Suggested scope

Correct the one clause to say what each family does, or drop the rendering claim entirely and keep the storage claim, which is the part the set actually depends on. Comment-only; no behaviour.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationdomain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatfindingpackage: corepm:dispatched

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions