From 57c0fcb93d687ac2df46cd87fc8eaebc5c3e949d Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Mon, 1 Jul 2024 12:48:15 -0400 Subject: [PATCH] (ui) clarify auto-add options --- invokeai/frontend/web/public/locales/en.json | 1 + .../gallery/components/Boards/BoardContextMenu.tsx | 12 +++++------- .../components/Boards/BoardsList/GalleryBoard.tsx | 4 ++-- .../components/Boards/NoBoardBoardContextMenu.tsx | 12 +++++------- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/invokeai/frontend/web/public/locales/en.json b/invokeai/frontend/web/public/locales/en.json index 289159eaf0..dc09ac313f 100644 --- a/invokeai/frontend/web/public/locales/en.json +++ b/invokeai/frontend/web/public/locales/en.json @@ -20,6 +20,7 @@ "archiveBoard": "Archive Board", "archived": "Archived", "autoAddBoard": "Auto-Add Board", + "selectedForAutoAdd": "Selected for Auto-Add", "bottomMessage": "Deleting this board and its images will reset any features currently using them.", "cancel": "Cancel", "changeBoard": "Change Board", diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx index 677919bd30..4c05d78bb8 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx @@ -71,13 +71,11 @@ const BoardContextMenu = ({ board, setBoardToDelete, children }: Props) => { () => ( - } - isDisabled={isSelectedForAutoAdd || autoAssignBoardOnClick} - onClick={handleSetAutoAdd} - > - {t('boards.menuItemAutoAdd')} - + {!autoAssignBoardOnClick && ( + } isDisabled={isSelectedForAutoAdd} onClick={handleSetAutoAdd}> + {isSelectedForAutoAdd ? t('boards.selectedForAutoAdd') : t('boards.menuItemAutoAdd')} + + )} {isBulkDownloadEnabled && ( } onClickCapture={handleBulkDownload}> {t('boards.downloadBoard')} diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/GalleryBoard.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/GalleryBoard.tsx index fa5ed15930..ad40fdbf6a 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/GalleryBoard.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/GalleryBoard.tsx @@ -64,10 +64,10 @@ const GalleryBoard = ({ board, isSelected, setBoardToDelete }: GalleryBoardProps const handleSelectBoard = useCallback(() => { dispatch(boardIdSelected({ boardId: board_id })); - if (autoAssignBoardOnClick && !board.archived) { + if (autoAssignBoardOnClick) { dispatch(autoAddBoardIdChanged(board_id)); } - }, [board_id, autoAssignBoardOnClick, dispatch, board.archived]); + }, [board_id, autoAssignBoardOnClick, dispatch]); const [updateBoard, { isLoading: isUpdateBoardLoading }] = useUpdateBoardMutation(); diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/NoBoardBoardContextMenu.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/NoBoardBoardContextMenu.tsx index b15226b9e6..3836f53e0d 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/NoBoardBoardContextMenu.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/NoBoardBoardContextMenu.tsx @@ -33,13 +33,11 @@ const NoBoardBoardContextMenu = ({ children }: Props) => { () => ( - } - isDisabled={isSelectedForAutoAdd || autoAssignBoardOnClick} - onClick={handleSetAutoAdd} - > - {t('boards.menuItemAutoAdd')} - + {!autoAssignBoardOnClick && ( + } isDisabled={isSelectedForAutoAdd} onClick={handleSetAutoAdd}> + {isSelectedForAutoAdd ? t('boards.selectedForAutoAdd') : t('boards.menuItemAutoAdd')} + + )} {isBulkDownloadEnabled && ( } onClickCapture={handleBulkDownload}> {t('boards.downloadBoard')}