From bf8bef2f0094dba959d2d98761889af2fdbea88b Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 23 Aug 2024 16:52:42 +1000 Subject: [PATCH] chore(ui): prettier --- invokeai/frontend/web/src/app/components/InvokeAIUI.tsx | 2 +- invokeai/frontend/web/src/app/store/actions.ts | 2 +- invokeai/frontend/web/src/app/store/storeHooks.ts | 2 +- invokeai/frontend/web/src/app/types/invokeai.ts | 2 +- .../frontend/web/src/common/hooks/useIsReadyToEnqueue.ts | 2 +- .../ControlLayer/ControlLayerControlAdapter.tsx | 5 ++++- .../ControlLayerControlAdapterControlMode.tsx | 2 +- .../components/IPAdapter/IPAdapterMethod.tsx | 2 +- .../components/IPAdapter/IPAdapterModel.tsx | 2 +- .../controlLayers/hooks/useCanvasDeleteLayerHotkey.ts | 5 +---- .../features/controlLayers/hooks/useEntityObjectCount.ts | 2 +- .../controlLayers/hooks/useLayerControlAdapter.ts | 3 +-- .../src/features/controlLayers/store/sessionReducers.ts | 6 +----- .../ImageContextMenu/SingleSelectionMenuItems.tsx | 2 +- .../frontend/web/src/features/metadata/util/recallers.ts | 5 +---- .../features/parameters/components/Prompts/Prompts.tsx | 9 +++------ .../web/src/features/system/hooks/useFeatureStatus.ts | 2 +- .../web/src/features/ui/components/AppContent.tsx | 2 +- .../web/src/features/ui/components/TabButton.tsx | 2 +- .../web/src/features/ui/components/TabMountGate.tsx | 2 +- .../web/src/features/ui/components/TabVisibilityGate.tsx | 2 +- invokeai/frontend/web/src/features/ui/store/uiSlice.ts | 2 +- invokeai/frontend/web/src/features/ui/store/uiTypes.ts | 1 - 23 files changed, 27 insertions(+), 39 deletions(-) diff --git a/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx b/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx index 36b40c2215..47d4359e31 100644 --- a/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx +++ b/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx @@ -19,7 +19,7 @@ import type { PartialAppConfig } from 'app/types/invokeai'; import Loading from 'common/components/Loading/Loading'; import AppDndContext from 'features/dnd/components/AppDndContext'; import type { WorkflowCategory } from 'features/nodes/types/workflow'; -import type { TabName } from "features/ui/store/uiTypes"; +import type { TabName } from 'features/ui/store/uiTypes'; import type { PropsWithChildren, ReactNode } from 'react'; import React, { lazy, memo, useEffect, useMemo } from 'react'; import { Provider } from 'react-redux'; diff --git a/invokeai/frontend/web/src/app/store/actions.ts b/invokeai/frontend/web/src/app/store/actions.ts index 390849a8af..6b7475d1b6 100644 --- a/invokeai/frontend/web/src/app/store/actions.ts +++ b/invokeai/frontend/web/src/app/store/actions.ts @@ -1,5 +1,5 @@ import { createAction } from '@reduxjs/toolkit'; -import type { TabName } from "features/ui/store/uiTypes"; +import type { TabName } from 'features/ui/store/uiTypes'; export const enqueueRequested = createAction<{ tabName: TabName; diff --git a/invokeai/frontend/web/src/app/store/storeHooks.ts b/invokeai/frontend/web/src/app/store/storeHooks.ts index 7f93819c3a..6bc904acb3 100644 --- a/invokeai/frontend/web/src/app/store/storeHooks.ts +++ b/invokeai/frontend/web/src/app/store/storeHooks.ts @@ -1,6 +1,6 @@ import type { AppThunkDispatch, RootState } from 'app/store/store'; import type { TypedUseSelectorHook } from 'react-redux'; -import {useDispatch, useSelector, useStore } from 'react-redux'; +import { useDispatch, useSelector, useStore } from 'react-redux'; // Use throughout your app instead of plain `useDispatch` and `useSelector` export const useAppDispatch = () => useDispatch(); diff --git a/invokeai/frontend/web/src/app/types/invokeai.ts b/invokeai/frontend/web/src/app/types/invokeai.ts index bca17a01dc..6b71fb2720 100644 --- a/invokeai/frontend/web/src/app/types/invokeai.ts +++ b/invokeai/frontend/web/src/app/types/invokeai.ts @@ -1,6 +1,6 @@ import type { FilterType } from 'features/controlLayers/store/types'; import type { ParameterPrecision, ParameterScheduler } from 'features/parameters/types/parameterSchemas'; -import type { TabName } from "features/ui/store/uiTypes"; +import type { TabName } from 'features/ui/store/uiTypes'; import type { O } from 'ts-toolbelt'; /** diff --git a/invokeai/frontend/web/src/common/hooks/useIsReadyToEnqueue.ts b/invokeai/frontend/web/src/common/hooks/useIsReadyToEnqueue.ts index 1c5bf95ba0..64d47df650 100644 --- a/invokeai/frontend/web/src/common/hooks/useIsReadyToEnqueue.ts +++ b/invokeai/frontend/web/src/common/hooks/useIsReadyToEnqueue.ts @@ -239,7 +239,7 @@ const createSelector = (templates: Templates, isConnected: boolean) => export const useIsReadyToEnqueue = () => { const templates = useStore($templates); - const isConnected = useStore($isConnected) + const isConnected = useStore($isConnected); const selector = useMemo(() => createSelector(templates, isConnected), [templates, isConnected]); const value = useAppSelector(selector); return value; diff --git a/invokeai/frontend/web/src/features/controlLayers/components/ControlLayer/ControlLayerControlAdapter.tsx b/invokeai/frontend/web/src/features/controlLayers/components/ControlLayer/ControlLayerControlAdapter.tsx index 435e90cdd4..7df91e0084 100644 --- a/invokeai/frontend/web/src/features/controlLayers/components/ControlLayer/ControlLayerControlAdapter.tsx +++ b/invokeai/frontend/web/src/features/controlLayers/components/ControlLayer/ControlLayerControlAdapter.tsx @@ -55,7 +55,10 @@ export const ControlLayerControlAdapter = memo(() => { {controlAdapter.type === 'controlnet' && ( - + )} ); diff --git a/invokeai/frontend/web/src/features/controlLayers/components/ControlLayer/ControlLayerControlAdapterControlMode.tsx b/invokeai/frontend/web/src/features/controlLayers/components/ControlLayer/ControlLayerControlAdapterControlMode.tsx index e0f57e6df8..5aaa77bb9b 100644 --- a/invokeai/frontend/web/src/features/controlLayers/components/ControlLayer/ControlLayerControlAdapterControlMode.tsx +++ b/invokeai/frontend/web/src/features/controlLayers/components/ControlLayer/ControlLayerControlAdapterControlMode.tsx @@ -1,7 +1,7 @@ import type { ComboboxOnChange } from '@invoke-ai/ui-library'; import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui-library'; import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover'; -import type { ControlModeV2} from 'features/controlLayers/store/types'; +import type { ControlModeV2 } from 'features/controlLayers/store/types'; import { isControlModeV2 } from 'features/controlLayers/store/types'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/controlLayers/components/IPAdapter/IPAdapterMethod.tsx b/invokeai/frontend/web/src/features/controlLayers/components/IPAdapter/IPAdapterMethod.tsx index 1e1165fbc7..f70073b454 100644 --- a/invokeai/frontend/web/src/features/controlLayers/components/IPAdapter/IPAdapterMethod.tsx +++ b/invokeai/frontend/web/src/features/controlLayers/components/IPAdapter/IPAdapterMethod.tsx @@ -1,7 +1,7 @@ import type { ComboboxOnChange } from '@invoke-ai/ui-library'; import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui-library'; import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover'; -import type { IPMethodV2} from 'features/controlLayers/store/types'; +import type { IPMethodV2 } from 'features/controlLayers/store/types'; import { isIPMethodV2 } from 'features/controlLayers/store/types'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/controlLayers/components/IPAdapter/IPAdapterModel.tsx b/invokeai/frontend/web/src/features/controlLayers/components/IPAdapter/IPAdapterModel.tsx index 80e322d7f4..047f19d6be 100644 --- a/invokeai/frontend/web/src/features/controlLayers/components/IPAdapter/IPAdapterModel.tsx +++ b/invokeai/frontend/web/src/features/controlLayers/components/IPAdapter/IPAdapterModel.tsx @@ -2,7 +2,7 @@ import type { ComboboxOnChange } from '@invoke-ai/ui-library'; import { Combobox, Flex, FormControl, Tooltip } from '@invoke-ai/ui-library'; import { useAppSelector } from 'app/store/storeHooks'; import { useGroupedModelCombobox } from 'common/hooks/useGroupedModelCombobox'; -import type { CLIPVisionModelV2} from 'features/controlLayers/store/types'; +import type { CLIPVisionModelV2 } from 'features/controlLayers/store/types'; import { isCLIPVisionModelV2 } from 'features/controlLayers/store/types'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/controlLayers/hooks/useCanvasDeleteLayerHotkey.ts b/invokeai/frontend/web/src/features/controlLayers/hooks/useCanvasDeleteLayerHotkey.ts index ca5607c97c..2d248b15ec 100644 --- a/invokeai/frontend/web/src/features/controlLayers/hooks/useCanvasDeleteLayerHotkey.ts +++ b/invokeai/frontend/web/src/features/controlLayers/hooks/useCanvasDeleteLayerHotkey.ts @@ -1,10 +1,7 @@ import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { useAssertSingleton } from 'common/hooks/useAssertSingleton'; -import { - entityDeleted, - selectCanvasV2Slice, -} from 'features/controlLayers/store/canvasV2Slice'; +import { entityDeleted, selectCanvasV2Slice } from 'features/controlLayers/store/canvasV2Slice'; import { useCallback, useMemo } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; diff --git a/invokeai/frontend/web/src/features/controlLayers/hooks/useEntityObjectCount.ts b/invokeai/frontend/web/src/features/controlLayers/hooks/useEntityObjectCount.ts index 53ccc5405c..29f14377ab 100644 --- a/invokeai/frontend/web/src/features/controlLayers/hooks/useEntityObjectCount.ts +++ b/invokeai/frontend/web/src/features/controlLayers/hooks/useEntityObjectCount.ts @@ -1,7 +1,7 @@ import { createSelector } from '@reduxjs/toolkit'; import { useAppSelector } from 'app/store/storeHooks'; import { selectCanvasV2Slice, selectEntity } from 'features/controlLayers/store/canvasV2Slice'; -import { type CanvasEntityIdentifier,isDrawableEntity } from 'features/controlLayers/store/types'; +import { type CanvasEntityIdentifier, isDrawableEntity } from 'features/controlLayers/store/types'; import { useMemo } from 'react'; export const useEntityObjectCount = (entityIdentifier: CanvasEntityIdentifier) => { diff --git a/invokeai/frontend/web/src/features/controlLayers/hooks/useLayerControlAdapter.ts b/invokeai/frontend/web/src/features/controlLayers/hooks/useLayerControlAdapter.ts index 7a4bff4f46..9f876d5e56 100644 --- a/invokeai/frontend/web/src/features/controlLayers/hooks/useLayerControlAdapter.ts +++ b/invokeai/frontend/web/src/features/controlLayers/hooks/useLayerControlAdapter.ts @@ -35,8 +35,7 @@ export const useDefaultControlAdapter = (): ControlNetConfig | T2IAdapterConfig const defaultControlAdapter = useMemo(() => { const compatibleModels = modelConfigs.filter((m) => (baseModel ? m.base === baseModel : true)); const model = compatibleModels[0] ?? modelConfigs[0] ?? null; - const controlAdapter = - model?.type === 't2i_adapter' ? deepClone(initialT2IAdapter) : deepClone(initialControlNet); + const controlAdapter = model?.type === 't2i_adapter' ? deepClone(initialT2IAdapter) : deepClone(initialControlNet); if (model) { controlAdapter.model = zModelIdentifierField.parse(model); diff --git a/invokeai/frontend/web/src/features/controlLayers/store/sessionReducers.ts b/invokeai/frontend/web/src/features/controlLayers/store/sessionReducers.ts index 2d78e0f7f9..8d2aeaeb11 100644 --- a/invokeai/frontend/web/src/features/controlLayers/store/sessionReducers.ts +++ b/invokeai/frontend/web/src/features/controlLayers/store/sessionReducers.ts @@ -1,9 +1,5 @@ import type { PayloadAction, SliceCaseReducers } from '@reduxjs/toolkit'; -import type { - CanvasV2State, - SessionMode, - StagingAreaImage, -} from 'features/controlLayers/store/types'; +import type { CanvasV2State, SessionMode, StagingAreaImage } from 'features/controlLayers/store/types'; export const sessionReducers = { sessionStartedStaging: (state) => { 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 3c2d8578ae..05cca20cf0 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx @@ -195,7 +195,7 @@ const SingleSelectionMenuItems = (props: SingleSelectionMenuItemsProps) => { } onClickCapture={handleSendToUpscale} id="send-to-upscale"> {t('parameters.sendToUpscale')} - + } onClickCapture={handleSendToCanvas} id="send-to-canvas"> {t('parameters.sendToUnifiedCanvas')} diff --git a/invokeai/frontend/web/src/features/metadata/util/recallers.ts b/invokeai/frontend/web/src/features/metadata/util/recallers.ts index e66a98ce06..4b4b6aeba8 100644 --- a/invokeai/frontend/web/src/features/metadata/util/recallers.ts +++ b/invokeai/frontend/web/src/features/metadata/util/recallers.ts @@ -33,10 +33,7 @@ import { setSteps, vaeSelected, } from 'features/controlLayers/store/canvasV2Slice'; -import type { - CanvasRasterLayerState, - LoRA, -} from 'features/controlLayers/store/types'; +import type { CanvasRasterLayerState, LoRA } from 'features/controlLayers/store/types'; import { setHrfEnabled, setHrfMethod, setHrfStrength } from 'features/hrf/store/hrfSlice'; import type { ControlNetConfigMetadata, diff --git a/invokeai/frontend/web/src/features/parameters/components/Prompts/Prompts.tsx b/invokeai/frontend/web/src/features/parameters/components/Prompts/Prompts.tsx index 44286d517b..f0fd3b3afa 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Prompts/Prompts.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Prompts/Prompts.tsx @@ -8,12 +8,9 @@ import { ParamSDXLNegativeStylePrompt } from 'features/sdxl/components/SDXLPromp import { ParamSDXLPositiveStylePrompt } from 'features/sdxl/components/SDXLPrompts/ParamSDXLPositiveStylePrompt'; import { memo } from 'react'; -const concatPromptsSelector = createSelector( - [selectCanvasV2Slice], - (canvasV2) => { - return canvasV2.params.model?.base !== 'sdxl' || canvasV2.params.shouldConcatPrompts; - } -); +const concatPromptsSelector = createSelector([selectCanvasV2Slice], (canvasV2) => { + return canvasV2.params.model?.base !== 'sdxl' || canvasV2.params.shouldConcatPrompts; +}); export const Prompts = memo(() => { const shouldConcatPrompts = useAppSelector(concatPromptsSelector); diff --git a/invokeai/frontend/web/src/features/system/hooks/useFeatureStatus.ts b/invokeai/frontend/web/src/features/system/hooks/useFeatureStatus.ts index 15be057b49..0126d0d94e 100644 --- a/invokeai/frontend/web/src/features/system/hooks/useFeatureStatus.ts +++ b/invokeai/frontend/web/src/features/system/hooks/useFeatureStatus.ts @@ -2,7 +2,7 @@ import { createSelector } from '@reduxjs/toolkit'; import { useAppSelector } from 'app/store/storeHooks'; import type { AppFeature, SDFeature } from 'app/types/invokeai'; import { selectConfigSlice } from 'features/system/store/configSlice'; -import type { TabName } from "features/ui/store/uiTypes"; +import type { TabName } from 'features/ui/store/uiTypes'; import { useMemo } from 'react'; export const useFeatureStatus = (feature: AppFeature | SDFeature | TabName) => { diff --git a/invokeai/frontend/web/src/features/ui/components/AppContent.tsx b/invokeai/frontend/web/src/features/ui/components/AppContent.tsx index 5f36b22b5e..6765fec3f7 100644 --- a/invokeai/frontend/web/src/features/ui/components/AppContent.tsx +++ b/invokeai/frontend/web/src/features/ui/components/AppContent.tsx @@ -19,7 +19,7 @@ import type { UsePanelOptions } from 'features/ui/hooks/usePanel'; import { usePanel } from 'features/ui/hooks/usePanel'; import { usePanelStorage } from 'features/ui/hooks/usePanelStorage'; import { $isGalleryPanelOpen, $isParametersPanelOpen } from 'features/ui/store/uiSlice'; -import type { TabName } from "features/ui/store/uiTypes"; +import type { TabName } from 'features/ui/store/uiTypes'; import type { CSSProperties } from 'react'; import { memo, useMemo, useRef } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; diff --git a/invokeai/frontend/web/src/features/ui/components/TabButton.tsx b/invokeai/frontend/web/src/features/ui/components/TabButton.tsx index 8d7071483c..fa3d5732d7 100644 --- a/invokeai/frontend/web/src/features/ui/components/TabButton.tsx +++ b/invokeai/frontend/web/src/features/ui/components/TabButton.tsx @@ -2,7 +2,7 @@ import { IconButton, Tooltip } from '@invoke-ai/ui-library'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { selectActiveTab } from 'features/ui/store/uiSelectors'; import { setActiveTab } from 'features/ui/store/uiSlice'; -import type { TabName } from "features/ui/store/uiTypes"; +import type { TabName } from 'features/ui/store/uiTypes'; import { memo, type ReactElement, useCallback } from 'react'; export const TabButton = memo(({ tab, icon, label }: { tab: TabName; icon: ReactElement; label: string }) => { diff --git a/invokeai/frontend/web/src/features/ui/components/TabMountGate.tsx b/invokeai/frontend/web/src/features/ui/components/TabMountGate.tsx index 85d8324ea7..5d8224e8f5 100644 --- a/invokeai/frontend/web/src/features/ui/components/TabMountGate.tsx +++ b/invokeai/frontend/web/src/features/ui/components/TabMountGate.tsx @@ -1,7 +1,7 @@ import { createSelector } from '@reduxjs/toolkit'; import { useAppSelector } from 'app/store/storeHooks'; import { selectConfigSlice } from 'features/system/store/configSlice'; -import type { TabName } from "features/ui/store/uiTypes"; +import type { TabName } from 'features/ui/store/uiTypes'; import type { PropsWithChildren } from 'react'; import { memo, useMemo } from 'react'; diff --git a/invokeai/frontend/web/src/features/ui/components/TabVisibilityGate.tsx b/invokeai/frontend/web/src/features/ui/components/TabVisibilityGate.tsx index 1984480430..f790618ca6 100644 --- a/invokeai/frontend/web/src/features/ui/components/TabVisibilityGate.tsx +++ b/invokeai/frontend/web/src/features/ui/components/TabVisibilityGate.tsx @@ -1,6 +1,6 @@ import { Box } from '@invoke-ai/ui-library'; import { useAppSelector } from 'app/store/storeHooks'; -import type { TabName } from "features/ui/store/uiTypes"; +import type { TabName } from 'features/ui/store/uiTypes'; import type { PropsWithChildren } from 'react'; import { memo } from 'react'; diff --git a/invokeai/frontend/web/src/features/ui/store/uiSlice.ts b/invokeai/frontend/web/src/features/ui/store/uiSlice.ts index 32c3485657..092defd869 100644 --- a/invokeai/frontend/web/src/features/ui/store/uiSlice.ts +++ b/invokeai/frontend/web/src/features/ui/store/uiSlice.ts @@ -4,7 +4,7 @@ import type { PersistConfig, RootState } from 'app/store/store'; import { workflowLoadRequested } from 'features/nodes/store/actions'; import { atom } from 'nanostores'; -import type { TabName , UIState } from "./uiTypes"; +import type { TabName, UIState } from './uiTypes'; const initialUIState: UIState = { _version: 2, diff --git a/invokeai/frontend/web/src/features/ui/store/uiTypes.ts b/invokeai/frontend/web/src/features/ui/store/uiTypes.ts index 378626180f..4e863fffdc 100644 --- a/invokeai/frontend/web/src/features/ui/store/uiTypes.ts +++ b/invokeai/frontend/web/src/features/ui/store/uiTypes.ts @@ -1,4 +1,3 @@ - export type TabName = 'generation' | 'upscaling' | 'workflows' | 'models' | 'queue'; export interface UIState {