This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(list): keep injected owner_id out of leading auto-derived list columns - #2702
Merged
Merged
Conversation
…lumns View-less objects derive their default list columns from the object's field order. The framework's applySystemFields spreads injected system/audit/ownership fields to the FRONT of that order and stamps them `system: true`; owner_id is deliberately non-hidden and non-readonly (ownership is reassignable), so the old name-based exclusion lists in ObjectGrid and InterfaceListPage — which never listed owner_id — let it through as column #1 on many showcase list pages (e.g. showcase_field_zoo). Default-column derivation now classifies system fields via a shared isSystemManagedField helper that branches on the spec `system` flag (the single source of truth stamped by the registry) with a name-set fallback covering the ownership/tenancy FKs. owner_id is pushed to the end (ObjectGrid) / excluded from the business columns (InterfaceListPage), and future injected fields are covered without editing a name list. Declares the `system` flag on the @object-ui/types field metadata; adds unit tests and a changeset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NMcdh2cNs165TSF4ub61oy
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
added a commit
that referenced
this pull request
Jul 21, 2026
…2777) (#2779) ObjectView renders an object's default "所有记录" list (and prefills the "Add View" dialog) from field order when the object declares no explicit list view. Both paths carried their own name-based SYSTEM_FIELDS set that — like the pre-#2702 lists in ObjectGrid / InterfaceListPage — never listed owner_id. Since applySystemFields spreads injected system/audit/ownership fields to the FRONT of the field map and owner_id is deliberately non-hidden / non-readonly (ownership is reassignable), it leaked through as the leading raw-id column on every view-less object (e.g. showcase_invoice), redundant with the business owner (Field.user) column. Derive both paths through a single shared defaultListColumnsFromObject helper that classifies system fields via isSystemManagedField from @object-ui/types (the classifier #2702 introduced) — branching on the spec `system` flag with a name-set fallback covering the ownership/tenancy FKs. Auto-derived lists lead with business fields again and pick up future injected fields without editing a name list. Adds a red/green unit test + changeset. Closes #2777. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
os-zhuang
pushed a commit
that referenced
this pull request
Sep 2, 2026
…th the object's name field An object that declares no list view gets its default grid columns synthesized from `highlightFields`, taken verbatim. But `highlightFields` is ADR-0085's "most important fields" role, not a column list, and its first consumer — the detail-page highlight strip — deliberately removes the title field because the page H1 above it already shows one. So correct metadata routinely omits the record name: `showcase_account` declares `nameField: "name"` and `highlightFields: ["status", "industry", "annual_revenue"]`, and its default grid rendered 14 rows with no name column and no way to tell them apart. A list has no H1, so the same declaration needs the opposite treatment. Not a new convention: `deriveLookupColumns` already leads picker columns with the display field and filters it out of the declared list. `@object-ui/core` gains `resolveNameField` (which field titles an object — the name-space twin of `getRecordDisplayName`, now sharing one spelling of the declared pointer so the two cannot drift) and `leadWithNameField` (move it to the front of a synthesized column list). All three synthesis faces use it: ObjectView, InterfaceListPage and ObjectGrid's own derivation. On the two capped faces the lead is applied before the 5/6-column slice. Author-declared column lists are untouched. Three cases decline to lead: no field def, `hidden: true`, and a derived pick landing on a system-managed column (#2702/#2777) — a declared `nameField` on a system field still leads. Fixes #7245 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
akarma-synetal
pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Sep 9, 2026
…th the object's name field (objectstack-ai#7284) An object that declares no list view gets its default grid columns synthesized from `highlightFields`, taken verbatim. But `highlightFields` is ADR-0085's "most important fields" role, not a column list, and its first consumer — the detail-page highlight strip — deliberately removes the title field because the page H1 above it already shows one. So correct metadata routinely omits the record name: `showcase_account` declares `nameField: "name"` and `highlightFields: ["status", "industry", "annual_revenue"]`, and its default grid rendered 14 rows with no name column and no way to tell them apart. A list has no H1, so the same declaration needs the opposite treatment. Not a new convention: `deriveLookupColumns` already leads picker columns with the display field and filters it out of the declared list. `@object-ui/core` gains `resolveNameField` (which field titles an object — the name-space twin of `getRecordDisplayName`, now sharing one spelling of the declared pointer so the two cannot drift) and `leadWithNameField` (move it to the front of a synthesized column list). All three synthesis faces use it: ObjectView, InterfaceListPage and ObjectGrid's own derivation. On the two capped faces the lead is applied before the 5/6-column slice. Author-declared column lists are untouched. Three cases decline to lead: no field def, `hidden: true`, and a derived pick landing on a system-managed column (objectstack-ai#2702/objectstack-ai#2777) — a declared `nameField` on a system field still leads. Fixes objectstack-ai#7245 Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Many showcase list pages (e.g.
showcase_field_zooat/_console/apps/com.example.showcase/showcase_field_zoo) render Owner as the very first column, which is unexpected.Root cause
Two independent behaviors combine:
applySystemFields) auto-injectsowner_idon user-authored business objects and spreads its injected system/audit/ownership fields to the front of the field map.owner_idis stampedsystem: truebut is deliberately non-hidden / non-readonly (ownership is reassignable).ObjectGridandInterfaceListPagethat never listedowner_id. So it slipped through and — being first in field order — became column Implement visual designer for Object UI schemas #1.Fix (stable — keys off the
systemflag)Classify system fields through a shared
isSystemManagedField(name, field)helper in@object-ui/typesthat branches on the specsystemflag (the single source of truth stamped by the registry, perfield.zod.ts: "Tools that surface system fields separately from author-declared business fields should branch on this flag"), with a name-set fallback covering the ownership/tenancy FKs.ObjectGrid: system fields (incl.owner_id) are pushed to the end of the auto-derived columns instead of leading.InterfaceListPage.defaultColumnsFromObject: excluded from the auto-derived business columns.system?: booleanon the@object-ui/typesfield metadata.Because it keys off the
systemflag, future framework-injected fields are handled automatically — no name list to keep in sync.Verification
@object-ui/typesclassifier tests (system-fields.test.ts) +defaultColumnsFromObjecttests against a field-zoo-shaped object; existingcolumn-features/mobileCardLookupDisplaygrid suites still pass.ObjectGridthrough its server-backed derivation with the framework's injected metadata shape (owner_idfirst,system: true). Auto-derived columns are nowName, Email, Number, Select, Date, Owner— Owner last, business fields lead, audit/org columns excluded.Affected packages
@object-ui/types,@object-ui/plugin-grid,@object-ui/app-shell(patch; changeset included).🤖 Generated with Claude Code
https://claude.ai/code/session_01NMcdh2cNs165TSF4ub61oy
Generated by Claude Code