Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

feat(gallery): show the board cover in the header's board toggle

Josh Corbettc176757f3a47
diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/GalleryWidgetChrome.tsx b/invokeai/frontend/webv2/src/features/gallery/ui/GalleryWidgetChrome.tsx
index 173a3825db..1b181dc301 100644
--- a/invokeai/frontend/webv2/src/features/gallery/ui/GalleryWidgetChrome.tsx
+++ b/invokeai/frontend/webv2/src/features/gallery/ui/GalleryWidgetChrome.tsx
@@ -5,12 +5,13 @@ import { galleryBoardsOptions } from '@features/gallery/data/queries';
import { Button } from '@platform/ui/Button';
import { MiddleTruncate } from '@platform/ui/MiddleTruncate';
import { useQuery } from '@tanstack/react-query';
-import { ChevronsDownUpIcon, ChevronsUpDownIcon } from 'lucide-react';
+import { ChevronsDownUpIcon, ChevronsUpDownIcon, ImageIcon } from 'lucide-react';
import { useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import type { GalleryWidgetProps } from './GalleryUiContext';
+import { BoardCover, BoardCoverIcon } from './GalleryBoardCover';
import { GallerySettingsMenu } from './GallerySettingsMenu';
import { getGallerySelectedBoardId } from './galleryStateView';
import { useGalleryUi } from './GalleryUiContext';
@@ -72,10 +73,13 @@ export const GalleryWidgetLabel = ({ region }: GalleryChromeProps) => {
aria-label={t('widgets.gallery.toggleBoardsNamed', { name: boardName })}
maxW="14rem"
minW="0"
+ // The cover keeps the same 2px inset on every side of the 24px button.
+ ps="0.5"
size="2xs"
variant="ghost"
onClick={toggleBoards}
>
+ {selectedBoard ? <BoardCover board={selectedBoard} /> : <BoardCoverIcon icon={ImageIcon} />}
<MiddleTruncate fontWeight="600" minW="0" text={boardName} />
<Icon as={isCollapsed ? ChevronsUpDownIcon : ChevronsDownUpIcon} boxSize="3" color="fg.subtle" flexShrink={0} />
</Button>
diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/picker/GalleryPickerView.tsx b/invokeai/frontend/webv2/src/features/gallery/ui/picker/GalleryPickerView.tsx
index 1b0d64b6b9..efc075f6ed 100644
--- a/invokeai/frontend/webv2/src/features/gallery/ui/picker/GalleryPickerView.tsx
+++ b/invokeai/frontend/webv2/src/features/gallery/ui/picker/GalleryPickerView.tsx
@@ -353,6 +353,7 @@ export const GalleryPickerView = ({
flex="1"
justifyContent="flex-start"
minW="0"
+ ps="1"
size="xs"
variant="ghost"
onClick={togglePane}