You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
os lint examples/app-showcase/objectstack.config.ts 与 objectstack validate 都报九条,规则 field-group-undeclared,showcase 里只有这一个对象中招:
⚠ object "showcase_contact": showcase_contact.name: group "contact" is not declared in
fieldGroups — the field renders in the ungrouped bucket, not under "contact"
field-group-undeclared at objects[5].fields.name.group
… 同样的 9 条,覆盖 name/email/phone/company/title/account/stage/lead_score/notes
form (default edit/detail) — the FULL record, grouped into sections by each field's group. This mirrors what the platform auto-derives from field.group; it is written out explicitly here only so the example is legible. In the target model you can OMIT it and get an equivalent grouped form for free.
lint 说的恰好相反:group 没在 fieldGroups 里声明,字段落进未分组桶,那个「免费的等价分组表单」并不存在。也就是说,读者照着这份 canonical 示例学、真的把 form 省掉,拿到的是一张平铺表单 —— 属于 Prime Directive #10 的推论(不要宣传运行时并不提供的能力),只不过这次说谎的是示例自己的注释。
在 #5420 / PR #5438(把
ContactViews注册进 showcase 的views:)期间发现,超出该单范围,单独记录。已在origin/main123067ce7上核对,与那条注册无关 —— 注册前后os lint的这九条数量完全不变。现象
os lint examples/app-showcase/objectstack.config.ts与objectstack validate都报九条,规则field-group-undeclared,showcase 里只有这一个对象中招:examples/app-showcase/src/data/objects/contact.object.ts的九个字段都写了group: 'contact' | 'work' | 'status' | 'notes',而该对象没有声明fieldGroups。为什么值得单独修
examples/app-showcase/src/ui/views/contact.view.ts的头注释,正是content/docs/ui/create-vs-edit-form.mdx引用的那份参考实现,原文写着(节选):lint 说的恰好相反:group 没在
fieldGroups里声明,字段落进未分组桶,那个「免费的等价分组表单」并不存在。也就是说,读者照着这份 canonical 示例学、真的把form省掉,拿到的是一张平铺表单 —— 属于 Prime Directive #10 的推论(不要宣传运行时并不提供的能力),只不过这次说谎的是示例自己的注释。#5420 落地后这条更要紧了:注册之前这个视图族根本不进栈,谁也走不到;现在
nav_contacts会真的渲染它。两个方向(需要判定,不要顺手选一个)
showcase_contact补fieldGroups(contact/work/status/notes 四个 key + label)。九条告警消失,注释的承诺变成真的。注意副作用:i18n-extract的deriveFieldGroupLayout分支随之开始产出objects.showcase_contact._sections.*—— 键名与 PR fix(showcase): 注册ContactViews—— 文档引用的「create form ≠ edit form」参考实现终于真的进栈 (#5420) #5438 已经翻译过的那四个完全相同(contact/work/status/notes),所以覆盖棘轮预期不变,但值得实测确认而不是推定。fieldGroups时才推导分组,field.group单独存在不足以成组。方向 1 更贴近示例应有的样子(示例就该是能照抄的),但它默认了「
fieldGroups才是自动分组的授权来源」这个语义确实是平台想要的 —— 这属于 ADR-0085 的地盘,请维护者定。复现