diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx index 42e6e47e96..93c148ee22 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx @@ -39,6 +39,30 @@ export const BoardsList = ({ isPrivate }: { isPrivate?: boolean }) => { }); }, [boardSearchText, boards, isPrivate]); + const boardElements = useMemo(() => { + const elements = []; + if (allowPrivateBoards && isPrivate && !boardSearchText.length) { + elements.push(); + } + + if (!allowPrivateBoards && !boardSearchText.length) { + elements.push(); + } + + filteredBoards.forEach((board) => { + elements.push( + + ); + }); + + return elements; + }, [filteredBoards, isPrivate, allowPrivateBoards, boardSearchText, selectedBoardId]); + const boardListTitle = useMemo(() => { if (allowPrivateBoards) { return isPrivate ? t('boards.private') : t('boards.shared'); @@ -80,24 +104,13 @@ export const BoardsList = ({ isPrivate }: { isPrivate?: boolean }) => { - {(allowPrivateBoards && isPrivate) || !allowPrivateBoards ? ( - - ) : !filteredBoards.length ? ( - - {t('boards.noBoards', { boardType: isPrivate ? 'Private' : '' })} - + {boardElements.length ? ( + <>{boardElements} ) : ( - <> + + {t('boards.noBoards', { boardType: boardSearchText.length ? 'Matching' : '' })} + )} - - {filteredBoards.map((board) => ( - - ))} diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/NoBoardBoard.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/NoBoardBoard.tsx index 5c81fbb190..97d3d7684b 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/NoBoardBoard.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/NoBoardBoard.tsx @@ -29,6 +29,7 @@ const NoBoardBoard = memo(({ isSelected }: Props) => { }); const autoAddBoardId = useAppSelector((s) => s.gallery.autoAddBoardId); const autoAssignBoardOnClick = useAppSelector((s) => s.gallery.autoAssignBoardOnClick); + const boardSearchText = useAppSelector((s) => s.gallery.boardSearchText); const boardName = useBoardName('none'); const handleSelectBoard = useCallback(() => { dispatch(boardIdSelected({ boardId: 'none' })); @@ -47,6 +48,10 @@ const NoBoardBoard = memo(({ isSelected }: Props) => { const { t } = useTranslation(); + if (boardSearchText.length) { + return null; + } + return ( {(ref) => (