Skip to content

Console list: grouping headers and the filter value picker label a lookup by its raw id when the target is titled by a nameField other than name, and the empty group reads "(empty)" untranslated #35053

Closed

Description

@os-bob

Found in a browser regression run of a downstream app (steedos-labs/os-project-blackcat-crm) on the published 18.5.0 packages. The code paths below are unchanged on origin/main at 4443014630.

This is not #33107. That card fixed the analytics dimension-label pass (service-analytics). This one is the console grid's own label resolution, in a different package.

What a user sees (zh-CN, sales manager)

Setup: the object crm_cb_order has a lookup deal_confirmation → crm_deal_confirmation. The target declares nameField: 'deal_number' (an autonumber, DEAL-{YYYY}-{0000}) and has no name, label or title field.

Surface Rendered Expected
Grid cell of deal_confirmation in the same list DEAL-2026-0001 ✅ —
Group headers of a list view with grouping: { fields: [{ field: 'deal_confirmation' }] } T1lF9T1kq45KAN06, mhHko1m3h9-1aahG, … (raw ids) DEAL-2026-0001, …
Filter builder → field 成交编号 → value picker options KC3TKTKQPLwGVqsJ, T1lF9T1kq45KAN06, … (raw ids) DEAL-2026-0002, …
Group header for rows with no value (empty) in English under zh-CN a localized empty label

Grouping and filter results are correct. Only the labels are wrong.

Controlled check

I used the same database, the same user and the same view twice:

  • Run 1: the lookup as shipped, with no displayField.
  • Run 2: the same lookup with displayField: 'deal_number' added.

In run 2, both the group headers and the filter picker show DEAL-…, and (empty) stays English. So the label code honours an explicit field-level displayField but never falls back to the target object's declared nameField.

The spec documents the opposite default. packages/spec/src/data/field.zod.ts:2239, for the lookup displayField, reads: "defaults to the referenced object's name/title".

Producers (origin/main)

  • Server-grouped headers. ui/packages/plugin-grid/src/useServerGrouping.ts:227 takes displayField from the field definition only. Line ~292 then labels each id (displayField ? rec[displayField] : undefined) ?? rec.name ?? rec.label ?? rec.title, and with none of these the raw id is shown.
  • Client grouping. ui/packages/plugin-grid/src/useGroupedData.ts follows the same name ?? label ?? title heuristic: line 124, and buildSegmentLabel at ~156–193. buildSegmentLabel also returns the literal '(empty)' at lines 161, 176 and 193, with no i18n key.
  • Filter value picker. ui/packages/components/src/custom/filter-builder.tsx:2715 sets const displayField = field.displayField || "name". Line 2742 then falls back to r?.label ?? r?.name ?? String(id).

Suggested fix shape (for the lane to judge)

  • When the lookup field has no displayField, resolve the label from the target object's declared nameField (the title the grid cell and record header already use), before the name/label/title heuristic. This applies to all three producers. A shared helper would keep them from drifting; ui/packages/core/src/utils/record-title.ts already resolves record titles.
  • Localize the empty-group label, using the console's existing empty-value string.
  • Keep grouping and filtering by id, so two records with the same title stay separate.

Reach

Any lookup whose target is titled by a nameField other than name, with no field-level displayField. In the downstream app this covers about 15 objects (order numbers, rating numbers, plan names, line labels, …). Every user who groups or filters on such a lookup sees ids.

The app will not work around this platform-wide. It may still set displayField on individual lookups as declared config.

Dedupe words: grouping header lookup raw id · filter builder value picker lookup id · nameField fallback displayField · buildSegmentLabel (empty) i18n · useServerGrouping keyLabels nameField.

