Repository navigation
fix(components,fields): head a widget-hinted nameField through its face (objectui#13216) - #13291
Conversation
page:header's declared-pointer rung printed a nameField's stored text even when the field declares a widget whose read face names the value, so a record share (nameField recipient_id, widget recipient-picker) headed its page with a raw user id. @object-ui/components gains a field-face seam (setFieldFaceResolver / resolveFieldFace) that @object-ui/fields fills when it loads with the registry's own getCellRenderer(resolveCellRendererType(field)) lookup, bounded to widget promotions with a registered face. The header draws the pointer value through that face in RecordTitleChip's new titleNode slot, with the whole record as dependentValues; every other case heads as before. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014MXhk1yjWh37d634hLy3p7
README section for setFieldFaceResolver / resolveFieldFace and the RecordTitleChip titleNode slot, the matching passages in the page-header and field-registry guides, and the release declaration (components minor for the new exports, fields patch). The header rung drops two explicit any annotations and carries the static-components disable with its reason. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014MXhk1yjWh37d634hLy3p7
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier:
Face: the PR body declares ① Derived judgments(a) The added surface is additive and matches the PR body's "Contract surface" table: RIGHT.
(b) The seam's semantics are fail-safe: RIGHT.
(c)
(d) The declaration the rule follows exists at the pin: RIGHT.
(e) Docs, per AGENTS.md #2: RIGHT. A README section names the two functions, the props, the fail-safe answers and the read-at-render caveat. Check-runs on the head, read 2026-10-21T01:33Z: 35 returned; 13 success, 3 skipped (the coverage legs and dependabot), 19 in progress, none failed. In-progress is recorded as what it is; the seat's flip waits for all of them. ② Semver levelMatches what the diff publishes.
③ Boundary flagsEvery dev note on objectui#13216 (report
Implemented-by: VERDICT: PASS |
席位核对 · ACCEPT · objectui#13216 · PR #13291 ·
|
The new exported FieldFace collided with app-shell's FieldFace (the metadata form's edit-control union), which the one-authority-per-exported -name gate refuses. The unpublished family moves together: FieldFace -> FieldReadFace, FieldFaceProps -> FieldReadFaceProps, FieldFaceResolver -> FieldReadFaceResolver, setFieldFaceResolver -> setFieldReadFaceResolver, resolveFieldFace -> resolveFieldReadFace, across both packages, the tests, the README, the docs guide and the changeset. No behaviour change. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014MXhk1yjWh37d634hLy3p7
Contract reviewSupersedes the record on this PR at head Served-tier:
Face: the PR body declares ① Derived judgments(a) The added surface is additive and matches the PR body's "Contract surface" table: RIGHT.
(b) The seam's semantics are fail-safe: RIGHT.
(c)
(d) The declaration the rule follows exists at the pin: RIGHT.
(e) Docs, per AGENTS.md #2: RIGHT. A README section names the two functions, the props, the fail-safe answers and the read-at-render caveat. Check-runs on the head, read 2026-10-21T01:50Z: 35 returned; 11 success, 3 skipped (the coverage legs and dependabot), 21 in progress, none failed. In-progress is recorded as what it is; the seat's flip waits for all of them. ② Semver levelMatches what the diff publishes.
③ Boundary flagsEvery dev note on objectui#13216 (reports
Implemented-by: VERDICT: PASS |
席位核对 · ACCEPT · objectui#13216 · PR #13291 ·
|
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Fixes #13216
Clause-②: yes
Summary
page:header's declared-pointer rung printed anameField's stored text even when that field declares a widget whose read face names the value.sys_record_sharedeclaresnameField: 'recipient_id', and that field declareswidget: 'recipient-picker'withdependsOn: ['recipient_type'], so a record share's H1 was the recipient's raw user id while its list column already drew the user's name.Route A, the registry bridge, as claimed:
@object-ui/componentsowns a field-face seam (lib/field-face.ts): one setter,setFieldReadFaceResolver, and one reader,resolveFieldReadFace, on the package entry.@object-ui/fieldsfills it when its entry module loads, with the lookup the grid's cells make,getCellRenderer(resolveCellRendererType(field)). The answer is bounded to the keys a declared widget promotes to (WIDGET_CELL_RENDERER_TYPES), and only once a host has registered a face there. The key's default face is the stored text (TextCellRenderer), which is what the heading already prints, so that case answers no face.@object-ui/componentsdoes not import@object-ui/fields, so no package cycle closes.page:headerasks the seam for the declarednameField's face when the pointer rung is the one that answers (no explicittitle, and a value on the record). When a face resolves, the rung draws the stored value through it, with the whole record asdependentValues, sorecipient_typereaches the face'sdependsOnread. Otherwise every rung heads exactly as before.containers.tsxnames no widget; the declaration decides.RecordTitleChipgains an optionaltitleNodeslot drawn inside itsh1.titlestays a requiredstringfor every caller.Out of scope, as the claim says:
RecipientPickerFieldand the face itself, the server's declaration, and any name-to-label mapping in the console.Patch round 1
CI on
7f8be05a7(Test shard 11/16) failedscripts/__tests__/one-authority-per-exported-name-6273.test.ts, "declares no name twice outside the named, shrinking baseline". The failure wasFieldFace — a NEW colliding name: the new export collided with app-shell's ownFieldFaceinviews/metadata-admin/SchemaForm.tsx, the union naming which controlFieldControlrenders. The two are different things, andKNOWN_COLLISIONSonly shrinks, so app-shell is untouched. Instead, the unpublished family was renamed together at85fa87048:FieldFace→FieldReadFaceFieldFaceProps→FieldReadFacePropsFieldFaceResolver→FieldReadFaceResolversetFieldFaceResolver→setFieldReadFaceResolverresolveFieldFace→resolveFieldReadFaceThe rename covers both packages' source, the four test files, the README,
content/docs/guide/fields.mdand the changeset.content/docs/layout/page-header.mdxnamed none of them. The filelib/field-face.tskeeps its name, and its header now says why the names say READ. App-shell'sSchemaForm.tsxalso exports aresolveFieldFace; the gate named onlyFieldFace, and the rename clears both. None of the five new names occurs anywhere else in the tree (git grep -w, zero hits before the rename).Readings at
85fa87048, each exit code captured before any pipe:pnpm exec vitest run scripts/__tests__/one-authority-per-exported-name-6273.test.tsexits 0, with 11 tests passed. Control: puttingexport type FieldFace =back inlib/field-face.tsturns it red again ("FieldFace — a NEW colliding name"), and the restore was proven (blob equals HEAD, emptygit diff HEAD).git grep -n -w -E "FieldFace|FieldFaceProps|FieldFaceResolver|setFieldFaceResolver|resolveFieldFace"hits underpackages/app-shell/only. The hits are its ownFieldFaceandresolveFieldFacewith theirSchemaFormtests, its CHANGELOG, a file-localFieldFacecomponent inRecordSnapshotSummary.tsx, and a comment inpredicate.ts.containers,page:headerorRecordTitleChip: 48 files, 636 tests passed, exit 0.@object-ui/componentstype-checkexits 0 andlintexits 0 (0 errors).@object-ui/fieldstype-checkexits 0, after the'@object-ui/fields^...'closure rebuild; itslintexits 0 (0 errors). The rebuiltdisttypes carry the new names.check:doc-types,check:doc-fences,docs:check-links,check:new-line-citations,check:control-bytes,check-changeset-presence,check-changeset-no-major,check:unreferenced-sourcesandcheck:self-import.--strictagainst the rebuiltdist, with a red control.check:readme-exports --listjudgesresolveFieldReadFaceandFieldReadFacereal.No ablation was re-run: this round renames, and behaviour does not change. The Tests and Gates sections below are the round-0 readings at
7f8be05a7, and the renamed names in them are the same symbols.Contract surface
Every export, prop and type member this diff adds. All are additive, and nothing existing is renamed, removed or narrowed.
@object-ui/components, on the package entry (src/index.ts):setFieldReadFaceResolverFieldReadFaceResolverorundefined, and returnsvoid. The last install wins;undefinedremoves the resolver.resolveFieldReadFaceFieldMetadata(ornull/undefined) and returns aFieldReadFaceorundefined. It answersundefinedwhen no resolver is installed, the field is absent, or the resolver answers none.FieldReadFaceReact.ComponentTypeoverFieldReadFacePropsFieldReadFaceResolverFieldMetadatatoFieldReadFaceorundefinedFieldReadFacePropsFieldReadFaceProps.valueunknown, the field's stored valueFieldReadFaceProps.fieldFieldMetadata(from@object-ui/types), the field's declarationFieldReadFaceProps.dependentValuesunknownvalues: the whole record, for a face that reads a siblingRecordTitleChipProps.titleNodeReact.ReactNode, drawn inside theh1in place oftitle's textFieldReadFacePropsis the subset of@object-ui/fields'CellRendererPropsthe heading passes, so a registered cell renderer is aFieldReadFacewithout a cast. The fields package'stype-check(which reads this package's builtdisttypes) is green with its resolver typed that way.@object-ui/fields: no export added. Its entry module now callssetFieldReadFaceResolverat load with an unexported function.sideEffectsistrueon both packages, so no bundler drops that call.Mechanism readings (the PM's hypotheses, measured)
.objectstack-shais06cab4849a8a616487d468a11dd370e929137990.git merge-base --is-ancestor 99e4eaa227 06cab4849a8aexits 0 in the objectstack checkout, and that exit code proves the ancestry on its own. At the pin,packages/plugins/plugin-sharing/src/objects/sys-record-share.object.tscarriesnameField: 'recipient_id'. Underrecipient_id: Field.text({, it carrieswidget: 'recipient-picker',anddependsOn: ['recipient_type'],. All three were read withgit showat the pin.RecipientCellFacereadsuseRecipientLabel(value, dependentValues)), so the H1 renders a node, with the whole record as the row. The refinement: the fields resolver answers no face while the widget's key still draws the package default (the stored text). A host that loads@object-ui/fieldsbut registers no face under the key therefore keeps today's string heading, not an equivalent heading drawn throughTextCellRenderer. There is no per-widget case incontainers.tsx.apps/console/src/main.tsxstatically imports@object-ui/app-shell. App-shell's entry statically importsviews/widget-ref-cells/widget-ref-cell-renderers, which statically imports@object-ui/fieldsand registersRecipientCellat module load. ESM evaluates both before the entry's body callsrender.page:headerhost that gives the header a record (RecordDetailView,PagePreviewandDetailViewinplugin-detail) statically imports@object-ui/fields.RecordDetailViewthe way the console does. Its module body, before the firstrender, readresolveFieldReadFacefor arecipient-pickerfield and gotRecipientCell.@object-ui/fieldsonly after the first render would draw the stored text until its next render.document.title: the console'sAppShellis the one writer.ConsoleLayoutpasses itbranding.title(app label and product name), so the record's title never reaches the tab.aria-label: theheaderelement takes onlypage:header's ownariabag, and theh1has none. Its accessible name is its text, which is now the face's text (the stored id until the label read lands, then the name).RecordDetailViewderivesrecordTitlewithgetRecordDisplayName(objectDef, readablePageRecord)and passes it touseRecordBreadcrumbTitle,addRecentItemandrefreshFavoriteLabel. These read the stored value. For a selectnameField,getRecordDisplayNameapplies no option label, so the select rung of objectui#13103 labels the H1 only, and the breadcrumb keeps the stored option value. They are unchanged by this PR.page-header-title.widgetFace-13216.test.tsx: a plain textnameField; a selectnameField(the objectui#13103 option label); a title template; a record with nonameField; an explicittitle; an empty pointer value; and a host where no resolver is installed. The existingpage-header-title.selectNameField-13103.test.tsxpins pass unchanged.Tests
New, beside each piece:
packages/components/src/__tests__/page-header-title.widgetFace-13216.test.tsx: the realpage:headerwith a stand-in resolver. It holds THE CARD (H1 reads "Ada Lovelace", notusr_9f3), the face's inputs (the value, the declaration, and the whole record withrecipient_type), the array form offields, the face outranking atitleFormat, and the seven controls above.packages/components/src/__tests__/record-title-chip.titleNode-13216.test.tsx: the slot, plus a control without it.packages/components/src/__tests__/field-face.seam-13216.test.tsx: the setter and reader.packages/fields/src/__tests__/fieldFaceSeam-13216.test.tsx: tests that the fields module load fills the seam. It answers no face while the key draws the default face. It answers the face a host registers, which is the same component asgetCellRenderer(resolveCellRendererType(field)). Its controls are no widget,filter-condition, a select base type and aformathint. End to end, the realpage:headerover asys_record_share-shaped record, with an async stand-in host face, heads with the user's name; with no host face it heads with the stored id.Runs:
containers,page:headerorRecordTitleChip, plus the seam file: 47 files, 631 tests passed;7f8be05a7(repo-root form,pnpm exec vitest run --maxWorkers=2 packages/PKG/):packages/components/exited 0, with 421 files passed and 1 skipped (422), and 4188 tests passed with 24 skipped;packages/fields/exited 0, with 273 files passed and 1 skipped (274), and 4199 tests passed with 7 skipped.Ablations (fix committed first; each mutation landed through
ablation-replace.mjswith anchor counts and blob hashes checked on disk; each restore was proven to haveblob == HEADand an emptygit diff HEAD; vitest resolves both packages tosrcthrough the root alias, so there is nodistleg):titleNode={declaredFace}from the headersetFieldReadFaceResolver(resolveDeclaredFieldFace);in fieldsreturn face;){title}onlyChromium (preinstalled
/opt/pw-browsers/chromium): a scratch Vite entry, never committed and deleted after, mounted the realRecordDetailViewfrom@object-ui/app-shellover a stub data source. The record was asys_record_sharewithrecipient_id: 'usr_9f3',recipient_type: 'user', andsys_useranswering{ id: 'usr_9f3', name: 'Ada Lovelace' }.usr_9f3while the lazy face loaded, thenAda Lovelace. Its markup was the face's own truncatingspan, and the page logged no errors. The face readsys_useronce.titleNode: declaredFace: the H1 stayedusr_9f3for the whole 10 s window.Ada Lovelaceagain.Gates
Hand-derived for this diff, because
dispatch-gates.mjsrefuses objectui. Each exit code was captured before any pipe, at7f8be05a7:pnpm --filter @object-ui/components lint: exit 0, with 0 errors. This repository sets no--max-warnings.pnpm --filter @object-ui/components type-check: exit 0. It covers both programs;--listFileson the test program lists the three new test files andlib/field-face.ts.pnpm --filter @object-ui/fields lint: exit 0, with 0 errors.pnpm --filter @object-ui/fields type-check: exit 0. It ran afterpnpm --filter '@object-ui/fields^...' run buildand a fresh@object-ui/componentsbuild, because it reads that package'sdisttypes.--listFileslistsfieldFaceSeam-13216.test.tsx.pnpm check:new-line-citations: exit 0, withVERDICT new-cross-file-line-citations: 0 new citation(s).pnpm check:control-bytes: exit 0.node scripts/check-changeset-presence.mjs: exit 0, with "9 source file(s) of 2 released package(s) changed, and this change declares 1 changeset(s)".node scripts/check-changeset-no-major.mjs: exit 0.check:self-import,check:unreferenced-sources,check:phantom-deps,check:pending-changeset-literals,check:changeset-claims(report-only),check:test-path-rootsandcheck:vi-mock-override-shape: exit 0 each.check:doc-fences,check:doc-json,check:doc-types,check:doc-example-idsanddocs:check-linksexit 0 each.pnpm check:readme-exports: exit 1, PRECONDITION. The population collapsed because the repository is not fully built (26 packages are unbuilt), so the run as a whole is NOT MEASURED. Its--listjudges this README'sresolveFieldReadFaceandFieldReadFaceimportsrealagainst the builtdist.pnpm check:doc-snippets: exit 2, PRECONDITION NOT MET (it needs a 34-package build), so it is NOT MEASURED. The new README snippet was compiled on its own instead (see Docs).*.api.mdand no api-extractor configuration. The one entry-surface test in this package,chart-primitives-removed-7397.test.ts, asserts absences only, and it passes in the full suite.Left to CI: the full test shards,
pnpm lintacross the repository, Bundle Analysis (the eager-closure budget, which needs a console build), and the two repository-wide gates whose local run could not execute (marked PRECONDITION above).Docs
packages/components/README.md: a "Record heading through a field's face" section under Layout Components. Its snippet compiles under--strictagainst the builtdist, with a red control.content/docs/layout/page-header.mdx: the derived record heading's widget-face rule.content/docs/guide/fields.md: "A widget's face on the record heading". Thedocs:check-linksgate judges the cross-page anchor; a misspelt anchor turned it red, and the real one passes.Changeset
.changeset/13216-header-widget-face.md:@object-ui/componentsisminor, because the PR adds new exports and a new prop. The CONTRIBUTING versioning section makes a new featureminor, andmajoris never declared.@object-ui/fieldsispatch: it adds no export, and its behaviour changes.Acceptance notes
getRecordDisplayNameinRecordDetailView, outside this claim's file surface, and no synchronous label exists for them. This is a code reading, not filed: no carrier.@object-ui/types'FieldMetadatadeclares nowidgetmember, although the spec's field declares one. The seam therefore typesfieldasFieldMetadata(the registry's ownCellRendererProps.field), and the fields resolver reads the widget throughresolveCellRendererType. That is an observation only, not filed.The record share's heading defect was first measured by the maintainer's HotCRM pass (objectstack-ai/objectstack#24701). This change was implemented by a dispatched
os-devrun for objectuidomain:uiseat 1, sessionhttps://claude.ai/code/session_014MXhk1yjWh37d634hLy3p7.Generated by Claude Code