Repository navigation
fix(console): unwrap ExpandedViewItem envelope in FormPage internal loader - #2209
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Contributor
Author
|
追加一笔加固(8c68ee7):对着被 framework#2555 污染的真实服务器实测发现,runtime 个性化 overlay 行返回的是顶层展开的 raw config( |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…oader
GET /meta/view/<name> returns the flattened ExpandedViewItem shape
{ name, object, viewKind, label, config: { type, data, sections } } —
but loadInternalForm read sections/label off the envelope itself, so
every internal form rendered zero fields plus a bare Submit button
whose submit "succeeded" (an empty POST /data/<object>).
- extract resolveInternalForm(): unwraps { item } wrappers, the
ExpandedViewItem envelope, and legacy bare/{ item: { spec } } shapes;
label falls back envelope.label -> config.label -> view name; the
object target resolves from the envelope or the config data binding.
- reject non-form views (viewKind !== 'form') with an actionable error
instead of rendering the empty-form false positive — the failure mode
a list view reaching /forms/... produced (framework#2554 fallout).
- 6 new pure-function tests, payload mirroring the live server response.
Closes #2208
Co-Authored-By: Claude <noreply@anthropic.com>
Live repro against a #2555-polluted server: the runtime personalization overlay row comes back as a top-level raw config (type:'grid', no viewKind, no config envelope), so the envelope-only guard let it through and the empty-form false positive returned. Read viewKind wherever it sits and reject bare specs whose visualization type is not a form type. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Closes #2208
问题(HMR console 5181 + framework 3777 实测)
内部表单路由
/forms/<view>全部渲染成零字段 + 裸 Submit,且点击 Submit 会发空POST /data/<object>并误报成功。根因:
GET /meta/view/<name>返回的是展平 ExpandedViewItem 信封 ——{ name, object, viewKind, label, config: { type, data, sections } },真正的表单 spec 在config里;但loadInternalForm读的是item?.spec ?? item顶层的sections/label(信封上没有)→buildSections得到空数组。label 同理显示裸视图名。另外无
viewKind校验:list 视图进这条路由照样渲染空表单(framework#2554 key 冲突把 action target 解析到 list 视图时的表现)。修复
resolveInternalForm(name, viewBody):{ item }包装、ExpandedViewItem 信封(config才是 FormViewSpec)、legacy{ item: { spec } }/ 裸 spec 三种形状;object→config.data.object→ spec.object(裸 legacy spec 以前拿不到 object 直接报错,现在从 data 绑定解析);viewKind存在且非'form'时抛出可操作的错误("View X is a list view, not a form view — check the action or link that targets it"),不再空表单假成功。loadInternalForm改用该函数,其余(objectSchema 拉取、提交)不变。测试
resolveInternalForm用例(payload 取自 live server 实测响应):信封解包、{item}包装、label 回退、list 视图报错、裸 legacy spec、{item:{spec}}包装。@object-ui/console套件:5129 pass;唯一失败是packages/core的 DATEFORMAT 时区敏感测试,干净 main 上同样失败(本地非 UTC 时区所致),与本 PR 无关。pnpm --filter "@object-ui/console..." build全绿(含 tsc)。Co-Authored-By: Claude noreply@anthropic.com