Skip to content

Commit 104d565

Browse files
fix(ui): restore gallery selection count tag
1 parent ad3f69b commit 104d565

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

invokeai/frontend/web/src/features/gallery/components/Gallery.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,6 @@ export const GalleryPanel = memo(() => {
111111
</Box>
112112
</Collapse>
113113
</Tabs>
114-
115-
{/* <GalleryImageGrid />
116-
<GalleryPagination /> */}
117114
<NewGallery />
118115
</Flex>
119116
);

invokeai/frontend/web/src/features/gallery/components/ImageGrid/GallerySelectionCountTag.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
import { Tag, TagCloseButton, TagLabel } from '@invoke-ai/ui-library';
2-
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
2+
import { useAppDispatch, useAppSelector, useAppStore } from 'app/store/storeHooks';
33
import { useIsRegionFocused } from 'common/hooks/focus';
44
import { useGalleryImageNames } from 'features/gallery/components/NewGallery';
5-
import {
6-
selectFirstSelectedImage,
7-
selectSelection,
8-
selectSelectionCount,
9-
} from 'features/gallery/store/gallerySelectors';
5+
import { selectFirstSelectedImage, selectSelectionCount } from 'features/gallery/store/gallerySelectors';
106
import { selectionChanged } from 'features/gallery/store/gallerySlice';
117
import { useRegisteredHotkeys } from 'features/system/components/HotkeysModal/useHotkeyData';
128
import { memo, useCallback } from 'react';
139
import { useTranslation } from 'react-i18next';
1410

1511
export const GallerySelectionCountTag = memo(() => {
16-
const dispatch = useAppDispatch();
17-
const selection = useAppSelector(selectSelection);
12+
const { dispatch } = useAppStore();
13+
const selectionCount = useAppSelector(selectSelectionCount);
1814
const { imageNames } = useGalleryImageNames();
1915
const isGalleryFocused = useIsRegionFocused('gallery');
2016

@@ -30,7 +26,7 @@ export const GallerySelectionCountTag = memo(() => {
3026
dependencies: [onSelectPage, isGalleryFocused],
3127
});
3228

33-
if (selection.length <= 1) {
29+
if (selectionCount <= 1) {
3430
return null;
3531
}
3632

invokeai/frontend/web/src/features/gallery/components/NewGallery.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import type { ImageDTO } from 'services/api/types';
2929
import { useDebounce } from 'use-debounce';
3030

3131
import { GalleryImage } from './ImageGrid/GalleryImage';
32+
import { GallerySelectionCountTag } from './ImageGrid/GallerySelectionCountTag';
3233

3334
const log = logger('gallery');
3435

@@ -494,7 +495,7 @@ export const NewGallery = memo(() => {
494495
}
495496

496497
return (
497-
<Box data-overlayscrollbars-initialize="" ref={rootRef} w="full" h="full">
498+
<Box data-overlayscrollbars-initialize="" ref={rootRef} position="relative" w="full" h="full">
498499
<VirtuosoGrid<string, GridContext>
499500
ref={virtuosoRef}
500501
context={context}
@@ -508,6 +509,7 @@ export const NewGallery = memo(() => {
508509
scrollSeekConfiguration={scrollSeekConfiguration}
509510
rangeChanged={handleRangeChanged}
510511
/>
512+
<GallerySelectionCountTag />
511513
</Box>
512514
);
513515
});

0 commit comments

Comments
 (0)