Skip to content

showcase: ContactViews is exported but never registered in objectstack.config.ts — the docs' canonical "create form ≠ edit form" example does not run #5420

Closed

Description

@baozhoutao

examples/app-showcase/src/ui/views/contact.view.ts declares ContactViews
(default grouped edit form with four named sections + a sparse
formViews.create + the addRecord: { mode: 'form', formView: 'create' }
binding on the list). src/ui/views/index.ts re-exports it.

examples/app-showcase/objectstack.config.ts does not:

line 23:  import { TaskViews, ProjectViews, InquiryViews, BusinessUnitViews } from './src/ui/views/index.js';
line 196: views: [TaskViews, ProjectViews, InquiryViews, BusinessUnitViews],

ContactViews is in the barrel and missing from both the import list and the
views array. There is no directory-scan auto-registration for views (the CLI
reads the config's views array; nothing in packages/cli/src globs
src/ui/views), so the container never reaches the stack.

Why it matters

  • The app DOES navigate to the object: src/ui/apps/index.ts:53 ships
    { 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 "create
    entry 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:106 links this exact file as the
    live reference implementation ("full edit form + sparse formViews.create +
    addRecord binding"). Prime Directive chore: version packages #10's corollary — never advertise a
    capability the runtime does not actually deliver — is the rule being bent
    here: the metadata is correct, it just isn't wired in.
  • Every static pass over the showcase stack (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 the
declaration only.

Suggested fix

Add ContactViews to the import on line 23 and to views: on line 196, then
re-run the showcase's pnpm verify — the object nav's list/form will start
rendering the authored container, which is also what makes the four named
form.sections reachable to the i18n walker and the reference validator.

Found while implementing #5415 (out of scope there: that PR is packages/lint
only, and its fixture imports the view module directly, so the fix does not
depend on the showcase registration). Verified against origin/main
9fad07f66.

Activity

  1. baozhoutao commented on Aug 5, 2026

    @baozhoutao
    ContributorAuthor

    独立复现确认(来自 #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 加了 section kind 之后,这四个段落标题本应作为 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

  2. added
    bugSomething isn't working
    pm:queueReady for the PM dispatch loop
    domain:cliRetired 2026-10-22, alias of domain:server (cli surface); in-flight cards keep it until they land
    on Aug 5, 2026
  3. baozhoutao commented on Aug 5, 2026

    @baozhoutao
    ContributorAuthor

    分诊(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 已知陷阱,勿在解除前认领):

    1. 须待 PR fix(cli): i18n 覆盖走查收集 objects.*._sections —— 段落标题不再是「声明了、渲染了、却零告警」的面 (#5405) #5416(cli: the i18n coverage walker never collects objects.<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 完全相同的棘轮红;
    2. 文件面与 fix(cli): i18n 覆盖走查收集 objects.*._sections —— 段落标题不再是「声明了、渲染了、却零告警」的面 (#5405) #5416 返工相交(examples/app-showcase/** 翻译 bundle),不同批。

    派发时把 #5416 返工 commit 与本注记写进派发词。


    Generated by Claude Code

  4. self-assigned this
    on Aug 5, 2026
  5. baozhoutao commented on Aug 5, 2026

    @baozhoutao
    ContributorAuthor

    认领: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 已 MERGED 123067ce,其 rework commit e3d1e855c 的译文体例即本单范本)

    执行口径沿 11:0xZ 分诊注记:注册 ContactViews 进 config views;同一 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

  6. baozhoutao commented on Aug 5, 2026

    @baozhoutao
    ContributorAuthor

    验收(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 无 fieldGroups vs 文档参考实现注释自述「可省略自动派生」,两者相反)已立案待分诊;_views translation keys have three producers that disagree on the spelling — a default-only list container can never resolve #5164 追加了 _views.list 两规则打架的第 5 个实例与产生点 —— 均为有价值输入。
    • CI 22 项全绿(PM 亲核)。转 ready 挂 auto-merge,跟到 MERGED。

    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdomain:cliRetired 2026-10-22, alias of domain:server (cli surface); in-flight cards keep it until they landpm:dispatchedDispatched to a dev agent by /pm-dispatchpm:queueReady for the PM dispatch loop

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions