Skip to content

Commit 0b5f064

Browse files
committed
fix(spec): keep the quick-filter fields repeater an inline table
Before it was enumerated, userFilters.fields rendered as the panel's auto-detected master-detail table with a required marker on Field. The declared repeater now asks for the grid layout and marks the required row property, so the panel keeps that look with translated column heads. Claude-Session: https://claude.ai/code/session_01WGufzjGQVFPCizmQreyKkv Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5c71be1 commit 0b5f064

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎packages/spec/src/ui/view-form-composite-children.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ describe('#30267 — view form composites declare their children', () => {
103103
it('userFilters.fields is a repeater whose row labels are the item schema titles', () => {
104104
const repeater = (formField('userFilters').fields ?? []).find((c) => c.field === 'fields');
105105
expect(repeater?.type).toBe('repeater');
106+
// The inline table it rendered as before it was enumerated.
107+
expect((repeater as { widget?: string } | undefined)?.widget).toBe('grid');
106108
const items = LIST.properties.userFilters.properties.fields.items.properties as Record<string, Node>;
107109
const rows = repeater?.fields ?? [];
108110
expect(rows.map((r) => r.field).sort()).toEqual(liveKeys(items).sort());

‎packages/spec/src/ui/view.form.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,16 @@ export const viewForm = defineForm({
206206
{
207207
field: 'fields',
208208
type: 'repeater',
209+
// `grid`: the inline table this array of objects rendered as
210+
// before it was enumerated (the panel's auto-detected
211+
// master-detail table), now with translatable column heads.
212+
widget: 'grid',
209213
helpText: 'Fields exposed as quick filters (dropdown/toggle elements)',
210214
// Row-property names: every authorable row property, `label`
211215
// equal to the item schema's `.meta({ title })`, as `columns`
212216
// above does.
213217
fields: [
214-
{ field: 'field', label: 'Field' },
218+
{ field: 'field', label: 'Field', required: true },
215219
{ field: 'label', label: 'Label' },
216220
{ field: 'type', label: 'Type' },
217221
{ field: 'options', label: 'Options' },

0 commit comments

Comments
 (0)