Skip to content

fix(console): FormPage degrades an unregistered widget to the type renderer (objectui#10472) - #10553

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-10472-formpage-widget-degrade
Sep 25, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-10472-formpage-widget-degrade

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #10472

What changed

FormPage's resolveFieldWidgetKey took an authored widget whenever one was present and returned resolveFormWidgetType(widget). That resolver answers a spelling nothing registers with the text widget, so a select field carrying an unknown widget rendered a free-text input. The spec's FieldSchema.widget describe (installed @objectstack/spec@17.4.0, read verbatim; its placeholder is spelled WIDGET here because GitHub strips angle-bracket fragments): "Form widget override — names a registered field component (resolved as field:WIDGET) to render this field instead of the type default. Degrades to the type renderer when unregistered."

The widget leg now runs only when namesRegisteredWidget(widget) holds. Otherwise the row falls through to the arity leg and the type leg of the same resolver.

  • Files: apps/console/src/components/FormPage.tsx (+44 / -6), new apps/console/src/components/FormPage.widgetDegrade-10472.test.tsx (+135), new .changeset/10472-formpage-widget-degrades-to-type.md (+19, @object-ui/console patch).
  • No list of widgets was added. The lookup (H2) is resolveFormWidgetType itself, which is the same call the leg already made and the resolver whose loaders getLazyFieldWidget mounts. It is read for its documented unknown answer ("anything unknown falls back to text"): a spelling answered with text that is not itself text named nothing. A registered key, a retired spelling (its tombstone) and an alias the resolver knows keep resolving as before.

Premise check (H1–H4)

  • H1 confirmed on origin/main 111fa4c. The widget leg was if (field.widget) return resolveFormWidgetType(field.widget);.
  • Before, measured at 111fa4c with real widgets on /forms/:name: { type: 'select', options, widget: 'no_such_widget' } rendered INPUT[type=text]. { type: 'boolean', widget: 'no_such_widget' } rendered INPUT[type=text].
  • After, measured at 735c9ed with the same probe: the select field renders BUTTON[role=combobox] plus the hidden SELECT. The boolean field renders BUTTON[role=switch]. { type: 'password', widget: 'no_such_widget' } renders INPUT[type=password]. { type: 'select', multiple: true, widget: 'no_such_widget' } renders the multiselect group.
  • Controls in the same run: widget: 'radio' on a select renders radiogroup. widget: 'owner' renders the tombstone. widget: 'secret' on a text field renders INPUT[type=password]. widget: 'json' on a text field renders the code widget's TEXTAREA.
  • H3, the record form (packages/components/src/renderers/form/form.tsx), was measured with the dev's probe shape and real widgets after registerAllFields(). It shows the same symptom, and it is not changed here. select / field:select with widget: 'no_such_widget', and a metadata-carried field.widget: 'no_such_widget', all render INPUT[type=text]. field:boolean with the same widget renders INPUT[type=text] too.
  • Why form.tsx is a different mechanism: an unregistered spelling there reaches the ruled "unregistered-widget default" branch (objectui#5322 / objectui#5375). That branch reads the spelling. Measured at 735c9ed: { type: 'field:text', widget: 'secret' } and { type: 'field:text', widget: 'ui:password' } both render INPUT[type=password].
  • A plain degrade-to-type there would hand those rows to the registered text widget. How the spec's degrade rule composes with that secret ruling is a decision, so it is reported as a finding, not guessed here.
  • A fix in form.tsx would also have to converge three precedence sites: resolveWidgetType (boolean seeding), the cascade-clear effect's own widget || type, and the render resolvedType. It would also have to update the core validator's resolveAuthoredFieldWidgetId, which says it mirrors that precedence.
  • H4: the field:-qualified spellings are not ones the shared resolver knows, so after this PR they degrade to the type in FormPage. Measured at 735c9ed:
    • widget: 'field:owner' on a user field renders the person picker (lookup-trigger), with no refusal. Before this PR it rendered a working INPUT[type=text], also with no refusal.
    • widget: 'field:textarea' renders TEXTAREA on a textarea field and INPUT[type=text] on a text field.
  • The record form resolves both field:-qualified spellings as registry keys: the tombstone for field:owner, and TEXTAREA for field:textarea on a text field.
  • The bare retired widget: 'owner' still reaches the tombstone in FormPage, and that is pinned here. That the tombstone names the row's live type (data-retired-field-type="user") is objectui#10471, left as is. Whether a field:-qualified spelling is authorable on a form view at all was not measured here (the card lists it as unmeasured).

Tests (HEAD 735c9ed, after merging origin/main)

  • pnpm exec vitest run apps/console/src/components/FormPage.widgetDegrade-10472.test.tsx gave 4 passed (4) on fb70e86. The same 4 are inside the directory run below.
  • pnpm exec vitest run apps/console/src/components/ gave Test Files 31 passed (31), Tests 407 passed (407). VITEST-EXIT=0.
  • pnpm turbo run type-check --filter @object-ui/console --concurrency=2 gave Tasks 36 successful, 36 total. VERDICT command-exit 0.
  • tsc --noEmit --listFiles in apps/console lists the new test file (1 hit). TSC-EXIT=0.
  • pnpm exec eslint on the two changed source files reported 0 errors and 20 warnings. All 20 are outside this diff's hunks (react-refresh / no-explicit-any / set-state-in-effect, already present).
  • These gates all exited 0: check:control-bytes, check:test-path-roots, check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape, check:new-line-citations (0 new), check:changeset-claims, check:pending-changeset-literals, check-changeset-presence.mjs (1 changeset for 1 released package), check-changeset-no-major.mjs, check:unreferenced-sources, check:comment-mask-corpus, and check-governed-queue-guard.mjs --test (NOT GOVERNED).

Ablation (fix committed first, mutated through ablation-replace.mjs, restored to HEAD with an empty git diff HEAD)

  1. The guard was reverted to if (field.widget) {. Result: 2 failed | 2 passed (4). The two degrade pins went red and both controls stayed green.
  2. namesRegisteredWidget was made to always answer false. Result: 2 failed | 2 passed (4). The registered-radio control and the retired-owner control went red, and the degrade pins stayed green.

Acceptance notes

  • The pending .changeset/10179-formpage-shared-field-resolver.md says "An authored widget wins over type". After this PR that holds only for a widget that names something registered. This PR's changeset states the refinement, and both publish in the same release. That body was not edited because it is outside the claimed file surface.
  • FormPage still resolves alias spellings in widget (json renders code, secret renders password), while the record form treats them as unregistered (json renders INPUT[type=text]). Both were measured above. That difference existed before this PR and is recorded here, not decided.

Generated by Claude Code

…nderer

The widget leg of resolveFieldWidgetKey took any authored widget and
handed it to resolveFormWidgetType, whose answer for a spelling nothing
registers is the text widget, so a select field with an unknown widget
rendered a free-text input. The spec's FieldSchema.widget declares that
an unregistered widget degrades to the type renderer.

The leg now asks the same resolver whether the spelling names anything
and falls through to the arity and type legs when it does not. Pinned
with real widgets: an unknown widget on a select renders the select on
both authored places, a registered widget still wins, and a retired
spelling still reaches its tombstone.

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

Copy link
Copy Markdown
Contributor

changeset-claim-re-read

⚠️ 4 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/console-form-container-specs-one-declaration-5596.md

  • names FormPage.tsx → apps/console/src/components/FormPage.tsx — edited by this change

    objectui#5542 converged the LEAF of this contract — the field spec — and left the two containers above it untouched, because converging them was a bigger call than a mechanical import. FormSectionSpec and FormViewSpec were each hand-declared twice under the same names, once in packages/app-shell's SchemaForm.tsx and once in apps/console's FormPage.tsx. Unlike the leaf — whose console copy was a clean subset — these two had already drifted, in both directions, so neither copy was a subset of the other and there were two live answers to "what may an author write":

.changeset/console-form-field-spec-one-declaration-5542.md

  • names FormPage.tsx → apps/console/src/components/FormPage.tsx — edited by this change

    objectui#5040 was not a missing key. It was that two hand-written descriptions of one contract drifted, and nothing could notice, because each was only ever checked against itself. PR metadata-admin: FormFieldSpec declares dependsOn, one declaration for both halves #5537 converged the two app-shell descriptions into views/metadata-admin/form-spec.ts. A third survived in apps/console: FormPage.tsx declared its own nine-key interface FormFieldSpec, under the same name, in a different package — so the same failure mode stayed fully available.

.changeset/console-formpage-runtime-default-seed-5727.md

  • names apps/console/src/components/FormPage.tsx → apps/console/src/components/FormPage.tsx — edited by this change

    readPrefill in apps/console/src/components/FormPage.tsx seeded every declared default unconditionally. A defaultValue may be a literal, or an instruction the server resolves per insert — a DEFAULT_VALUE_TOKENS token (NOW(), current_user) or a CEL Expression envelope. Seeding one of those literally put the text NOW() into a datetime input on both /forms/:name and the public /f/:slug route, and submitting it sent that string as the field's value — which is neither absent nor null, so ObjectQL.applyFieldDefaults never resolved the declared default and the column stored the token text instead of a timestamp.

.changeset/console-formpage-visible-predicates-5594.md

  • names apps/console/src/components/FormPage.tsx → apps/console/src/components/FormPage.tsx — edited by this change

    apps/console/src/components/FormPage.tsx is a second, independent form renderer — its own buildSections, its own JSX — and it serves both the public /f/:slug route and the internal /forms/:name route. It read neither spelling of the FormView field visibility predicate: a repo-wide grep for a visibleWhen / visibleOn read inside that file returned zero. So a field an author conditioned on record.priority == 'urgent' — legal, spec-strict metadata that @objectstack/spec normalises to visibleWhen (ADR-0089), and that the metadata-admin designer both authors and honours — rendered unconditionally on both routes. Fail-open and silent: the author saw the field always, with no diagnostic.

  • names FormPage.tsx → apps/console/src/components/FormPage.tsx — edited by this change

    objectui#2212 recorded this exact symptom and PR fix(form): evaluate view-level FormField.visibleOn with the canonical CEL engine #2214 fixed it — in a different chain: ModalForm → resolveFormViewLayout → @object-ui/plugin-form sectionFields.ts → @object-ui/components renderers/form/form.tsx. FormPage.tsx is on that chain at no point, and Form-view FormField.visibleOn (CEL) is never evaluated — conditional fields always render #2212's regression pin lives with the chain it fixed, so nothing in the suite could see this copy. One contract, two implementations, each only ever checked against itself.

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 fee1da595 (merge-base with origin/main): 2 file(s) changed outside .changeset/, read against 1440 pending declaration(s) that publish a body (2022 pending in total). · run

@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 329 chunks) 3046.2 KB 3104.5 KB
Main entry chunk (gzip) 147.8 KB 350 KB
Entry file index-Cg_o9QCI.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) 27.95KB 10.04KB
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.52KB 3.45KB
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.13KB 7.95KB
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) 545.50KB 130.49KB
core (index.js) 9.22KB 3.71KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 223.91KB 62.28KB
fields (index.js) 257.41KB 65.16KB
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.40KB 12.91KB
i18n (useDisplayLocale.js) 3.52KB 1.76KB
i18n (useObjectLabel.js) 34.34KB 9.17KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 39.28KB 11.09KB
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.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.01KB 3.93KB
plugin-calendar (index.js) 51.38KB 14.60KB
plugin-charts (index.js) 74.95KB 20.88KB
plugin-chatbot (index.js) 198.36KB 47.20KB
plugin-dashboard (index.js) 133.50KB 35.37KB
plugin-designer (index.js) 216.25KB 44.39KB
plugin-detail (index.js) 232.25KB 61.40KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 146.50KB 37.51KB
plugin-gantt (index.js) 169.64KB 41.92KB
plugin-grid (index.js) 215.37KB 58.92KB
plugin-kanban (index.js) 49.30KB 15.39KB
plugin-list (index.js) 114.43KB 28.26KB
plugin-map (index.js) 23.82KB 7.42KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 43.55KB 11.99KB
plugin-timeline (index.js) 30.64KB 8.94KB
plugin-tree (index.js) 10.52KB 3.69KB
plugin-view (index.js) 87.31KB 21.78KB
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) 114.58KB 37.60KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.03KB 1.86KB
react (schema-input.js) 4.25KB 2.04KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (body-dialect.js) 4.78KB 2.09KB
sdui-parser (codegen.js) 6.58KB 2.74KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 5.78KB 2.56KB
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) 18.27KB 6.20KB
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

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 735c9ed5724df24b64f855330b2951e59d536e92

