Skip to content

fix(plugin-form): drawer and modal arms merge customFields like ObjectForm - #10251

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-10073-customfields-merge
Sep 24, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-10073-customfields-merge

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #10073
Clause-②: no

What

object-form.customFields is registered with one description for every formType: "Field definitions merged over the set generated from object metadata." The default arm has merged since objectui#9778. The drawer and modal arms (ObjectForm spreads the whole schema into DrawerForm / ModalForm) still REPLACED the generated set with the members. They now merge the same way.

  • New module-private helper packages/plugin-form/src/customFieldsMerge.ts (not re-exported from the barrel). mergeCustomFields holds the whole rule: override by name in place, keep the rest, append unmatched members in authored order. An empty customFields counts as unauthored.
  • ObjectForm.tsx: the inline override lookup and the append block moved into that helper. The generator body is byte-identical apart from push becoming return.
  • flatFields.ts (buildFlatFields, the one flat builder DrawerForm and ModalForm share) takes customFields and routes through the same helper. ⚠️ This file is outside the claimed file surface. It is where the drawer and modal generated set is actually produced, so the merge lands there once rather than being hand-copied into both containers.
  • DrawerForm.tsx / ModalForm.tsx: the setFormFields(schema.customFields) early return is gone, and the builder gets customFields.

fieldGroups derivation (PM mechanism assumption 4), measured

ObjectForm does not switch the fieldGroups fallback off for customFields. fieldGroupSections is gated on schema.sections only and is derived from groupableFields, which comes from the merged formFields. Its grouped render then resolves each section's names against that merged pool, so a member renders as its own definition inside the group its own group key names. This behaviour is unambiguous, so no open question was needed. Drawer and modal now do the same:

  • the schema.customFields?.length short-circuit is dropped from both derivedSections memos;
  • the derived sections hand an authored member back as its object (withCustomFieldMembers). The drawer and modal build a derived section body through buildSectionFields, which regenerates a NAME from the object schema but passes a runtime FormField through verbatim. Names no member supplies are unchanged, so forms without customFields resolve as before;
  • the modal's auto-layout memo (the one that sizes the dialog) no longer returns null for customFields. ObjectForm auto-lays-out the merged list, and the modal's flat render already did (it fell back to applyAutoLayout at render). Only the inferred modalSize changes.

