Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/interface-form-sourceview-picker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@objectstack/spec": patch
---

ui(page.form): sourceView is a view picker; hide template on list pages

- `interfaceConfig.sourceView` now declares `widget: 'view-ref'` + `dependsOn: 'source'` so the page editor renders a dropdown of the source object's views instead of a free-text input (where an author could type a non-existent view name). The objectui `view-ref` widget reads the source object's views; until it ships, the field degrades to the existing text input.
- The `template` field is now hidden for `type == 'list'` (`visibleOn: "data.type != 'list'"`). A list/interface page renders via InterfaceListPage and ignores the region template, so showing the field only added noise — same rationale as the already-hidden Data Context / Layout sections.
8 changes: 6 additions & 2 deletions packages/spec/src/ui/page.form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export const pageForm = defineForm({
],
helpText: 'Page kind. "List / Interface" binds a source view into a curated surface — how it looks (grid / kanban / calendar / …) is a visualization set under Interface, not a page type.',
},
{ field: 'template', colSpan: 2, helpText: 'Layout template (e.g., "header-sidebar-main")' },
// A list/interface page renders via InterfaceListPage and ignores the
// region template, so hide it there (same rationale as Data Context / Layout).
{ field: 'template', colSpan: 2, visibleOn: "data.type != 'list'", helpText: 'Layout template (e.g., "header-sidebar-main")' },
{ field: 'description', widget: 'textarea', colSpan: 2, helpText: 'Page description for navigation' },
],
},
Expand Down Expand Up @@ -86,7 +88,9 @@ export const pageForm = defineForm({
// Keep this list in sync with InterfacePageConfigSchema.
fields: [
{ field: 'source', widget: 'ref:object', helpText: 'Object this list reads from' },
{ field: 'sourceView', helpText: 'Named list view to inherit columns/filter/sort from (blank = object default)' },
// Pick from the source object's views instead of typing a name.
// `dependsOn: 'source'` tells the picker which object's views to list.
{ field: 'sourceView', widget: 'view-ref', dependsOn: 'source', helpText: 'Named list view to inherit columns/filter/sort from (blank = object default)' },
{ field: 'appearance', type: 'composite', helpText: 'Allowed visualizations (Grid / Kanban / Calendar / …) and description visibility' },
{
field: 'userFilters',
Expand Down