From 7936e5c917968cebff5f2e2aba209a7b300761b9 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 28 Mar 2026 19:08:03 +0100 Subject: [PATCH] scaffolder: use single table for schema properties and widen description column Consolidate the per-property tables into a single table with one header row, eliminating the repeated table headers for each property. Give the description column 3x the width of name/type columns so longer descriptions get more room. Signed-off-by: Patrik Oldsberg Made-with: Cursor --- .../components/RenderSchema/RenderSchema.tsx | 166 +++++++++--------- 1 file changed, 85 insertions(+), 81 deletions(-) diff --git a/plugins/scaffolder/src/components/RenderSchema/RenderSchema.tsx b/plugins/scaffolder/src/components/RenderSchema/RenderSchema.tsx index 86da40d5e6..5b8a84c49f 100644 --- a/plugins/scaffolder/src/components/RenderSchema/RenderSchema.tsx +++ b/plugins/scaffolder/src/components/RenderSchema/RenderSchema.tsx @@ -267,7 +267,7 @@ export const RenderSchema = ({ key: 'description', title: t('renderSchema.tableCell.description'), render: renderDescriptionCell, - width: '1fr', + width: '3fr', }); } } @@ -282,7 +282,7 @@ export const RenderSchema = ({ key: 'description', title: t('renderSchema.tableCell.description'), render: renderDescriptionCell, - width: '1fr', + width: '3fr', }, { key: 'type', @@ -302,87 +302,91 @@ export const RenderSchema = ({ return ( - {columns && - elements && - elements.map(el => { - const id = generateId(el, context); - const info = inspectSchema(el.schema); - const hasDetails = - typeof el.schema !== 'boolean' && - (info.canSubschema || info.hasEnum); - const s = - typeof el.schema !== 'boolean' - ? (el.schema as JSONSchema7) - : undefined; - const isOpen = - hasDetails && s && (!getTypes(s) || isExpanded[id]); - - return ( - - - - {columns.map((col, index) => ( - - {col.title} - - ))} - - - - {col => col.render(el, context)} - - - - {isOpen && ( -
+ + + {columns.map((col, index) => ( + - {info.canSubschema && ( - + ))} + + + {elements.map(el => ( + + {col => col.render(el, context)} + + ))} + + + {elements.map(el => { + const id = generateId(el, context); + const info = inspectSchema(el.schema); + const hasDetails = + typeof el.schema !== 'boolean' && + (info.canSubschema || info.hasEnum); + const s = + typeof el.schema !== 'boolean' + ? (el.schema as JSONSchema7) + : undefined; + const isOpen = + hasDetails && s && (!getTypes(s) || isExpanded[id]); + + if (!isOpen) { + return null; + } + + return ( +
+ {info.canSubschema && ( + + )} + {info.hasEnum && ( + <> + + Valid values: + + - )} - {info.hasEnum && ( - <> - - Valid values: - - - - )} -
- )} - - ); - })} + + )} +
+ ); + })} + + )} {(Object.keys(subschemas) as Array).map(sk => { const subId = `${context.parentId}_${sk}`; const isSubOpen = isExpanded[subId];