From 30e48e3aaa32a9554524fc9c7d04253f1afd8d7f Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Mon, 19 Jan 2026 00:28:42 -0800 Subject: [PATCH] Add panel size constraints and size properties to board types. - Add MIN_ROW_HEIGHT, MAX_ROW_HEIGHT, MIN_COLUMN_WIDTH, BUTTON_ROW_HEIGHT constants - Apply minSize/maxSize constraints to row and column panels - Add size property to BoardColumn and BoardRow types for future persistence - Add optional chaining for safer property access Co-Authored-By: Claude Opus 4.5 --- src/app/(main)/boards/[boardId]/BoardBody.tsx | 21 +++++++++++-------- src/lib/types.ts | 2 ++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/app/(main)/boards/[boardId]/BoardBody.tsx b/src/app/(main)/boards/[boardId]/BoardBody.tsx index 75fa780c..43921963 100644 --- a/src/app/(main)/boards/[boardId]/BoardBody.tsx +++ b/src/app/(main)/boards/[boardId]/BoardBody.tsx @@ -14,7 +14,10 @@ const CATALOG = { }, }; -const MIN_HEIGHT = 300; +const MIN_ROW_HEIGHT = 300; +const MAX_ROW_HEIGHT = 600; +const MIN_COLUMN_WIDTH = 300; +const BUTTON_ROW_HEIGHT = 60; const MAX_COLUMNS = 4; export function BoardBody() { @@ -76,27 +79,27 @@ export function BoardBody() { }; const rows = board?.parameters?.rows ?? []; - const minHeight = (rows.length + 1) * MIN_HEIGHT; + const minHeight = (rows?.length || 1) * MAX_ROW_HEIGHT + BUTTON_ROW_HEIGHT; return ( {rows.map((row, index) => ( - + - {index < rows.length - 1 && } + {index < rows?.length - 1 && } ))} - +