From cdf4ef284167862691db4856685d75b1d5d2da53 Mon Sep 17 00:00:00 2001 From: os-zhuang Date: Sat, 20 Jun 2026 12:39:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(spec):=20interfaceConfig.recordAction=20?= =?UTF-8?q?=E2=80=94=20configure=20how=20a=20list=20opens=20a=20record?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds `recordAction: 'drawer' | 'page' | 'modal' | 'none'` to InterfacePageConfig and a select for it in the page form (under User actions). Lets the author choose how clicking a record opens its detail — right-side drawer (default), full-page navigate, modal, or not clickable. Pairs with the objectui runtime (InterfaceListPage wires the click → drawer / navigate / overlay accordingly). Co-Authored-By: Claude Opus 4.8 --- packages/spec/src/ui/page.form.ts | 10 ++++++++++ packages/spec/src/ui/page.zod.ts | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/packages/spec/src/ui/page.form.ts b/packages/spec/src/ui/page.form.ts index 94820688ef..76589a4b30 100644 --- a/packages/spec/src/ui/page.form.ts +++ b/packages/spec/src/ui/page.form.ts @@ -107,6 +107,16 @@ export const pageForm = defineForm({ { field: 'addRecord', type: 'composite', disclosure: 'popover', helpText: 'Add-record entry point' }, // Buttons ARE object actions — pick from the source object's actions. { field: 'buttons', widget: 'action-multi', dependsOn: 'source', helpText: "Toolbar buttons — pick from this object's actions" }, + { + field: 'recordAction', + options: [ + { label: 'Drawer (right-side peek)', value: 'drawer' }, + { label: 'Full page', value: 'page' }, + { label: 'Modal', value: 'modal' }, + { label: 'Not clickable', value: 'none' }, + ], + helpText: 'How clicking a record opens its detail', + }, { field: 'showRecordCount', helpText: 'Show the record count bar' }, { field: 'allowPrinting', helpText: 'Allow users to print this page' }, ], diff --git a/packages/spec/src/ui/page.zod.ts b/packages/spec/src/ui/page.zod.ts index 20c237d1fb..42c7ecbb3c 100644 --- a/packages/spec/src/ui/page.zod.ts +++ b/packages/spec/src/ui/page.zod.ts @@ -261,6 +261,12 @@ export const InterfacePageConfigSchema = lazySchema(() => z.object({ * Buttons ARE object actions (not free text): correct-by-construction. */ buttons: z.array(z.string()).optional().describe("Toolbar buttons — names of the source object's actions to surface in the page toolbar"), + /** How clicking a record opens its detail: 'drawer' (right-side peek panel, + * default), 'page' (full-page navigate to the record route), 'modal', or + * 'none' (rows not clickable). */ + recordAction: z.enum(['drawer', 'page', 'modal', 'none']).optional() + .describe("How clicking a record opens its detail (drawer | page | modal | none). Default: drawer"), + /** Record count */ showRecordCount: z.boolean().optional().describe('Show record count at page bottom'),