From a9680320efbe3eae5323235d12a0dfabf5104572 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Tue, 10 Mar 2026 08:29:43 -0700 Subject: [PATCH] Polish board editor layout and compatibility --- .../boards/[boardId]/BoardComponentSelect.tsx | 139 ++++++++++-------- 1 file changed, 76 insertions(+), 63 deletions(-) diff --git a/src/app/(main)/boards/[boardId]/BoardComponentSelect.tsx b/src/app/(main)/boards/[boardId]/BoardComponentSelect.tsx index 60b1715b5..4ab7fe0f2 100644 --- a/src/app/(main)/boards/[boardId]/BoardComponentSelect.tsx +++ b/src/app/(main)/boards/[boardId]/BoardComponentSelect.tsx @@ -129,6 +129,7 @@ export function BoardComponentSelect({ const needsWebsite = selectedDef?.requiresWebsite !== false; const isOpenType = isOpenBoardType(boardType); + const hasSelectedEntity = isOpenType ? !!selectedEntityId : !!boardEntityId; const resolvedEntityType = needsWebsite ? isOpenType ? selectedEntityType @@ -192,69 +193,6 @@ export function BoardComponentSelect({ return ( - - {CATEGORIES.map(category => { - const components = getComponentsByCategory(category.key).filter(def => - isBoardComponentSupported(def.type, activeEntityType) || - def.type === selectedDef?.type, - ); - - if (!components.length) { - return null; - } - - return ( - - {category.name} - {components.map(def => ( - - handleSelectComponent(def)} - > - - - {def.name} - - - {def.description} - - - - - ))} - - ); - })} - - - - - {previewConfig && (!needsWebsite || resolvedEntityId) ? ( - - ) : ( - - - {resolvedEntityId - ? t(messages.selectComponentPreview) - : t(messages.selectBoardEntityFirst)} - - - )} - - - {t(labels.properties)} @@ -367,6 +305,81 @@ export function BoardComponentSelect({ )} + + + + {hasSelectedEntity ? ( + + {CATEGORIES.map(category => { + const components = getComponentsByCategory(category.key).filter(def => + isBoardComponentSupported(def.type, activeEntityType) || + def.type === selectedDef?.type, + ); + + if (!components.length) { + return null; + } + + return ( + + {category.name} + {components.map(def => ( + + handleSelectComponent(def)} + > + + + {def.name} + + + {def.description} + + + + + ))} + + ); + })} + + ) : ( + + {t(messages.selectBoardEntityFirst)} + + )} + + + + + + {hasSelectedEntity && previewConfig && (!needsWebsite || resolvedEntityId) ? ( + + ) : ( + + + {!hasSelectedEntity + ? t(messages.selectBoardEntityFirst) + : resolvedEntityId + ? t(messages.selectComponentPreview) + : t(messages.selectBoardEntityFirst)} + + + )} + +