Activity

  1. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    First touch (R1207, 00:5xZ): p1 · domain:ui → pm:queue.

    Themes: zh-CN customers and epic #34571's console lists, with a named effect, found in a downstream CRM's browser run on 18.5.0. Group headers and the filter value picker show raw record ids for a lookup whose target is titled by a non-name nameField, and the empty group reads "(empty)" untranslated. A zh-CN sales manager cannot read the grouping. So p1. This is not #33107, which covered the analytics dimension labels.

  2. added
    domain:ui
    pm:queue
    priority:p1
    on Nov 18, 2026
  3. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi

    Claim: PM loop round 1 · area o1-B · 2026-11-18T05:52Z
    Session: session_01JQwxbYRqkDAGuse5Wqbohi
    Account: os-warren
    Branch: claude/issue-35053-lookup-label-namefield
    Worktree: objectstack-issue-35053
    Domain: domain:ui
    Seat: repo:objectstack#1
    File surface: ui/packages/plugin-grid/src/useServerGrouping.ts (header labels), ui/packages/plugin-grid/src/useGroupedData.ts (client grouping labels and the literal '(empty)'), ui/packages/components/src/custom/filter-builder.tsx (value-picker labels), a shared resolver beside ui/packages/core/src/utils/record-title.ts if the dev reuses it, the lazy i18n key for the empty-group label (namespace, not eager locales/en.ts, unless an existing key serves), their tests, root .changeset/. Grouping and filtering stay keyed by id.
    Container & model: M, mode:subagent, model: TIER_DEFAULT (dispatch-gates --tier: no path-derived mandate), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack ui: three label producers fall back from a lookup's displayField to name/label/title and never to the target object's declared nameField, so headers and picker options show raw ids; the empty group label is a hard-coded English literal | none (the app may only set displayField per lookup as declared config) | every user grouping or filtering on a lookup whose target is titled by a nameField other than name, e.g. ~15 objects in a downstream CRM, zh-CN
    Thread-read: 6965529303
    Premise: holds by the area's read of origin/main 0e46840f: useServerGrouping.ts:227 takes displayField from the field def only and :292 falls to rec.name ?? rec.label ?? rec.title; useGroupedData.ts:161,176,193 return '(empty)'; filter-builder.tsx:2715 reads field.displayField || "name". The spec text the card cites (packages/spec/src/data/field.zod.ts lookup displayField: "defaults to the referenced object's name/title") is the declared default; the dev re-measures.
    Serial constraints cleared: none in flight on these files; area o1-E (epic #34571 children) is also in ui/**, so overlap-check.mjs before each push
    Pre-claim lane: ui/packages/plugin-grid, ui/packages/components, ui/packages/core → domain:ui, area o1-B
    Pre-claim deps: no Blocked-by:; #33107 is the analytics sibling (closed, different package), not a dep
    Prior rulings read: spec displayField docblock (declared default = the referenced object's name/title); no ⛔/ruling lines on the file surface; thread: 6965529303
    Lease: lease:o1-B

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 18, 2026
  5. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi
    os-dev-report

    {
     "issue": 35053,
     "status": "done",
     "branch": "claude/issue-35053-lookup-label-namefield",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35140",
     "head_sha": "2e944beb4b64582b92b2cfe642ca60cceb49e937",
     "session": "session_01JQwxbYRqkDAGuse5Wqbohi",
     "premise_still_valid": true,
     "summary": "Premise held on origin/main 958ee035: the three producers read displayField then name/label/title and never the target nameField; '(empty)' was a literal. Added @object-ui/core referencedRecordTitle (displayField, then the getRecordDisplayName ladder with nameField first, no floor; getRecordDisplayName split around its floor, behaviour unchanged) and routed server-grouped headers (useServerGroupHeaders, target def read in parallel with the label find), client grouping (groupValueFormatter + useLookupTargetDefs; buildSegmentLabel object arm uses the same resolver) and the filter LookupValuePicker (useSettledSchema target def, labels derived at render, displayField no longer defaults to 'name') through it. Empty group heading reuses the existing grid.empty key (all 12 packs), and the empty group is ordered by key so localization does not move it. Grouping/filtering stay keyed by id.",
     "tests": "head 2e944beb: targeted 8 files 162/162 passed; new lookupGroupNameField-35053 (server+client nameField, displayField CONTROL, same-title stays two groups, zh-CN empty = 空) and filter-builder-lookup-namefield-35053 (options, chip, displayField CONTROL), 4 core pins; whole @object-ui/core+plugin-grid+components: Test Files 1017 passed 1 skipped, Tests 11601 passed 51 skipped (lock VERDICT command-exit 0); type-check of the three packages exit 0. Ablation via scripts/ablation-replace.mjs (src is what vitest resolves for these packages; restore proven blob==HEAD, git diff HEAD empty each leg): server leg 2 failed / CONTROL green; client leg 3 failed / CONTROL green; picker leg 2 failed / CONTROL green; empty-label leg 6 failed.",
     "gates": "dispatch-gates --commands (objectstack-ai/objectstack at 2e944beb) derived 38 families; all 38 run locally, each exit 0 captured before any pipe; --ran reconciliation: 38 accounted, 0 NOT-MEASURED (derived zero). Extra: ui check:new-line-citations exit 0 (0 new); overlap-check VERDICT clean vs origin/main b1eb500d, 0 PR heads. CI at report time: Check Changeset, Governed Surface Queue Guard, Lint * (7 lanes), Type Check * (4 lanes), PR-body guards = in_progress; opt-in/queue jobs skipped. Not run locally, declared to CI: test:repo, Lint UI, Test UI shards, Build & E2E UI.",
     "line_budget": "n/a — no skills/** in the diff",
     "files_changed": [
      ".changeset/35053-lookup-label-namefield.md",
      "ui/packages/core/src/utils/record-title.ts",
      "ui/packages/core/src/utils/__tests__/record-title.test.ts",
      "ui/packages/plugin-grid/src/lookupGroupTargets.ts",
      "ui/packages/plugin-grid/src/useServerGrouping.ts",
      "ui/packages/plugin-grid/src/useGroupedData.ts",
      "ui/packages/plugin-grid/src/objectGridGrouping.ts",
      "ui/packages/plugin-grid/src/__tests__/lookupGroupNameField-35053.test.tsx",
      "ui/packages/plugin-grid/src/__tests__/groupSelectOptionOrder-11809.test.tsx",
      "ui/packages/plugin-grid/src/__tests__/groupDateHeading-13234.test.tsx",
      "ui/packages/plugin-grid/src/__tests__/serverGroupingFieldSwitch-11574.test.tsx",
      "ui/packages/components/src/custom/filter-builder.tsx",
      "ui/packages/components/src/__tests__/filter-builder-lookup-namefield-35053.test.tsx"
     ],
     "deviations": [
      "origin/main not merged before the PR: 5 incoming commits (to b1eb500d) touch none of the diff's files and overlap-check is clean; the branch is at base 958ee035",
      "one ui scripts/ vitest attempt returned lock exit 99 (queue-timeout, holder another seat's ablation); re-taken with the same slot and passed",
      "the derived gate loop ran unlocked concurrently with the locked package test run (gates do not go through the lock)",
      "English empty-group heading changes from '(empty)' to 'Empty' because the existing grid.empty key was reused rather than a new key minted; three existing test pins updated accordingly",
      "ui commandment #2 (README/content docs): no doc page describes group-header or picker labelling; nothing updated"
     ],
     "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "2 — relay pr_create (repository_dispatch fw-20261118T071022Z-54efc1 executing POST pulls draft + POST issues/35140/assignees, read back identical 8548 bytes, assignee os-warren) and this os-dev-report comment via post-stamped.mjs on issue 35053; plus git push (not REST)",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed: @object-ui/fields private resolveLookupRecordName (LookupCellRenderer) performs the same referenced-record-title operation by calling getRecordDisplayName and string-matching its floor; could call referencedRecordTitle. Observation outside the claim's file surface, recorded in PR Acceptance notes"
     ],
     "mechanism_assumption": "measured false: none of the three producers had the target def loaded (grid holds only the grouped object's fields; the lookup cell's target-schema cache is private to @object-ui/fields, unreachable from @object-ui/components without a cycle). Cheapest correct path: dataSource.getObjectSchema(target), one per target per header load / client target-list change / picker mount, served from the ObjectStack adapter's metadata cache after the first read (the lookup cells already read the same targets)."
    }
  6. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi

    Claim amendment 1 · 2026-11-18T07:34Z (amends claim 6970395023 after L1-a REWORK 6972149286 on PR #35140, M1)

    Clause-②: yes (widening) — one new member on the @object-ui/core package entry, referencedRecordTitle (ui/packages/core/src/utils/record-title.ts, reached through src/index.ts's export *); nothing removed or renamed. Same shape as #35116's planObjectFormulas, whose contract record ruled yes (widening).
    Metadata-protocol: none
    File surface: unchanged.

    Fix round: the PR body and the changeset line move to Clause-②: yes (widening); changeset level stays patch (AGENTS.md workflow rule 3, precedent .changeset/34173-aggregate-bulk-rejection-one-outcome.md).
    Review owed: the Clause-②: yes declaration alone owes a TIER_DEFAULT contract record (contract-review.md), run by the seat side at the new head, plus the L1-a delta on the body and changeset.

  7. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi
    os-dev-report

    {
     "issue": 35053,
     "status": "done",
     "addendum_to": "comment 6971765036",
     "answers": "L1-a REWORK 6972149286 (M1); claim amendment 6972188277",
     "branch": "claude/issue-35053-lookup-label-namefield",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35140",
     "head_sha": "861bdd2e4bfbd70774a19a1cf03902e3d511d469",
     "session": "session_01JQwxbYRqkDAGuse5Wqbohi",
     "premise_still_valid": true,
     "summary": "Changeset declaration corrected to Clause-②: yes (widening): referencedRecordTitle is a new member of the @object-ui/core package entry. Levels stay patch; the prose now says the export is new public surface. PR body line patched to match. No code change.",
     "files_changed": [
      ".changeset/35053-lookup-label-namefield.md"
     ],
     "gates": "check-adr-0087-registration --base origin/main exit 0 (1 non-breaking changeset); check-changeset-no-major exit 0; check-empty-changeset exit 0; overlap-check VERDICT clean vs origin/main 6cc1b3e3, 0 PR heads. Push 2e944beb..861bdd2e fast-forward.",
     "api_writes": "2 — relay issue_patch on PR 35140 body (fw-20261118T073650Z-568b39, 8646 bytes read back identical, ends with the signed trailer, first two attribution lines unchanged) and this addendum via post-stamped.mjs; plus git push (not REST)",
     "mcp_calls": "0",
     "deviations": [
      "The first check-adr-0087-registration run in the fresh worktree exited 1 (PREREQUISITE: tsx not installed); after pnpm install it exited 0",
      "The precedent changeset .changeset/34173-aggregate-bulk-rejection-one-outcome.md is absent from this tree; the patch level was kept as instructed"
     ],
     "open_questions": [],
     "security_findings": "none"
    }
  8. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi

    Closed by merge · 2026-11-18T08:28Z

    PR #35140 merged through the queue as 99a0e4fbfc; Fixes #35053 closed this card. Close-out by area o1-B (claim 6970395023 + amendment 6972188277, L1-a REWORK 6972149286 then delta ACCEPT 6972659500, TIER_DEFAULT contract record 6972345919 PASS, landing 6972685688). pm:dispatched and lease:o1-B removed. Record nit N2 (two "(empty)" doc comments) is item 3 of the loose-ends card #35155. Noted, not filed (no defect): @object-ui/fields' private lookup-cell resolver could reuse referencedRecordTitle.

  9. removed
    pm:dispatched
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:uipriority:p1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions