Skip to content

fix(plugin-form): the record dialog draws a { group } form section; ModalForm resolves its sections through the one resolver (objectui#11542) - #11551

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-11542-modal-form-group-sections
Oct 3, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-11542-modal-form-group-sections

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #11542

Clause-②: no

The measurement the card asked for

The card asks where the More actions › Edit / New dialog's tabbed form takes its sections: "either a branch before withGroups or the gate answering false there". Measured: a branch before withGroups, taken one level higher than ObjectForm. The dialog never enters ObjectForm, so neither withGroups nor its gate canResolveGroups runs on that path; the gate never gets the chance to answer at all.

  • AppContent (the console's global record dialog) and useActionModal (action-opened modals), both in @object-ui/app-shell, mount ModalForm directly with formType: 'modal' and spread resolveFormViewLayout(objectDef) into its schema. That helper copies formView.sections as authored and sets contentLayout: 'tabbed' for a tabbed form view.
  • ModalForm had no call to resolveSectionGroupReferences. A { group } section reached it with no fields, buildSectionFields built it an empty body (it reads section.fields ?? []), and the empty-body filter that runs above the layout fork dropped it. Both content layouts lost it: tabbed (no tab) and stacked (no header).
  • Red on origin/main 6f5719e1c with the new pin and no source edit: 9 failed, 2 passed, the 2 passing legs being the hand-enumerated control. The tabbed leg read the tab keys identity, contact_info where identity, contact_info, buying_centre was expected, which is the hotcrm symptom.

The fix

ModalForm resolves its sections once, through resolveSectionGroupReferences (the resolver ObjectForm's withGroups uses, which derives from deriveFieldGroupLayout), with the same four inputs: objectName, formType, objectDef and resolvable. The call sits above both content layouts. objectDef is the object schema the dialog already loads (its objectSchema state), so the fix adds no request, and the form keeps showing its skeleton until that schema lands. The call returns schema.sections itself when no section uses group. That includes every section list ObjectForm's own modal route hands over, which arrives already resolved, so no other modal takes a new path.

No assembly rule is re-implemented. sectionGroups.ts, ObjectForm.tsx and every app-shell host are untouched. Landing: packages/plugin-form/src/ModalForm.tsx, as the claim expected, plus the pin, one @object-ui/plugin-form patch changeset and one README paragraph.

The PM's six mechanism hypotheses, each measured

  1. Confirmed. Both hosts mount ModalForm directly, and the pin was red on origin/main as stated above.
  2. Confirmed. The schema effect already loads the resolver's objectDef input. The diff reads that existing state and adds no fetch.
  3. Confirmed. New and Edit share the path. Every tabbed, stacked and FLS leg runs in both create and edit, and all of them were red before and are green after.
  4. Confirmed. The stacked arm dropped the section too: its legs were red before the fix. The resolution sits above the layout fork, so the stacked legs are now green as well.
  5. Holds, and pinned. Resolved members go through the dialog's one field gate (gateFields, which is gateFormFields) exactly like enumerated ones, because that gate runs per section on the built fields, after resolution. The pin puts a read-denied member and a write-denied member inside the group: the first is not drawn, the second is drawn locked, and the third member stays live as the control, in create and in edit. On the ObjectForm side, read but not pinned here: its pre-withGroups applyFieldPermissions sees fields: undefined on a group section, but every arm it routes to re-gates its resolved fields through gateFormFields, so that ordering opens no path around FLS.
  6. DrawerForm left unchanged. It has 0 resolver hits. A grep of direct mounts outside plugin-form finds one: FieldDesigner in @object-ui/plugin-designer, which builds its own sections in code (Basic / Type-specific / Advanced, each carrying fields) and never passes a form view's sections. ObjectForm's formType: 'drawer' route resolves above its fork. The README now says that a directly mounted DrawerForm does not resolve them.

Also measured: the master-detail arm (a form view with subforms) hands raw sections to MasterDetailForm, which renders its parent through ObjectForm. A { group } section there was therefore already resolved. A throwaway probe confirmed this for both content layouts and was deleted, not committed.

Pins

packages/plugin-form/src/__tests__/modalFormSectionGroupReference-11542.test.tsx (new file, so the trunk's restamped comment line in formSectionGroupReference-7051.test.tsx is untouched). It renders ModalForm the way AppContent does, with no ObjectForm above it, using the hotcrm shape: two hand-enumerated sections beside { group: 'buying_centre', columns: 2 }. The object declares two groups and the form references the SECOND one, so a constant resolution draws the wrong members and the exclusivity assertion catches it.

  • Tabbed, create and edit: the tab strip is identity, contact_info, buying_centre, the group tab carries the group's label, and its panel holds exactly the group's members in declared order (none of the other group's).
  • Control, create and edit: the hand-enumerated tabs hold exactly their own members.
  • The group tab is a live part of the one form: in edit it carries the record values, and in create a value typed there reaches the single create() payload.
  • Stacked, create and edit: the exact header and field outline, with the group's header and members in authored position.
  • FLS, create and edit: a read-denied member is not drawn, a write-denied member is locked and the remaining member is live.
  • Unknown group: no tab, siblings intact, and exactly one form-section-group-unknown report. That report only fires against a LOADED object definition, so this leg also shows the dialog's objectDef reaches the resolver.

Reverse verification (from committed state)

The script restored ModalForm.tsx to its 6f5719e1c blob with a trap on EXIT, INT and TERM to put it back. It checked the file on disk: the resolver marker count went from 2 to 0, and the on-disk hash equalled the base blob 146186f. It then ran the pin: 9 failed, 2 passed, the same split as the pre-fix run. Finally it restored with git checkout HEAD -- PATH and checked the result: the on-disk hash equals the HEAD blob, the marker count is back to 2, git diff HEAD is 0 bytes and the status is clean. The test imports ../ModalForm from source (and @object-ui/plugin-form is aliased to src in vitest.config.mts), so there was no dist leg.

Verification on the merged head 202a8c0

origin/main 6158e4c (the @objectstack/* 17.6.0 trunk) was merged in with a merge commit and pnpm install was re-run, as the PM asked. All of the following ran on 202a8c0 with a clean tree:

  • pnpm --filter '@object-ui/plugin-form^...' build: exit 0, Scope 12 of 47 workspace projects.
  • pnpm --filter @object-ui/plugin-form test: exit 0, Test Files 162 passed (162), Tests 1859 passed and 1 skipped (1860). The package has 162 test files at HEAD (161 at base), so the new pin is in the count.
  • pnpm --filter @object-ui/plugin-form type-check: exit 0. The script name was echoed, tsc --noEmit && tsc -p tsconfig.test.json, and the test project lists the new file (--listFilesOnly).
  • ESLint over the whole plugin-form package (its own lint script is eslint .): exit 0, 202 files in the JSON report, 0 errors. ModalForm.tsx has 20 warnings, equal to its base blob's 20. --max-warnings is not set in this repo.
  • App-shell and console tests that render the real ModalForm (via the src alias): 11 files, exit 0, 137 passed. These are createModalHonorsFormView, useActionModal.resolve, useActionModal, useConsoleActionRuntime, AppContent.declaredVisibilityKeys, DashboardView.modalTarget, RecordDetailView.modalDispatch, RecordDetailView.paramDialogTitle, recordFormNavigation, App.uploadAltitude-10131 and FormPage.visibleWhen.
  • Every one of these exited 0 with an OK or VERDICT line: pnpm check:control-bytes, check:new-line-citations (0 new citations), check:changeset-claims, check:pending-changeset-literals, check-changeset-presence, -no-major, -overwrite, -fixed, check-test-path-roots, check-type-check-coverage, check:unreferenced-sources and check-doc-links.
  • NOT MEASURED: check:readme-exports. Its precondition is every package built (it refused with "the population COLLAPSED", 25 packages unbuilt), and that is CI's lane. The README edit is prose only and adds no fenced block or import binding, which is what that gate judges.

Acceptance notes

  • ModalFormSectionConfig still declares fields required and no group; the hosts pass the form view's sections untyped. The declared face is left unchanged on purpose, because the claim's Clause-②: no rests on no published input or type moving.
  • DrawerForm mounted directly does not resolve { group } sections. No host mounts it that way with authored sections today, so it reaches no public door. No carrier.
  • Semantically adjacent to objectui#11539, which changes WHICH form view becomes the dialog's .form. This PR changes how the dialog renders that view's sections. Disjoint by file, and MetadataProvider.tsx is untouched.

Session: https://claude.ai/code/session_01FjqrwXPfSMkSfkKYDSRkN2 (an os-dev run dispatched by the PM loop, claim comment 5969222831).


Generated by Claude Code

claude added 4 commits October 3, 2026 12:44
…s through the one resolver (objectui#11542)

`ModalForm` is mounted directly by the console's More actions › Edit / New
dialog and by action-opened modals, which spread the form view's sections
into it as authored. Only `ObjectForm` resolved `form.sections[].group`
(`withGroups`), so a `{ group }` section reached the dialog with no
`fields`, built an empty body and was dropped by the empty-body filter: no
tab in the tabbed layout, no header in the stacked one.

`ModalForm` now resolves its sections through `resolveSectionGroupReferences`
against the object schema it already loads, above both content layouts. The
call returns its input unchanged when no section uses `group`, and every
resolved member still passes `gateFields`.

Claude-Session: https://claude.ai/code/session_01FjqrwXPfSMkSfkKYDSRkN2
Co-authored-by: Claude <noreply@anthropic.com>
…oup }` sections (objectui#11542)

Claude-Session: https://claude.ai/code/session_01FjqrwXPfSMkSfkKYDSRkN2
Co-authored-by: Claude <noreply@anthropic.com>
…any` (objectui#11542)

Claude-Session: https://claude.ai/code/session_01FjqrwXPfSMkSfkKYDSRkN2
Co-authored-by: Claude <noreply@anthropic.com>
…e/issue-11542-modal-form-group-sections

Claude-Session: https://claude.ai/code/session_01FjqrwXPfSMkSfkKYDSRkN2
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation plugin tests labels Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 330 chunks) 3307.4 KB 3330.4 KB
Main entry chunk (gzip) 150.3 KB 350 KB
Entry file index-gGMSLFIW.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.88KB 6.25KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.11KB 3.87KB
auth (ActiveOrganizationStorage.js) 27.95KB 10.04KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.22KB 10.61KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.17KB 5.40KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.72KB 2.24KB
auth (SocialSignInButtons.js) 9.70KB 3.93KB
auth (UserMenu.js) 3.39KB 1.21KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.70KB 10.94KB
auth (createAuthenticatedFetch.js) 8.54KB 3.46KB
auth (index.js) 3.63KB 1.64KB
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) 27.11KB 7.97KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.28KB 2.60KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.50KB 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) 570.92KB 136.80KB
core (index.js) 10.00KB 3.96KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 231.08KB 64.07KB
fields (index.js) 261.51KB 66.22KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 2.59KB 1.22KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.24KB 2.27KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 39.35KB 12.88KB
i18n (translateFn.js) 0.20KB 0.18KB
i18n (useDisplayLocale.js) 3.52KB 1.76KB
i18n (useObjectLabel.js) 34.49KB 9.23KB
i18n (useSafeTranslation.js) 7.14KB 2.92KB
layout (index.js) 39.47KB 11.25KB
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.86KB 5.00KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.52KB 2.26KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.33KB 3.07KB
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) 16.04KB 3.92KB
plugin-calendar (index.js) 53.17KB 15.46KB
plugin-charts (index.js) 83.60KB 22.89KB
plugin-chatbot (index.js) 198.22KB 46.97KB
plugin-dashboard (index.js) 142.26KB 38.44KB
plugin-designer (index.js) 231.28KB 48.76KB
plugin-detail (index.js) 245.43KB 64.53KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 172.96KB 44.52KB
plugin-gantt (index.js) 179.16KB 45.06KB
plugin-grid (index.js) 234.37KB 64.34KB
plugin-kanban (index.js) 49.59KB 15.58KB
plugin-list (index.js) 116.55KB 28.95KB
plugin-map (index.js) 25.60KB 8.62KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 44.12KB 12.29KB
plugin-timeline (index.js) 38.80KB 11.71KB
plugin-tree (index.js) 14.51KB 5.15KB
plugin-view (index.js) 90.23KB 22.73KB
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.81KB 3.58KB
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) 120.63KB 39.56KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.50KB 2.06KB
react (schema-input.js) 4.25KB 2.04KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (body-dialect.js) 4.50KB 1.99KB
sdui-parser (codegen.js) 9.45KB 3.76KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 6.06KB 2.68KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.84KB 1.90KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 21.42KB 7.05KB
types (ai.js) 4.39KB 2.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 4.12KB 1.61KB
types (authoring-nodes.js) 0.20KB 0.19KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (cloud.js) 0.20KB 0.18KB
types (complex.js) 4.16KB 1.96KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (dashboard-widget-layout.js) 2.06KB 0.96KB
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) 5.07KB 2.39KB
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) 2.52KB 1.31KB
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) 4.99KB 1.96KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 19.93KB 7.25KB
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 October 3, 2026 14:02
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 3, 2026 14:02
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 3, 2026
Merged via the queue into main with commit 584eeca Oct 3, 2026
45 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-11542-modal-form-group-sections branch October 3, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation plugin tests

Projects

None yet

1 participant