Skip to content

Commit 707aeed

Browse files
xuyushun441-sysos-zhuangclaude
authored
fix(spec): sourceView view picker + hide template on list pages (ADR-0047) (#1836)
interfaceConfig.sourceView gets widget:'view-ref' + dependsOn:'source' so the page editor offers a dropdown of the source object's views instead of a free-text name the author can mistype (objectui ships the view-ref widget; degrades to text until then). The template field is hidden for type=='list' since interface pages render via InterfaceListPage and ignore the region template — same rationale as the already-hidden Data Context / Layout sections. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3337cf5 commit 707aeed

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@objectstack/spec": patch
3+
---
4+
5+
ui(page.form): sourceView is a view picker; hide template on list pages
6+
7+
- `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.
8+
- 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.

packages/spec/src/ui/page.form.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export const pageForm = defineForm({
3737
],
3838
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.',
3939
},
40-
{ field: 'template', colSpan: 2, helpText: 'Layout template (e.g., "header-sidebar-main")' },
40+
// A list/interface page renders via InterfaceListPage and ignores the
41+
// region template, so hide it there (same rationale as Data Context / Layout).
42+
{ field: 'template', colSpan: 2, visibleOn: "data.type != 'list'", helpText: 'Layout template (e.g., "header-sidebar-main")' },
4143
{ field: 'description', widget: 'textarea', colSpan: 2, helpText: 'Page description for navigation' },
4244
],
4345
},
@@ -86,7 +88,9 @@ export const pageForm = defineForm({
8688
// Keep this list in sync with InterfacePageConfigSchema.
8789
fields: [
8890
{ field: 'source', widget: 'ref:object', helpText: 'Object this list reads from' },
89-
{ field: 'sourceView', helpText: 'Named list view to inherit columns/filter/sort from (blank = object default)' },
91+
// Pick from the source object's views instead of typing a name.
92+
// `dependsOn: 'source'` tells the picker which object's views to list.
93+
{ field: 'sourceView', widget: 'view-ref', dependsOn: 'source', helpText: 'Named list view to inherit columns/filter/sort from (blank = object default)' },
9094
{ field: 'appearance', type: 'composite', helpText: 'Allowed visualizations (Grid / Kanban / Calendar / …) and description visibility' },
9195
{
9296
field: 'userFilters',

0 commit comments

Comments
 (0)