Uh oh!
There was an error while loading. Please reload this page.
test(fields): pin 'user' in FORM_WIDGET_TYPES to close one-way blindness - #5277
Merged
Merged
Conversation
field-type-coverage.test.ts asserts CELL_RENDERER_TYPES includes 'user' but FORM_WIDGET_TYPES did not, so deleting the user: 'field:user' alias in field-type-alias.ts made only the cell half red while the form half silently fell back to field:text via the `|| 'field:text'` tail. Fixes#4855
Part of #4855 — test-only change to field-type-coverage.test.ts; no published behaviour changes.
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-support-ai
marked this pull request as ready for review
August 19, 2026 00:11
Uh oh!
There was an error while loading. Please reload this page.
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.
Fixes#4855
What
packages/fields/src/field-type-coverage.test.tsis the regression guard forthe field-type to renderer mapping tables. It pins two lists — one for the form
half (
FORM_WIDGET_TYPES, viamapFieldTypeToFormType) and one for the cell/read half (
CELL_RENDERER_TYPES, viagetCellRenderer).CELL_RENDERER_TYPESalready pinned
'user';FORM_WIDGET_TYPESdid not. That asymmetry meantdeleting
user: 'field:user'fromfield-type-alias.tswould make only thecell half of the guard go red, while the form half silently fell back to
field:textviamapFieldTypeToFormType's|| 'field:text'tail — the exactone-way blindness the guard's own header says it exists to prevent.
Adds
'user'toFORM_WIDGET_TYPES(one line).owneris intentionally leftout — it was already retired (#4814 ruling A′; tombstone at
field-type-alias.ts:74-81), and re-adding it toFORM_WIDGET_TYPESwouldreassert a retired key and contradict the opposite-direction pin in
__tests__/owner-retired.test.tsx.Reverse verification (the point of this card)
Prediction (before running):
getCellRenderer('user')resolves through anindependent registration (
registerFieldRenderer('user', UserCellRenderer)inindex.tsx, plus a literal map entry), which never consultsfield-type-alias.ts'stypeMap. So deletinguser: 'field:user'fromfield-type-alias.tsshould turn only the newly-added form-half assertion red— the cell half (already pinned) should stay green, since it never depended on
this alias table.
Observed: with
user: 'field:user'deleted and the fix applied, exactly 1test failed —
— matching the prediction: only the form-half
'user'assertion went red;all 87 others, including the cell-half
'user'test, stayed green. The aliasline was restored immediately after (
git checkout -- packages/fields/src/field-type-alias.ts),confirmed clean via
git status/git diff --stat.Scope
File surface:
packages/fields/src/field-type-coverage.test.tsonly (plus anempty-frontmatter changeset, confirmed required by
node scripts/check-changeset-presence.mjs).field-type-alias.tswas readand temporarily mutated only for the ablation above, then restored — it ships
unchanged.
Tests
All run from the repo root, all against HEAD
07d895cfd:pnpm exec vitest run packages/fields/src/field-type-coverage.test.ts— 88/88 passed.pnpm exec vitest run packages/fields/(full package suite, exercisesowner-retired.test.tsxalongside this change) — 107 files / 1802 tests, all passed.pnpm --filter '@object-ui/fields^...' build(dependency closure — required before type-check, otherwise stale/missingdistgives falseTS2307"cannot find module" errors unrelated to this change)pnpm --filter @object-ui/fields type-check— clean.pnpm --filter @object-ui/fields lint— 0 errors, 839 pre-existing warnings (none touchfield-type-coverage.test.tsor the changeset).node scripts/check-control-bytes.mjs— OK.node scripts/check-changeset-presence.mjs— OK (declares the empty-frontmatter changeset above).Generated by Claude Code
Generated by Claude Code