Skip to content

Commit 058ebfc

Browse files
os-zhuangclaude
andcommitted
feat(spec): add userActions.editInline toggle for inline record editing
Inline cell editing is a first-class, author-controlled list property, but UserActionsConfigSchema (the shared toggle set behind both a view's toolbar and a page's interfaceConfig.userActions) had no field for it — so the metadata-admin "Interface (list pages)" panel, which auto-renders these booleans as checkboxes, couldn't expose it. The runtime already honors it (objectui InterfaceListPage reads userActions.editInline -> inlineEdit). Add `editInline: boolean` (default false — a list is read-only unless the author opts in), sitting alongside `addRecordForm`. When on, cells edit with the field's type-aware widget (the same control the form uses). view.test.ts: assert the default (false) and the accepted (true) value. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 1c11473 commit 058ebfc

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

packages/spec/src/ui/view.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,6 +2051,7 @@ describe('UserActionsConfigSchema', () => {
20512051
expect(config.filter).toBe(true);
20522052
expect(config.rowHeight).toBe(true);
20532053
expect(config.addRecordForm).toBe(false);
2054+
expect(config.editInline).toBe(false);
20542055
expect(config.buttons).toBeUndefined();
20552056
});
20562057

@@ -2061,11 +2062,13 @@ describe('UserActionsConfigSchema', () => {
20612062
filter: false,
20622063
rowHeight: true,
20632064
addRecordForm: true,
2065+
editInline: true,
20642066
buttons: ['btn_export', 'btn_archive'],
20652067
});
20662068
expect(config.sort).toBe(false);
20672069
expect(config.filter).toBe(false);
20682070
expect(config.addRecordForm).toBe(true);
2071+
expect(config.editInline).toBe(true);
20692072
expect(config.buttons).toEqual(['btn_export', 'btn_archive']);
20702073
});
20712074

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ export const UserActionsConfigSchema = lazySchema(() => z.object({
241241
filter: z.boolean().default(true).describe('Allow users to filter records'),
242242
rowHeight: z.boolean().default(true).describe('Allow users to toggle row height/density'),
243243
addRecordForm: z.boolean().default(false).describe('Add records through a form instead of inline'),
244+
editInline: z.boolean().default(false).describe('Allow users to edit records inline — click a cell to edit it with the field\'s type-aware widget (the same control the form uses). Off by default: the list is read-only unless the author opts in.'),
244245
buttons: z.array(z.string()).optional().describe('Custom action button IDs to show in the toolbar'),
245246
}).describe('User action toggles for the view toolbar'));
246247

0 commit comments

Comments
 (0)