Reviewed against merge-base 0d5d66aee7ec565be12ae3bee218dc02e8af9531; main at review time fee1da5953bef4678168be546bffd46c67631fdf. Diff: 3 files, +198 / -6 (apps/console/src/components/FormPage.tsx +44/-6; new apps/console/src/components/FormPage.widgetDegrade-10472.test.tsx +135; new .changeset/10472-formpage-widget-degrades-to-type.md +19). Read via git show refs/review/pr-10553:PATH; the shared tree and the sibling worktrees were not checked out or edited. Zero GitHub writes.

① Derived judgments

The binding text. Installed @objectstack/spec@17.4.0 (dist/ui/index.js, the widget describe on FieldSchema, with the tag-shaped placeholder spelled WIDGET here): "Form widget override — names a registered field component (resolved as field:WIDGET) to render this field instead of the type default. Degrades to the type renderer when unregistered." Its JSDoc adds "Unknown/unregistered values fall back to the type renderer, so it degrades safely" and names form.tsx as the honouring consumer. Card: "The shape of the fix: an unregistered widget falls through to the type leg of the same resolver. ⛔ Not a local list of known widgets." Triage (5828139551): "an unregistered widget falls through to the type leg of the same resolver; ⛔ not a local list of known widgets. Measure the record form (form.tsx) in the same round."

  1. Guard flip — FormPage.tsx:685-687 (head). Merge-base :649 was if (field.widget) return resolveFormWidgetType(field.widget);. Head reads if (field.widget && namesRegisteredWidget(field.widget)) { return resolveFormWidgetType(field.widget); }, and on a false predicate control reaches the arity leg (:688-693) and the type leg (:694) of the same function. RIGHT: this is literally the card's "falls through to the type leg of the same resolver".

  2. The predicate — FormPage.tsx:652-654, sentinel UNKNOWN_SPELLING_WIDGET = 'text' at :630. resolveFormWidgetType(widget) !== 'text' || widget === 'text'. Traced against the resolver at packages/fields/src/index.tsx:3896-3905 (head): it answers (a) the spelling itself when it is a fieldWidgetMap key, (b) the spelling itself when RETIRED_FIELD_TYPES holds it, (c) the field:-stripped alias target when that is a map key, else (d) the literal 'text'. So 'text' comes back only from widget === 'text' (case a, kept by the second disjunct), from an alias whose target is text (none exist: the table at packages/fields/src/field-type-alias.ts:104-200 maps only text to field:text, and every other target — password, slider, boolean, lookup, file, code, object, grid, auto_number, and the rest — is present in the fieldWidgetMap key set I listed from index.tsx:3785-3862), or from the unknown tail (d). The predicate is therefore exactly "the shared resolver knows this spelling", with no widget list: RIGHT against the card's ⛔. Coupling note, not a defect: the sentinel restates the resolver's documented fallback string; should a future alias ever target field:text, that alias would degrade to type here, which the describe ("names a registered field component") still permits.

  3. Retired spelling. widget: 'owner': resolver case (b) answers 'owner', predicate true, key 'owner', and getLazyFieldWidget returns RetiredFieldTombstone (index.tsx:3936). RIGHT: the tombstone is preserved, and control pin 2 (below) proves it. The field:-qualified spellings take a different path: isRetiredFieldType (packages/core/src/utils/retired-field-types.ts, hasOwnProperty on the exact spelling) strips no prefix, and mapFieldTypeToFormType('field:owner') misses the type map and the retired gate and returns field:text, so the resolver answers 'text', the predicate is false, and the row degrades to its type. After the PR widget: 'field:owner' on a user row mounts the user picker (before: a text input) and widget: 'field:textarea' on a textarea row mounts the textarea (before: a text input). Neither refused before, neither refuses after: no guard existed on this seam to weaken. Consistent with the describe; the tombstone prescription's sentence "The widget: 'field:owner' spelling is retired with it" was never honoured by this resolver chain, which is a pre-existing gap the PR body records under H4 and not this card's ask.

  4. Docblock edits — FormPage.tsx:107-113 (header) and :656-679 (resolver steps). The prose now says an authored widget wins "when it names a registered widget" and otherwise degrades to the type renderer per FieldSchema.widget. TRUE against :685-694. The namesRegisteredWidget docblock (:632-651) says a spelling answered with text that the author did not write as text "named nothing", and that a registered key, a retired spelling and an alias of a registered key keep resolving: TRUE by item 2. Its opening question "name a widget the shared registry holds" is loose for the retired case (the map holds no owner; the docblock itself carves out the tombstone) — style, not a defect.

  5. Both callers agree. rowLabelProps (:1686) and FieldInput (:1805) call the same resolveFieldWidgetKey, so label association and the mounted widget cannot name different widgets after the flip. The widget leg now evaluates the resolver twice on a hit (predicate, then return); both calls are pure except the once-per-spelling retired reporter, which case (b) short-circuits before mapFieldTypeToFormType, so nothing is reported twice.

  6. Nothing done that was not asked. Three files, all inside the surface the card names; no list of widgets; no change to packages/fields, packages/core, form.tsx, or any barrel.

  7. Nothing asked is missing. The card's fix shape is met (items 1-2). The triage's "Measure the record form (form.tsx) in the same round" is answered in the PR body (same symptom, not changed) and is consistent with source: packages/components/src/renderers/form/form.tsx:354 (f?.widget || f?.field?.widget || f?.type), :1914 ((f as any).widget || f.type), :2726 (widget || fieldProps.field?.widget || type), and the unregistered branch's own spelling table at :3522-3525 (secret and ui:password answer password, the objectui#5322 / objectui#5375 rulings). So the record form still breaches the same describe, and the spec JSDoc names it as the consumer; that is a real remaining breach that needs its own card, not a defect of this PR, whose card scopes the site to resolveFieldWidgetKey.

  8. Existing pins edited or deleted: none. No existing test file is in the diff. The sibling pins that read the widget leg survive by construction: FormPage.sharedFieldResolver-10179.test.tsx:170-175 (widget: 'text' on a select answers text) is kept by the widget === 'text' disjunct; :153-166 (object-ref, filter-condition, recipient-picker) are map keys; :178-183 (view beats object) reads precedence, not the predicate. No guard weakened.

  9. New pins can fail. FormPage.widgetDegrade-10472.test.tsx, real widgets (no getLazyFieldWidget stub), the same fetch-stub shape as FormPage.retiredFieldType-10176.test.tsx:88-125, the same sonner mock as FormPage.sharedWidgets-10179.test.tsx:44, beside the existing FormPage tests as required.

    • Pin 1 (:95-99, object field) and pin 2 (:101-108, form-view field), the card's two reproductions: positive leg findByRole('combobox', { name: 'Stage' }), negative leg queryByRole('textbox', { name: 'Stage' }) is null. At merge-base the row mounts TextField (a textbox) and no combobox, so the positive leg goes red. The combobox is reachable by label because select is labelled 'control' (FIELD_WIDGET_LABELLING) and SelectTrigger spreads the DOM id (SelectField.tsx:184,200).
    • Control 1 (:110-115): widget: 'radio' on the same select expects a radiogroup and no combobox and no textbox. A change that ignored widget, or a predicate that always answers false, mounts the select instead: red. Lit.
    • Control 2 (:117-134): widget: 'owner' on a user row expects the tombstone and zero input, button, [role="combobox"] inside the row. A predicate answering false mounts UserField (a lookup trigger button): red. Lit, and it carries its own negative leg.
    • Not executed by this seat (read-only review); the run is CI's, see ③.
  10. Pre-existing, not introduced: resolveFormWidgetType indexes fieldWidgetLoaderByKey by plain property read (index.tsx:3897), so widget: 'constructor' resolved to itself before the PR and still does. Out of scope.

② Semver level

  • .changeset/10472-formpage-widget-degrades-to-type.md:1-3 declares '@object-ui/console': patch. apps/console/src/components/FormPage.tsx is published executable src/ of a fixed-group package (.changeset/config.json lists @object-ui/console; AGENTS.md's changeset-presence rule owes a changeset for any such src/ change), so a non-empty changeset is owed and present. Not major (版本号策略: never major in this repo). A behaviour correction toward the declared describe, with no exported surface change, is patch: RIGHT. This is not a content/docs/**-only change, so the empty-frontmatter rule does not apply. CI Changeset Declaration, Changeset Bump Policy and Changeset Fixed Group Check are success at the head.
  • Changeset prose, sentence by sentence (:5-19):
    1. Title "a FormPage field whose widget names nothing registered renders its type, not a text box" — TRUE (FormPage.tsx:685-694, pins 1-2).
    2. "The spec's FieldSchema.widget declares that the override names a registered field component and 'Degrades to the type renderer when unregistered'." — TRUE, verbatim from the installed 17.4.0 describe.
    3. "FormPage took an authored widget whenever one was present and handed it to resolveFormWidgetType" — TRUE (merge-base :649).
    4. "which answers a spelling nothing registers with the text widget." — TRUE (index.tsx:3905).
    5. "So a select field carrying a widget that no widget is registered under (on the object field or on the form view) rendered a free-text input, and the user could type a value the picklist never offered." — TRUE: TextField is the text widget, and both authored places reach the one resolver.
    6. "The widget leg now asks the same shared resolver whether the spelling names anything, and falls through to the arity and type legs when it does not." — TRUE (:652-654, :685-694).
    7. "The select renders its select." — TRUE (pins 1-2).
    8. "A registered widget still wins over the type," — TRUE (control 1).
    9. "a retired spelling still reaches its tombstone," — TRUE for the resolver's retired spelling owner (control 2); the sentence makes no claim about the field:-qualified spelling, which never reached the tombstone on this seam (①.3).
    10. "and an alias the resolver knows keeps resolving as before." — TRUE: no alias target in mapFieldTypeToFormType's table is text, so no known alias is answered 'text' (①.2).
    11. "No list of widgets was added: the answer is the resolver's own." — TRUE: one sentinel constant, no key list.
  • Docs or README prose added by the diff: none. The FormPage.tsx docblock additions are judged TRUE in ①.4.

③ Boundary flags

  • PR body's own flags. (a) The pending .changeset/10179-formpage-shared-field-resolver.md sentence "An authored widget wins over type" is present at head; it is unreleased, publishes beside this changeset, and this changeset's text refines it. Leaving it unedited is within the claimed surface and the two read together do not contradict. (b) FormPage resolves alias spellings in widget (json to code, secret to password) where the record form's unregistered branch knows only its own secret table: a pre-existing divergence, recorded and not decided; not this card. (c) H3, form.tsx not changed: see ①.7, the measurement is consistent with source and the remaining breach there needs its own card. (d) H4, field:-qualified spellings: see ①.3. The PR lists no open questions.
  • CI at head 735c9ed5…: 42 check-runs. First read (started 08:36Z): 28 success, 3 skipped, 11 in progress. Re-poll 1 at 08:44:54Z: 31 success, 3 skipped, 8 in progress. Re-poll 2 at 08:47:50Z: 35 success, 3 skipped (Test (coverage), Test (coverage shard …/4), dependabot), 4 in progress (Test (shard 1/8), Test (shard 4/8), Test (shard 5/8), Spec Main Shape Gate), 0 failure, 0 cancelled. Type Check, Lint, Test (dist pins), Build & E2E, Line Citation Gate, Inert vi.mock Specifier Check, Governed Surface Queue Guard and the three changeset gates are success. The re-poll budget is spent; the four shards were still running when this record closed.
  • Draft: yes, the PR is a draft.
  • Clause-②: no — holds. FormPage.tsx's export list is identical at merge-base and head; namesRegisteredWidget and resolveFieldWidgetKey are module-private; no package.json, barrel, spec or types file moves. Accept set: widget accepted any string before (rendered text) and accepts any string after (renders the type); no new refusal, no removed acceptance.
  • Did main move under the PR's files? No. origin/main advanced 7 commits from merge-base 0d5d66a to fee1da5 while the head is behind (mergeable: true, mergeable_state: behind); git log of that range over the three PR paths is empty.
  • Line-address citations in added lines: none (Line Citation Gate success). Angle-bracket fragments in the changeset: none.

Implemented-by: claude/issue-10472-formpage-widget-degrade
Reviewed-by: session_01KUxVUa7e39aNjhkKi1gsoy

VERDICT: PASS

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review September 25, 2026 08:55
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit 4f74cd5 Sep 25, 2026
45 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-10472-formpage-widget-degrade branch September 25, 2026 09:07
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(console): FormPage degrades an unregistered widget to a text input, where the spec declares it degrades to the field's type renderer

2 participants