Summary
The ViewItemSchema is a discriminated union on viewKind with both list and form variants, but the create form can only produce list views. Form-family views are unreachable through the create UI.
Root cause — two problems in packages/app-shell/src/views/metadata-admin/anchors.ts:
Problem 1 (line 202): createFields: ['label', 'name', 'object', 'kind'] — no viewKind field. The kind field is a ListViewSchema.type value (grid/kanban/gallery/calendar/timeline/gantt/chart), not a family discriminator.
Problem 2 (lines 234-250): createBuildBody hardcodes viewKind: 'list' at line 242 and writes the kind draft value directly to config.type. There is no code path that produces a viewKind: 'form' ViewItem with a FormViewSchema config.
The spec (spec/src/ui/view.zod.ts, line 1111) defines a discriminated union on viewKind where form items carry FormViewSchema config with type enum ['simple','tabbed','wizard','split','drawer','modal'] (lines 815-822).
Steps to reproduce
- Navigate to Metadata → View → Create new
- There is no option to choose "List" vs "Form" as the view family
- All views created through the form are
viewKind: 'list'
Expected behavior
The create form should let users choose "List" or "Form" family, then offer the appropriate layout type per family (grid/kanban/... for list, simple/tabbed/... for form).
Fix
Add viewKind (enum: ['list','form']) and formType (enum from FormViewSchema.type) to createFields and createSchema. Update createBuildBody to discriminate on viewKind.
Impact
Users cannot create form-family views at all through the UI.
Summary
The
ViewItemSchemais a discriminated union onviewKindwith bothlistandformvariants, but the create form can only producelistviews. Form-family views are unreachable through the create UI.Root cause — two problems in
packages/app-shell/src/views/metadata-admin/anchors.ts:Problem 1 (line 202):
createFields: ['label', 'name', 'object', 'kind']— noviewKindfield. Thekindfield is aListViewSchema.typevalue (grid/kanban/gallery/calendar/timeline/gantt/chart), not a family discriminator.Problem 2 (lines 234-250):
createBuildBodyhardcodesviewKind: 'list'at line 242 and writes thekinddraft value directly toconfig.type. There is no code path that produces aviewKind: 'form'ViewItem with aFormViewSchemaconfig.The spec (
spec/src/ui/view.zod.ts, line 1111) defines a discriminated union onviewKindwhereformitems carryFormViewSchemaconfig with type enum['simple','tabbed','wizard','split','drawer','modal'](lines 815-822).Steps to reproduce
viewKind: 'list'Expected behavior
The create form should let users choose "List" or "Form" family, then offer the appropriate layout type per family (grid/kanban/... for list, simple/tabbed/... for form).
Fix
Add
viewKind(enum:['list','form']) andformType(enum fromFormViewSchema.type) tocreateFieldsandcreateSchema. UpdatecreateBuildBodyto discriminate onviewKind.Impact
Users cannot create form-family views at all through the UI.