fix(form): spec-vocabulary fields stop crashing the standalone form; every surface names the boundary (#3090 PR2) - #3092
Merged
Conversation
…every surface names the boundary (#3090) Writing the regression test against the unfixed renderer proved the failure was worse than the assumed silent drop: a { field: 'x' } entry (spec form-VIEW vocabulary) slipped past the f?.name guards into a react-hook-form Controller with name === undefined and crashed the WHOLE standalone form on name.split('.'), with nothing naming the culprit. The renderer now partitions such entries out — the rest of the form renders — and surfaces them: an inline alert naming the fields, plus a console.error whose text is the fix instruction an iterating agent will actually follow. objectui validate grows the same boundary awareness: on failure a directed "likely cause" hint replaces the bare invalid_union for spec-shaped entries (the old message read as "bolt a name on", which converts spec metadata wrongly); on success, mixed-vocabulary entries get a warning that the spec key is dead weight. normalizeSectionField warns once per site on mixed identity keys, where the authored name was silently overwritten. Detector precision is pinned by tests: section fields (object-form) legitimately accept the spec shape, and a runtime field's `field` key legitimately holds the resolved metadata OBJECT — only a STRING field without a name marks the boundary violation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This was referenced Jul 31, 2026
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 free
to 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.
#3090 的 PR2(边界响亮化)。写复现测试时把预设推翻了一次:spec 形态条目在独立表单里不是静默消失,是把整个表单弄崩 ——
{ field: 'owner' }溜过各处f?.name守卫、进到 react-hook-form Controller 时name === undefined,name.split('.')TypeError 崩掉全表,且没有任何信息指向肇事条目。1. 独立表单渲染器(components)
把 spec 形态条目从渲染列表剔除(其余字段照常渲染,不再全表崩),同时:
data-testid="form-spec-vocabulary-error")console.error的文案就是修复指令 —— 这是迭代元数据的 agent 实际会读并执行的东西:改name,或用 object-bound form(sections 走枢纽翻译)name+ stringfield)→console.warn,按name渲染field槽合法地装着解析后的元数据对象,只有 stringfield且无name才标记违例2.
objectui validate(cli)实测原始报错只有
Invalid input / invalid_union(union 坍缩)—— 或在非 union 上下文里是name: expected string,读起来像「补个 name」,会把 spec 元数据改坏(裸改名丢掉对象 schema 合并语义)。现在:findSpecVocabularyFormFields是纯函数,精度即要点:只扫type: 'form'直挂的fields;object-form 的sections[].fields[]合法接受 spec 形态,不报已用真实 CLI dist 对两个 fixture 冒烟验证,两分支输出如设计。
3.
normalizeSectionField(plugin-form)分区路径的混合词汇 lint:spec 分支从
field推导 runtime name,作者写的name被静默覆盖 —— 现在每站点一次console.warn说明谁赢了、该删哪个。验证
Closes 部分 #3090(PR2 复选框)。
🤖 Generated with Claude Code