Uh oh!
There was an error while loading. Please reload this page.
fix(list): keep injected owner_id out of leading auto-derived list columns - #2702
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
|
Uh oh!
There was an error while loading. Please reload this page.
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>
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 freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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