Skip to content

Commit 97a0802

Browse files
os-zhuangclaude
andcommitted
feat(spec): progressive-disclosure popover for composite form fields
Adds `disclosure?: 'inline' | 'popover'` to FormFieldSchema. A composite field marked `disclosure: 'popover'` renders as a compact summary line + a gear that opens its sub-fields in a popover (Airtable-style progressive disclosure), instead of an always-expanded inline box — keeping the interface-page panel lean. Applied to the page form's `appearance`, `userActions`, and `addRecord` composites (the dense sub-toggle groups). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 04ed478 commit 97a0802

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,16 @@ export const pageForm = defineForm({
9595
{ field: 'filterBy', type: 'repeater', helpText: 'Always-on base filter for the page' },
9696
{ field: 'levels', helpText: 'Hierarchy levels to display (tree-like sources)' },
9797
// ── Appearance ──
98-
{ field: 'appearance', type: 'composite', helpText: 'Allowed visualizations (Grid / Kanban / Calendar / …) and description visibility' },
98+
{ field: 'appearance', type: 'composite', disclosure: 'popover', helpText: 'Allowed visualizations (Grid / Kanban / Calendar / …) and description visibility' },
9999
// ── User filters ──
100100
{
101101
field: 'userFilters',
102102
widget: 'filter-mode',
103103
helpText: 'End-user filter bar: None (no bar) / Tabs (named presets) / Dropdown (per-field). None removes the config.',
104104
},
105105
// ── User actions ──
106-
{ field: 'userActions', type: 'composite', helpText: 'Toolbar toggles (search, sort, filter, row height)' },
107-
{ field: 'addRecord', type: 'composite', helpText: 'Add-record entry point' },
106+
{ field: 'userActions', type: 'composite', disclosure: 'popover', helpText: 'Toolbar toggles (search, sort, filter, row height)' },
107+
{ field: 'addRecord', type: 'composite', disclosure: 'popover', helpText: 'Add-record entry point' },
108108
{ field: 'showRecordCount', helpText: 'Show the record count bar' },
109109
{ field: 'allowPrinting', helpText: 'Allow users to print this page' },
110110
],

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,7 @@ export const FormFieldSchema: z.ZodType<any> = lazySchema(() => z.object({
715715

716716
dependsOn: z.string().optional().describe('Parent field name for cascading'),
717717
visibleOn: ExpressionInputSchema.optional().describe('Visibility predicate (CEL).'),
718+
disclosure: z.enum(['inline', 'popover']).optional().describe('Composite rendering: inline bordered box (default) or a summary line + gear popover (progressive disclosure).'),
718719
}));
719720

720721
/**

0 commit comments

Comments
 (0)