Skip to content

Commit 123f971

Browse files
os-zhuangclaude
andauthored
feat(spec): interfaceConfig.recordAction — configure how a list opens a record (#2055)
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 <noreply@anthropic.com>
1 parent 732c57d commit 123f971

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ export const pageForm = defineForm({
107107
{ field: 'addRecord', type: 'composite', disclosure: 'popover', helpText: 'Add-record entry point' },
108108
// Buttons ARE object actions — pick from the source object's actions.
109109
{ field: 'buttons', widget: 'action-multi', dependsOn: 'source', helpText: "Toolbar buttons — pick from this object's actions" },
110+
{
111+
field: 'recordAction',
112+
options: [
113+
{ label: 'Drawer (right-side peek)', value: 'drawer' },
114+
{ label: 'Full page', value: 'page' },
115+
{ label: 'Modal', value: 'modal' },
116+
{ label: 'Not clickable', value: 'none' },
117+
],
118+
helpText: 'How clicking a record opens its detail',
119+
},
110120
{ field: 'showRecordCount', helpText: 'Show the record count bar' },
111121
{ field: 'allowPrinting', helpText: 'Allow users to print this page' },
112122
],

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,12 @@ export const InterfacePageConfigSchema = lazySchema(() => z.object({
261261
* Buttons ARE object actions (not free text): correct-by-construction. */
262262
buttons: z.array(z.string()).optional().describe("Toolbar buttons — names of the source object's actions to surface in the page toolbar"),
263263

264+
/** How clicking a record opens its detail: 'drawer' (right-side peek panel,
265+
* default), 'page' (full-page navigate to the record route), 'modal', or
266+
* 'none' (rows not clickable). */
267+
recordAction: z.enum(['drawer', 'page', 'modal', 'none']).optional()
268+
.describe("How clicking a record opens its detail (drawer | page | modal | none). Default: drawer"),
269+
264270
/** Record count */
265271
showRecordCount: z.boolean().optional().describe('Show record count at page bottom'),
266272

0 commit comments

Comments
 (0)