The collapse regions, projectSectionDivider and the divider pushes (objectui#9849 step 2) are untouched.

Evidence (HEAD a54b97d)

  • New pin: __tests__/drawerModalCustomFieldsMerge-10073.test.tsx. It runs through the real ObjectForm for each of simple / drawer / modal, with rows OVERRIDE, KEEP, APPEND, NO DATA SOURCE and FIELD GROUPS. 15 passed.
  • Before leg (drawer/modal restored to base 0aacecc under a trap, helper and ObjectForm at HEAD): 8 failed, 7 passed. The failures are exactly the drawer and modal OVERRIDE / KEEP / APPEND / FIELD GROUPS rows. The 5 simple rows (the lit control) and the 2 no-data-source rows stay green. Restore was proven by the blob hash equalling HEAD and an empty git diff HEAD.
  • Ablation of the derived-section member substitution in DrawerForm.tsx (scripts/ablation-replace.mjs, anchor 1 to 0): the drawer FIELD GROUPS row goes red with expected 'Channel' to be 'INLINE CHANNEL'. Restored to blob == HEAD.
  • vitest run packages/plugin-form/: 113 files, 1110 passed, 1 skipped.
  • pnpm --filter @object-ui/plugin-form type-check (after building the ^... closure of 10 packages): exit 0.
  • eslint on the 6 changed source files: 0 errors. Warnings are no higher than base, file for file (ObjectForm 61 to 60).
  • apps/console/src/__tests__/registry-inputs-spec-parity.test.ts: 199 passed.
  • The check:new-line-citations, check:control-bytes, check:unreferenced-sources, check:changeset-claims, check:pending-changeset-literals and check:test-path-roots gates all exit 0.
  • origin/main was still 0aacecc at PR time, so the merge was a no-op.

Acceptance notes

  • ⚠️ Behaviour change, stated in the changeset: authors who relied on the drawer or modal replacing the generated set now see the object's other fields alongside the members.
  • Not changed, recorded here: when a data source is present but getObjectSchema fails, ObjectForm falls back to the members only (objectui#9778), while drawer and modal show their error panel, as they did before this PR. The registered description does not cover a failing adapter.
  • Edge, not changed: in a derived group, a member authored with a STRING field key is read by buildSectionFields as the spec shape. Runtime members carry the metadata object there.
  • Out of scope, reported to the seat and not fixed here: with explicit sections plus customFields, the drawer and modal build section fields from the object schema and ignore the members. The default arm resolves them from the merged pool. Probe on HEAD, same schema per arm: simple:INLINE NOTE, drawer:Note, modal:Note.

Session: https://claude.ai/code/session_01877XiBYSaRCk2CU7cMSg3S


Generated by Claude Code

…tForm

`DrawerForm` / `ModalForm` replaced the generated field set with a
non-empty `customFields`, while `ObjectForm`'s default arm merges it
(objectui#9778) and the registered description of the key is one sentence
for every `formType`. The merge rule now lives in one module-private helper,
`customFieldsMerge.ts`, called by ObjectForm and by the shared flat builder
the two overlay containers use. `customFields` no longer switches the
fieldGroups fallback or the modal's auto-layout off, matching ObjectForm,
and a derived group resolves an authored member as its whole definition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01877XiBYSaRCk2CU7cMSg3S
…odal arms

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01877XiBYSaRCk2CU7cMSg3S
@github-actions

Copy link
Copy Markdown
Contributor

changeset-claim-re-read

⚠️ 1 pending changeset(s) describe a file this change touches

Their bodies publish verbatim into the CHANGELOG at the next release, so this is a request to re-read them against your diff — addressed here because you are the one seat that can answer it without re-deriving anything.

⛔ Nothing here blocks, and nothing here is a verdict on your change. This gate exits 0, is not a required context, and judges name resolution, never meaning: it asked whether a pending body names a file you touched. "Is this sentence still true?" is the one question it will not answer, and the one you are being asked to answer.

.changeset/8738-object-form-fields-description.md

  • names ObjectForm.tsx → packages/plugin-form/src/ObjectForm.tsx — edited by this change

    The registration declared { name: 'fields', type: 'array' } with no description, so an author had nowhere to read that this key's members are bare field names — a different vocabulary from sections[].fields, which also accepts the spec FormFieldSchema object (identity key field, e.g. { field: 'note', colSpan: 2 }). Moving one of those objects to the top-level fields resolves to no name and is skipped by SimpleObjectForm (ObjectForm.tsx) and by buildFlatFields (flatFields.ts, shared by the drawer/modal presentations). Behaviour is unchanged by this entry; it only adds the description text an author would need to avoid the drop before writing it.

  • names flatFields.ts → packages/plugin-form/src/flatFields.ts — edited by this change

    The registration declared { name: 'fields', type: 'array' } with no description, so an author had nowhere to read that this key's members are bare field names — a different vocabulary from sections[].fields, which also accepts the spec FormFieldSchema object (identity key field, e.g. { field: 'note', colSpan: 2 }). Moving one of those objects to the top-level fields resolves to no name and is skipped by SimpleObjectForm (ObjectForm.tsx) and by buildFlatFields (flatFields.ts, shared by the drawer/modal presentations). Behaviour is unchanged by this entry; it only adds the description text an author would need to avoid the drop before writing it.

Read the paragraph, not the line: both false halves of the objectui#8617 claim sat in one paragraph, and correcting either alone would have left it asserting the same wrong thing.

If a claim did go false, correct the body. That is precedented and prose-only, frontmatter untouched; check-changeset-overwrite.mjs will report the correction as its own case 2 ("correcting a declaration on purpose … legitimate"), which is the intended shape — one gate asks for the read, the other records the write.

Not covered, stated so nobody reads this as more: a born-false claim that spells no line address at all (objectui#9495 coordinated one by ORDINAL — "a grep finds that member first" — and deciding that means reading what the sentence means), a claim spelled as a symbol or a package rather than a backticked file name, and a file named ambiguously.

Compared the checked-out tree with 0aacecc08 (merge-base with origin/main): 6 file(s) changed outside .changeset/, read against 1275 pending declaration(s) that publish a body (1843 pending in total). · run

@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 329 chunks) 3036.5 KB 3104.5 KB
Main entry chunk (gzip) 147.5 KB 350 KB
Entry file index-J4M7lQ2C.js —
Status PASS —

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 16.68KB 6.20KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (ActiveOrganizationStorage.js) 25.05KB 9.16KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.18KB 10.59KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 8.46KB 3.43KB
auth (index.js) 3.19KB 1.44KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 26.08KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 546.87KB 130.98KB
core (index.js) 8.94KB 3.59KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 222.47KB 61.83KB
fields (index.js) 253.40KB 63.99KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 1.22KB 0.64KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.22KB 2.26KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 33.36KB 10.88KB
i18n (useDisplayLocale.js) 2.85KB 1.45KB
i18n (useObjectLabel.js) 34.34KB 9.17KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 39.02KB 11.00KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 6.62KB 2.45KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 5.52KB 2.10KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.52KB 4.88KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.24KB 2.16KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.39KB 3.10KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 14.81KB 3.63KB
plugin-calendar (index.js) 51.44KB 14.62KB
plugin-charts (index.js) 71.82KB 20.13KB
plugin-chatbot (index.js) 198.27KB 47.18KB
plugin-dashboard (index.js) 133.00KB 35.19KB
plugin-designer (index.js) 215.98KB 44.34KB
plugin-detail (index.js) 257.23KB 66.95KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 144.55KB 37.05KB
plugin-gantt (index.js) 167.99KB 41.37KB
plugin-grid (index.js) 214.80KB 58.65KB
plugin-kanban (index.js) 48.71KB 15.17KB
plugin-list (index.js) 113.53KB 27.99KB
plugin-map (index.js) 21.74KB 7.07KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 43.55KB 11.99KB
plugin-timeline (index.js) 30.68KB 8.95KB
plugin-tree (index.js) 10.58KB 3.72KB
plugin-view (index.js) 85.18KB 21.05KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 106.60KB 35.16KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.63KB 2.18KB
react (schema-input.js) 4.25KB 2.04KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (body-dialect.js) 4.38KB 1.98KB
sdui-parser (codegen.js) 6.58KB 2.74KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 5.74KB 2.54KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (kanban-quick-add.js) 3.89KB 1.87KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 15.71KB 5.30KB
types (ai.js) 4.11KB 2.06KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 1.00KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.93KB 1.49KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.74KB 2.25KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 5.00KB 2.39KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 17.15KB 6.32KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review September 24, 2026 13:59
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Sep 24, 2026
Merged via the queue into main with commit 142fdfd Sep 24, 2026
45 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-10073-customfields-merge branch September 24, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

finding(plugin-form): DrawerForm/ModalForm still REPLACE customFields where ObjectForm now MERGES

1 participant