Skip to content

Commit 12cab9f

Browse files
revert(ui): miniviewer
toodles
1 parent 6fb8e45 commit 12cab9f

File tree

4 files changed

+12
-53
lines changed

4 files changed

+12
-53
lines changed

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

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ import {
1414
import { createSelector } from '@reduxjs/toolkit';
1515
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
1616
import { useGallerySearchTerm } from 'features/gallery/components/ImageGrid/useGallerySearchTerm';
17-
import CurrentImageButtons from 'features/gallery/components/ImageViewer/CurrentImageButtons';
18-
import CurrentImagePreview from 'features/gallery/components/ImageViewer/CurrentImagePreview';
19-
import { selectIsMiniViewerOpen, selectSelectedBoardId } from 'features/gallery/store/gallerySelectors';
20-
import { galleryViewChanged, isMiniViewerOpenToggled, selectGallerySlice } from 'features/gallery/store/gallerySlice';
17+
import { selectSelectedBoardId } from 'features/gallery/store/gallerySelectors';
18+
import { galleryViewChanged, selectGallerySlice } from 'features/gallery/store/gallerySlice';
2119
import type { CSSProperties } from 'react';
2220
import { useCallback } from 'react';
2321
import { useTranslation } from 'react-i18next';
24-
import { PiEyeBold, PiEyeClosedBold, PiMagnifyingGlassBold } from 'react-icons/pi';
22+
import { PiMagnifyingGlassBold } from 'react-icons/pi';
2523
import { useBoardName } from 'services/api/hooks/useBoardName';
2624

2725
import GalleryImageGrid from './ImageGrid/GalleryImageGrid';
@@ -52,11 +50,6 @@ export const Gallery = () => {
5250
const initialSearchTerm = useAppSelector(selectSearchTerm);
5351
const searchDisclosure = useDisclosure({ defaultIsOpen: initialSearchTerm.length > 0 });
5452
const [searchTerm, onChangeSearchTerm, onResetSearchTerm] = useGallerySearchTerm();
55-
const isMiniViewerOpen = useAppSelector(selectIsMiniViewerOpen);
56-
57-
const toggleMiniViewer = useCallback(() => {
58-
dispatch(isMiniViewerOpenToggled());
59-
}, [dispatch]);
6053
const handleClickImages = useCallback(() => {
6154
dispatch(galleryViewChanged('images'));
6255
}, [dispatch]);
@@ -87,27 +80,15 @@ export const Gallery = () => {
8780
<Tab sx={BASE_STYLES} _selected={SELECTED_STYLES} onClick={handleClickAssets} data-testid="assets-tab">
8881
{t('gallery.assets')}
8982
</Tab>
90-
<Flex h="full">
91-
<IconButton
92-
size="sm"
93-
variant="link"
94-
alignSelf="stretch"
95-
onClick={toggleMiniViewer}
96-
tooltip={t('gallery.toggleMiniViewer')}
97-
aria-label={t('gallery.toggleMiniViewer')}
98-
icon={isMiniViewerOpen ? <PiEyeBold /> : <PiEyeClosedBold />}
99-
colorScheme={isMiniViewerOpen ? 'invokeBlue' : 'base'}
100-
/>
101-
<IconButton
102-
size="sm"
103-
variant="link"
104-
alignSelf="stretch"
105-
onClick={handleClickSearch}
106-
tooltip={searchDisclosure.isOpen ? `${t('gallery.exitSearch')}` : `${t('gallery.displaySearch')}`}
107-
aria-label={t('gallery.displaySearch')}
108-
icon={<PiMagnifyingGlassBold />}
109-
/>
110-
</Flex>
83+
<IconButton
84+
size="sm"
85+
variant="link"
86+
alignSelf="stretch"
87+
onClick={handleClickSearch}
88+
tooltip={searchDisclosure.isOpen ? `${t('gallery.exitSearch')}` : `${t('gallery.displaySearch')}`}
89+
aria-label={t('gallery.displaySearch')}
90+
icon={<PiMagnifyingGlassBold />}
91+
/>
11192
</TabList>
11293
</Tabs>
11394

@@ -120,21 +101,6 @@ export const Gallery = () => {
120101
/>
121102
</Box>
122103
</Collapse>
123-
<Collapse in={isMiniViewerOpen} style={COLLAPSE_STYLES}>
124-
<Box position="relative" w="full" mt={2} aspectRatio="1/1">
125-
<CurrentImagePreview />
126-
<Flex
127-
position="absolute"
128-
top={2}
129-
gap={2}
130-
justifyContent="space-between"
131-
left="50%"
132-
transform="translateX(-50%)"
133-
>
134-
<CurrentImageButtons />
135-
</Flex>
136-
</Box>
137-
</Collapse>
138104
<GalleryImageGrid />
139105
<GalleryPagination />
140106
</Flex>

invokeai/frontend/web/src/features/gallery/store/gallerySelectors.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,3 @@ export const selectImageToCompare = createSelector(selectGallerySlice, (gallery)
5757
export const selectHasImageToCompare = createSelector(selectImageToCompare, (imageToCompare) =>
5858
Boolean(imageToCompare)
5959
);
60-
export const selectIsMiniViewerOpen = createSelector(selectGallerySlice, (gallery) => gallery.isMiniViewerOpen);

invokeai/frontend/web/src/features/gallery/store/gallerySlice.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const initialGalleryState: GalleryState = {
2525
comparisonMode: 'slider',
2626
comparisonFit: 'fill',
2727
shouldShowArchivedBoards: false,
28-
isMiniViewerOpen: false,
2928
};
3029

3130
export const gallerySlice = createSlice({
@@ -88,9 +87,6 @@ export const gallerySlice = createSlice({
8887
alwaysShowImageSizeBadgeChanged: (state, action: PayloadAction<boolean>) => {
8988
state.alwaysShowImageSizeBadge = action.payload;
9089
},
91-
isMiniViewerOpenToggled: (state) => {
92-
state.isMiniViewerOpen = !state.isMiniViewerOpen;
93-
},
9490
comparedImagesSwapped: (state) => {
9591
if (state.imageToCompare) {
9692
const oldSelection = state.selection;
@@ -146,7 +142,6 @@ export const {
146142
starredFirstChanged,
147143
shouldShowArchivedBoardsChanged,
148144
searchTermChanged,
149-
isMiniViewerOpenToggled,
150145
} = gallerySlice.actions;
151146

152147
export const selectGallerySlice = (state: RootState) => state.gallery;

invokeai/frontend/web/src/features/gallery/store/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,4 @@ export type GalleryState = {
2828
comparisonMode: ComparisonMode;
2929
comparisonFit: ComparisonFit;
3030
shouldShowArchivedBoards: boolean;
31-
isMiniViewerOpen: boolean;
3231
};

0 commit comments

Comments
 (0)