Skip to content

Commit db5ebe4

Browse files
os-zhuangclaude
andauthored
fix(plugin-detail): declare designer inputs for record:* blocks (spec conformance) (#2113)
The record:details/related_list/highlights/path blocks registered ZERO inputs — the designer couldn't configure them and the spec↔frontend conformance check flagged 17 spec-only divergences. Add inputs mirroring @objectstack/spec RecordDetailsProps / RecordRelatedListProps / RecordHighlightsProps / RecordPathProps. Verified via a live manifest dump: record:* now 17 matched / 0 spec-only. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e885db3 commit db5ebe4

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

.changeset/record-block-inputs.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@object-ui/plugin-detail": minor
3+
---
4+
5+
Declare designer inputs for the `record:*` blocks (details, related_list,
6+
highlights, path) so they conform to the spec protocol (RecordDetailsProps /
7+
RecordRelatedListProps / RecordHighlightsProps / RecordPathProps in
8+
@objectstack/spec component.zod). They previously registered ZERO inputs — the
9+
visual designer could not configure them, and the spec↔frontend conformance
10+
check flagged 17 spec-only divergences. Now each block's inputs mirror its spec
11+
schema (columns/layout/sections/fields, etc.).

packages/plugin-detail/src/index.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,20 +218,44 @@ ComponentRegistry.register('record:details', RecordDetailsRenderer, {
218218
category: 'record',
219219
label: 'Record Details',
220220
icon: 'FileText',
221+
// Designer inputs mirror @objectstack/spec RecordDetailsProps (component.zod).
222+
inputs: [
223+
{ name: 'columns', type: 'enum', label: 'Columns', enum: ['1', '2', '3', '4'], defaultValue: '2', description: 'Number of columns for field layout (1-4)' },
224+
{ name: 'layout', type: 'enum', label: 'Layout', enum: ['auto', 'custom'], defaultValue: 'auto', description: 'auto uses the object compactLayout; custom uses explicit sections' },
225+
{ name: 'sections', type: 'array', label: 'Sections', description: 'Section IDs to show (required when layout is "custom")' },
226+
{ name: 'fields', type: 'array', label: 'Fields', description: 'Explicit field list (overrides compactLayout)' },
227+
],
221228
});
222229

223230
ComponentRegistry.register('record:related_list', RecordRelatedListRenderer, {
224231
namespace: 'record',
225232
category: 'record',
226233
label: 'Related List',
227234
icon: 'List',
235+
// Mirrors @objectstack/spec RecordRelatedListProps.
236+
inputs: [
237+
{ name: 'objectName', type: 'string', label: 'Related Object', required: true, description: 'Related object name (e.g. "task")' },
238+
{ name: 'relationshipField', type: 'string', label: 'Relationship Field', required: true, description: 'Field on the related object pointing back to this record' },
239+
{ name: 'columns', type: 'array', label: 'Columns', required: true, description: 'Fields to display in the related list' },
240+
{ name: 'sort', type: 'array', label: 'Sort' },
241+
{ name: 'limit', type: 'number', label: 'Limit', defaultValue: 5, description: 'Records to display initially' },
242+
{ name: 'filter', type: 'array', label: 'Filter', description: 'Additional filter criteria' },
243+
{ name: 'title', type: 'string', label: 'Title' },
244+
{ name: 'showViewAll', type: 'boolean', label: 'Show "View All"', defaultValue: true },
245+
{ name: 'actions', type: 'array', label: 'Actions', description: 'Action IDs available for related records' },
246+
],
228247
});
229248

230249
ComponentRegistry.register('record:highlights', RecordHighlightsRenderer, {
231250
namespace: 'record',
232251
category: 'record',
233252
label: 'Highlights Panel',
234253
icon: 'Star',
254+
// Mirrors @objectstack/spec RecordHighlightsProps.
255+
inputs: [
256+
{ name: 'fields', type: 'array', label: 'Fields', required: true, description: 'Key fields to highlight (1-7), bare names or {name,label?,icon?,type?}' },
257+
{ name: 'layout', type: 'enum', label: 'Layout', enum: ['horizontal', 'vertical'], defaultValue: 'horizontal', description: 'Layout orientation for highlight fields' },
258+
],
235259
});
236260

237261
ComponentRegistry.register('record:activity', RecordActivityRenderer, {
@@ -265,6 +289,11 @@ ComponentRegistry.register('record:path', RecordPathRenderer, {
265289
category: 'record',
266290
label: 'Path / Stepper',
267291
icon: 'GitBranch',
292+
// Mirrors @objectstack/spec RecordPathProps.
293+
inputs: [
294+
{ name: 'statusField', type: 'string', label: 'Status Field', required: true, description: 'Field representing the current status/stage' },
295+
{ name: 'stages', type: 'array', label: 'Stages', description: 'Explicit stage definitions [{ value, label }] (else derived from field metadata)' },
296+
],
268297
});
269298

270299
ComponentRegistry.register('record:quick_actions', RecordQuickActionsRenderer, {

0 commit comments

Comments
 (0)