From 6b24424727ecc5f0d1c6df0bf2c2e38c125520ac Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Sun, 2 Jun 2024 15:20:47 +1000 Subject: [PATCH] feat(ui): add help icon to compare toolbar --- invokeai/frontend/web/public/locales/en.json | 6 ++- .../components/ImageViewer/CompareToolbar.tsx | 42 +++++++++++++++++-- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/invokeai/frontend/web/public/locales/en.json b/invokeai/frontend/web/public/locales/en.json index d127720bd5..306151984a 100644 --- a/invokeai/frontend/web/public/locales/en.json +++ b/invokeai/frontend/web/public/locales/en.json @@ -389,7 +389,11 @@ "swapImages": "Swap Images", "compareOptions": "Comparison Options", "stretchToFit": "Stretch to Fit", - "exitCompare": "Exit Compare" + "exitCompare": "Exit Compare", + "compareHelp1": "Hold Alt while clicking a gallery image or using the arrow keys to change the compare image.", + "compareHelp2": "Press M to cycle through comparison modes.", + "compareHelp3": "Press C to swap the compared images.", + "compareHelp4": "Press Z or Esc to exit." }, "hotkeys": { "searchHotkeys": "Search Hotkeys", diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageViewer/CompareToolbar.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageViewer/CompareToolbar.tsx index 0dadd7be3c..4f525bc670 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageViewer/CompareToolbar.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageViewer/CompareToolbar.tsx @@ -1,4 +1,14 @@ -import { Button, ButtonGroup, Flex, IconButton } from '@invoke-ai/ui-library'; +import { + Button, + ButtonGroup, + Flex, + Icon, + IconButton, + Kbd, + ListItem, + Tooltip, + UnorderedList, +} from '@invoke-ai/ui-library'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { comparedImagesSwapped, @@ -9,8 +19,8 @@ import { } from 'features/gallery/store/gallerySlice'; import { memo, useCallback } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; -import { useTranslation } from 'react-i18next'; -import { PiArrowsOutBold, PiSwapBold, PiXBold } from 'react-icons/pi'; +import { Trans, useTranslation } from 'react-i18next'; +import { PiArrowsOutBold, PiQuestion, PiSwapBold, PiXBold } from 'react-icons/pi'; export const CompareToolbar = memo(() => { const { t } = useTranslation(); @@ -90,7 +100,12 @@ export const CompareToolbar = memo(() => { - + + }> + + + + } aria-label={`${t('gallery.exitCompare')} (Esc)`} @@ -104,3 +119,22 @@ export const CompareToolbar = memo(() => { }); CompareToolbar.displayName = 'CompareToolbar'; + +const CompareHelp = () => { + return ( + + + }}> + + + }}> + + + }}> + + + }}> + + + ); +};