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

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

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions