Skip to content

ObjectMap is the only view renderer that does not resolve marker titles through getRecordDisplayName — it reads a hard-coded 'name' key instead #5953

Description

@os-warren

Measured while implementing #5909 (PR pending). That card is fixed at the interface-page seam; this is the general half it does not reach.

What the sibling renderers do

ADR-0079 made @object-ui/core#getRecordDisplayName THE unified record display-name resolver, and the view renderers call it:

  • packages/plugin-kanban/src/ObjectKanban.tsx:301getRecordDisplayName(objectDef, item)
  • packages/plugin-calendar/src/ObjectCalendar.tsx:356getRecordDisplayName(objectSchema, record)
  • packages/plugin-gantt/src/ObjectGantt.tsx:600getRecordDisplayName(objectSchema, record)

Each takes an explicitly declared title field first and otherwise walks the object-level precedence (nameFielddisplayNameField/NAME_FIELD_KEYtitleFormat → type-aware field derivation → Record #<id>).

What ObjectMap does

packages/plugin-map/src/ObjectMap.tsx never imports the resolver. getMapConfig fills an absent title binding with a string literal:

titleField: schema.titleField||'name',

and the marker title is then a bare property read (ObjectMap.tsx:667):

consttitle=mapConfig.titleField ? record[mapConfig.titleField] : 'Marker';

So for any object whose display field is not literally name, record['name'] is undefined and every marker popup titles itself undefined. Note the asymmetry inside this one function too: the branch that reaches no config at all yields 'Marker', while the branch that yields 'name' yields undefined — the more configured path degrades worse.

Why #5909's fix does not close this

#5909 derives a titleField in defaultMapFromObject, so ADR-0047 interface pages that auto-derive their map binding stop hitting the literal. That covers one seam. Still uncovered:

  • a hand-declared map block that omits titleField (the derivation is skipped entirely — InterfaceListPage.tsx's mapCfg is (view.options as any)?.map ?? …);
  • every map that does not come through an interface page at all (ObjectView, a directly authored object-map node, dashboards);
  • objects whose title needs the titleFormat template or the record-key probe — steps a static field-name binding structurally cannot carry.

Resolving through getRecordDisplayName at the read site would cover all of them and delete the literal, which is the shape the other three renderers already have.

Suggested shape

In the marker useMemo, replace the bare read with the resolver, passing the declared binding as the explicit option so an authored titleField still wins:

consttitle=getRecordDisplayName(objectSchema,record,{titleField: mapConfig.titleField});

objectSchema is already fetched in this component for field metadata. Worth checking against the 'Marker' placeholder the no-config branch produces, and against ObjectMap.listViewMapConfigReach.test.tsx, which currently pins the undefined/placeholder behaviour.

Unassigned; filed plainly for triage to grade.

Metadata

Metadata

Assignees

Labels

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

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions