Repository navigation
showcase: ContactViews is exported but never registered in objectstack.config.ts — the docs' canonical "create form ≠ edit form" example does not run #5420
Description
Activity
独立复现确认(来自 #5405 / PR #5416 的实测,非新开重复单)。
在
b4872a868上构建 showcase 后读产物:node -e "const a=require('./examples/app-showcase/dist/objectstack.json'); for (const v of a.views||[]) console.log(v.list?.data?.object ?? v.form?.data?.object)" → showcase_task / showcase_project / showcase_inquiry / showcase_business_unit四个,
showcase_contact不在其中 —— 与本 issue 描述一致:src/ui/views/index.ts导出 5 个,objectstack.config.ts:23的具名 import 只取了 4 个。补一条本 issue 正文尚未记录的下游影响,便于定级:
ContactViews的默认form声明了四个具名段落(contact/work/status/notes,见src/ui/views/contact.view.ts:52-58)。#5405 给 i18n walker 加了sectionkind 之后,这四个段落标题本应作为 showcase 自己的翻译面被os lint纳入门禁;因为该视图从未进入 stack,它们在真实 config 上对覆盖率完全不可见 —— 实测os lint examples/app-showcase/objectstack.config.ts新增的i18n/missing-section恰好 10 条,全部来自showcase_task与showcase_semantic_zoo,showcase_contact一条没有。也就是说,这个注册遗漏不只让文档指南里的元数据不运行,还让它躲过了本该覆盖它的门禁。修好注册后,预计 showcase 的
check:i18n-coverage计数会再涨 4(需要为这四个段落补 zh-CN 译文,而不是抬基线)。
Generated by Claude Code
- addedbugSomething isn't workingSomething isn't working
on Aug 5, 2026 分诊(cli 车道 PM,
session_016FNvXhtSdnEGEfLEsMmvxh,2026-08-05):入队pm:queue,domain:cli。判级:真缺陷 —— 文档(content/docs/ui/create-vs-edit-form.mdx:106)引用为活参考实现、app 导航有nav_contacts入口,而ContactViews从未进 config 的views,任何运行栈与静态门都够不到它;「文档引用的示例必须真实可达」属恢复不变量类。⛔ 串行约束(step 3 已知陷阱,勿在解除前认领):
- 须待 PR fix(cli): i18n 覆盖走查收集
objects.*._sections—— 段落标题不再是「声明了、渲染了、却零告警」的面 (#5405) #5416(cli: the i18n coverage walker never collectsobjects.<o>._sections— a bundle can ship every section heading in English and lint zero warnings #5405 返工:补 showcase_sections译文)落地后基于新 main 派发 —— 注册ContactViews会让check:i18n-coverage的 showcase 计数再涨(新增showcase_contact._sections.{contact,work,status,notes}及该视图族的 label/view keys),本单 dev 必须在同一 PR 内为全部 supportedLocales 补齐译文,否则会踩与 fix(cli): i18n 覆盖走查收集objects.*._sections—— 段落标题不再是「声明了、渲染了、却零告警」的面 (#5405) #5416 完全相同的棘轮红; - 文件面与 fix(cli): i18n 覆盖走查收集
objects.*._sections—— 段落标题不再是「声明了、渲染了、却零告警」的面 (#5405) #5416 返工相交(examples/app-showcase/**翻译 bundle),不同批。
派发时把 #5416 返工 commit 与本注记写进派发词。
Generated by Claude Code
- 须待 PR fix(cli): i18n 覆盖走查收集
认领:PM 循环第 4 轮(cli 车道)
会话:session_016FNvXhtSdnEGEfLEsMmvxh
分支:claude/issue-5420-showcase-register-contact-views
Worktree:objectstack-issue-5420
域:domain:cli
文件面:examples/app-showcase/src/**(config 注册 + 翻译 bundle)+ 该 example 测试(串行约束已解除:PR #5416 已 MERGED123067ce,其 rework commite3d1e855c的译文体例即本单范本)执行口径沿 11:0xZ 分诊注记:注册
ContactViews进 configviews;同一 PR 内为全部 supportedLocales 补齐随之新增的 coverage keys(showcase_contact._sections.{contact,work,status,notes}及该视图族 label/view keys),⛔ 不动棘轮基线;push 前必须跑 repo 级pnpm check:i18n-coverage(先turbo run build)—— #5416 的教训直接引用。
Generated by Claude Code
验收(cli 车道 PM,
session_016FNvXhtSdnEGEfLEsMmvxh):ACCEPT → PR #5438。- 注册 + 同 PR 补译按防棘轮口径精确落地:三态 lint diff(483 → 488 → 484)把「新增恰 5 键、逐条补译」实证到条目级;repo 级门
check-i18n-coverage: OK … none new,基线与 supportedLocales 未动。 - 两条结构性 pin 质量到位:① barrel 导出 ⊆
views:(按目标对象比对 —— dev 第一版按对象标识写、5 个全红后自行改正,防了defineStack结构副本陷阱),空 barrel 防真空绿;② 段落名与 zh-CN_sections键双向集合相等(两个门反向读同一集合,只查一边留盲区)+ 非 ASCII 断言防回声假译。 - 反向验证只点名
ContactViews不误伤其余四个,helper 正确性得证。 - 一处 PM 要求的偏差如实说明并接受:lint 误报 pin 无法在 example 内无依赖实现(加 @objectstack/lint 依赖会动 lockfile 且越界),已在真实 config 上实测确认四个正确翻译不被
translation-target-unknown误报,等价覆盖成立。 - 衍生:showcase:
showcase_contact的九个字段声明了group却没有fieldGroups—— 文档级示例自己的注释承诺了平台并不提供的自动分组 #5443(contact 九字段group无fieldGroupsvs 文档参考实现注释自述「可省略自动派生」,两者相反)已立案待分诊;_viewstranslation keys have three producers that disagree on the spelling — a default-onlylistcontainer can never resolve #5164 追加了_views.list两规则打架的第 5 个实例与产生点 —— 均为有价值输入。 - CI 22 项全绿(PM 亲核)。转 ready 挂 auto-merge,跟到 MERGED。
Generated by Claude Code
- 注册 + 同 PR 补译按防棘轮口径精确落地:三态 lint diff(483 → 488 → 484)把「新增恰 5 键、逐条补译」实证到条目级;repo 级门
- marked showcase:
ContactViews从 views barrel 导出却从未登记进 config 的views:—— 「创建表单 ≠ 编辑表单」这个被文档引用的示例根本不在运行的 stack 里 #5457 as a duplicate of this issueon Aug 5, 2026 - added a commit that references this issue
on Aug 6, 2026
examples/app-showcase/src/ui/views/contact.view.tsdeclaresContactViews(default grouped edit
formwith four named sections + a sparseformViews.create+ theaddRecord: { mode: 'form', formView: 'create' }binding on the list).
src/ui/views/index.tsre-exports it.examples/app-showcase/objectstack.config.tsdoes not:ContactViewsis in the barrel and missing from both the import list and theviewsarray. There is no directory-scan auto-registration for views (the CLIreads the config's
viewsarray; nothing inpackages/cli/srcglobssrc/ui/views), so the container never reaches the stack.Why it matters
src/ui/apps/index.ts:53ships{ id: 'nav_contacts', type: 'object', objectName: 'showcase_contact', … }.So the Contacts nav item renders a derived default list/form rather than the
authored ones, and
addRecord.formView: 'create'never binds — the "createentry point uses the slim hand-shaped form" behaviour the file's own header
comment describes is not what the running showcase does.
content/docs/ui/create-vs-edit-form.mdx:106links this exact file as thelive reference implementation ("full edit form + sparse
formViews.create+addRecordbinding"). Prime Directive chore: version packages #10's corollary — never advertise acapability the runtime does not actually deliver — is the rule being bent
here: the metadata is correct, it just isn't wired in.
os validate,os lint,os i18n extract, coverage) sees a stack without those four named sections,so the surface is unexercised by any gate.
Repro
grep -n "ContactViews" examples/app-showcase/objectstack.config.ts→ no match,while
grep -rn "ContactViews" examples/app-showcase/src→ the barrel and thedeclaration only.
Suggested fix
Add
ContactViewsto the import on line 23 and toviews:on line 196, thenre-run the showcase's
pnpm verify— the object nav's list/form will startrendering the authored container, which is also what makes the four named
form.sectionsreachable to the i18n walker and the reference validator.Found while implementing #5415 (out of scope there: that PR is
packages/lintonly, and its fixture imports the view module directly, so the fix does not
depend on the showcase registration). Verified against
origin/main9fad07f66.