diff --git a/invokeai/frontend/web/src/app/components/App.tsx b/invokeai/frontend/web/src/app/components/App.tsx
index a70ed03fda..aa1919abfb 100644
--- a/invokeai/frontend/web/src/app/components/App.tsx
+++ b/invokeai/frontend/web/src/app/components/App.tsx
@@ -18,6 +18,8 @@ import { usePreselectedImage } from '../../features/parameters/hooks/usePreselec
import AppErrorBoundaryFallback from './AppErrorBoundaryFallback';
import GlobalHotkeys from './GlobalHotkeys';
import Toaster from './Toaster';
+import { CustomStarUi } from '../../features/ui/store/uiTypes';
+import { setCustomStarUi } from '../../features/ui/store/uiSlice';
const DEFAULT_CONFIG = {};
@@ -28,12 +30,14 @@ interface Props {
imageName: string;
action: 'sendToImg2Img' | 'sendToCanvas' | 'useAllParameters';
};
+ customStarUi?: CustomStarUi;
}
const App = ({
config = DEFAULT_CONFIG,
headerComponent,
selectedImage,
+ customStarUi,
}: Props) => {
const language = useAppSelector(languageSelector);
@@ -57,6 +61,12 @@ const App = ({
}
}, [dispatch, config, logger]);
+ useEffect(() => {
+ if (customStarUi) {
+ dispatch(setCustomStarUi(customStarUi));
+ }
+ }, [customStarUi, dispatch]);
+
useEffect(() => {
dispatch(appStarted());
}, [dispatch]);
diff --git a/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx b/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx
index 322ee3fd2b..36636b3ca9 100644
--- a/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx
+++ b/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx
@@ -15,6 +15,7 @@ import { socketMiddleware } from 'services/events/middleware';
import Loading from '../../common/components/Loading/Loading';
import '../../i18n';
import AppDndContext from '../../features/dnd/components/AppDndContext';
+import { CustomStarUi } from '../../features/ui/store/uiTypes';
const App = lazy(() => import('./App'));
const ThemeLocaleProvider = lazy(() => import('./ThemeLocaleProvider'));
@@ -30,6 +31,7 @@ interface Props extends PropsWithChildren {
imageName: string;
action: 'sendToImg2Img' | 'sendToCanvas' | 'useAllParameters';
};
+ customStarUi?: CustomStarUi;
}
const InvokeAIUI = ({
@@ -40,6 +42,7 @@ const InvokeAIUI = ({
middleware,
projectId,
selectedImage,
+ customStarUi,
}: Props) => {
useEffect(() => {
// configure API client token
@@ -90,6 +93,7 @@ const InvokeAIUI = ({
config={config}
headerComponent={headerComponent}
selectedImage={selectedImage}
+ customStarUi={customStarUi}
/>
diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx
index bf2b344b4c..e2a9013aac 100644
--- a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx
+++ b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx
@@ -12,10 +12,12 @@ import {
useStarImagesMutation,
useUnstarImagesMutation,
} from '../../../../services/api/endpoints/images';
+import { uiSelector } from '../../../ui/store/uiSelectors';
const MultipleSelectionMenuItems = () => {
const dispatch = useAppDispatch();
const selection = useAppSelector((state) => state.gallery.selection);
+ const { customStarUi } = useAppSelector(uiSelector);
const [starImages] = useStarImagesMutation();
const [unstarImages] = useUnstarImagesMutation();
@@ -49,15 +51,18 @@ const MultipleSelectionMenuItems = () => {
<>
{areAllStarred && (
}
+ icon={customStarUi ? customStarUi.on.icon : }
onClickCapture={handleUnstarSelection}
>
- Unstar All
+ {customStarUi ? customStarUi.off.text : `Unstar All`}
)}
{(areAllUnstarred || (!areAllStarred && !areAllUnstarred)) && (
- } onClickCapture={handleStarSelection}>
- Star All
+ }
+ onClickCapture={handleStarSelection}
+ >
+ {customStarUi ? customStarUi.on.text : `Star All`}
)}
} onClickCapture={handleChangeBoard}>
diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx
index 46c84e85ce..68c5c2e1ae 100644
--- a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx
+++ b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx
@@ -35,6 +35,7 @@ import { ImageDTO } from 'services/api/types';
import { sentImageToCanvas, sentImageToImg2Img } from '../../store/actions';
import { workflowLoadRequested } from 'features/nodes/store/actions';
import { configSelector } from '../../../system/store/configSelectors';
+import { uiSelector } from '../../../ui/store/uiSelectors';
type SingleSelectionMenuItemsProps = {
imageDTO: ImageDTO;
@@ -50,6 +51,7 @@ const SingleSelectionMenuItems = (props: SingleSelectionMenuItemsProps) => {
const isCanvasEnabled = useFeatureStatus('unifiedCanvas').isFeatureEnabled;
const { shouldFetchMetadataFromApi } = useAppSelector(configSelector);
+ const { customStarUi } = useAppSelector(uiSelector);
const { metadata, workflow, isLoading } = useGetImageMetadataFromFileQuery(
{ image: imageDTO, shouldFetchMetadataFromApi },
@@ -225,12 +227,18 @@ const SingleSelectionMenuItems = (props: SingleSelectionMenuItemsProps) => {
Change Board
{imageDTO.starred ? (
- } onClickCapture={handleUnstarImage}>
- Unstar Image
+ }
+ onClickCapture={handleUnstarImage}
+ >
+ {customStarUi ? customStarUi.off.text : `Unstar Image`}
) : (
- } onClickCapture={handleStarImage}>
- Star Image
+ }
+ onClickCapture={handleStarImage}
+ >
+ {customStarUi ? customStarUi.on.text : `Star Image`}
)}