mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): remove canvas beta layout
This commit is contained in:
parent
cfee02b753
commit
05c939d41e
@ -31,7 +31,6 @@ import {
|
|||||||
} from 'features/system/store/systemSlice';
|
} from 'features/system/store/systemSlice';
|
||||||
import {
|
import {
|
||||||
setShouldShowProgressInViewer,
|
setShouldShowProgressInViewer,
|
||||||
setShouldUseCanvasBetaLayout,
|
|
||||||
setShouldUseSliders,
|
setShouldUseSliders,
|
||||||
} from 'features/ui/store/uiSlice';
|
} from 'features/ui/store/uiSlice';
|
||||||
import { isEqual } from 'lodash-es';
|
import { isEqual } from 'lodash-es';
|
||||||
@ -69,18 +68,13 @@ const selector = createSelector(
|
|||||||
shouldUseWatermarker,
|
shouldUseWatermarker,
|
||||||
} = system;
|
} = system;
|
||||||
|
|
||||||
const {
|
const { shouldUseSliders, shouldShowProgressInViewer } = ui;
|
||||||
shouldUseCanvasBetaLayout,
|
|
||||||
shouldUseSliders,
|
|
||||||
shouldShowProgressInViewer,
|
|
||||||
} = ui;
|
|
||||||
|
|
||||||
const { shouldShowAdvancedOptions } = generation;
|
const { shouldShowAdvancedOptions } = generation;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
shouldConfirmOnDelete,
|
shouldConfirmOnDelete,
|
||||||
enableImageDebugging,
|
enableImageDebugging,
|
||||||
shouldUseCanvasBetaLayout,
|
|
||||||
shouldUseSliders,
|
shouldUseSliders,
|
||||||
shouldShowProgressInViewer,
|
shouldShowProgressInViewer,
|
||||||
consoleLogLevel,
|
consoleLogLevel,
|
||||||
@ -99,7 +93,6 @@ const selector = createSelector(
|
|||||||
type ConfigOptions = {
|
type ConfigOptions = {
|
||||||
shouldShowDeveloperSettings: boolean;
|
shouldShowDeveloperSettings: boolean;
|
||||||
shouldShowResetWebUiText: boolean;
|
shouldShowResetWebUiText: boolean;
|
||||||
shouldShowBetaLayout: boolean;
|
|
||||||
shouldShowAdvancedOptionsSettings: boolean;
|
shouldShowAdvancedOptionsSettings: boolean;
|
||||||
shouldShowClearIntermediates: boolean;
|
shouldShowClearIntermediates: boolean;
|
||||||
shouldShowLocalizationToggle: boolean;
|
shouldShowLocalizationToggle: boolean;
|
||||||
@ -116,7 +109,6 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [countdown, setCountdown] = useState(3);
|
const [countdown, setCountdown] = useState(3);
|
||||||
|
|
||||||
const shouldShowBetaLayout = config?.shouldShowBetaLayout ?? true;
|
|
||||||
const shouldShowDeveloperSettings =
|
const shouldShowDeveloperSettings =
|
||||||
config?.shouldShowDeveloperSettings ?? true;
|
config?.shouldShowDeveloperSettings ?? true;
|
||||||
const shouldShowResetWebUiText = config?.shouldShowResetWebUiText ?? true;
|
const shouldShowResetWebUiText = config?.shouldShowResetWebUiText ?? true;
|
||||||
@ -158,7 +150,6 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
|
|||||||
const {
|
const {
|
||||||
shouldConfirmOnDelete,
|
shouldConfirmOnDelete,
|
||||||
enableImageDebugging,
|
enableImageDebugging,
|
||||||
shouldUseCanvasBetaLayout,
|
|
||||||
shouldUseSliders,
|
shouldUseSliders,
|
||||||
shouldShowProgressInViewer,
|
shouldShowProgressInViewer,
|
||||||
consoleLogLevel,
|
consoleLogLevel,
|
||||||
@ -306,17 +297,6 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{shouldShowBetaLayout && (
|
|
||||||
<SettingSwitch
|
|
||||||
label={t('settings.alternateCanvasLayout')}
|
|
||||||
useBadge
|
|
||||||
badgeLabel={t('settings.beta')}
|
|
||||||
isChecked={shouldUseCanvasBetaLayout}
|
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
|
||||||
dispatch(setShouldUseCanvasBetaLayout(e.target.checked))
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{shouldShowLocalizationToggle && (
|
{shouldShowLocalizationToggle && (
|
||||||
<IAIMantineSelect
|
<IAIMantineSelect
|
||||||
disabled={!isLocalizationEnabled}
|
disabled={!isLocalizationEnabled}
|
||||||
|
@ -1,29 +1,24 @@
|
|||||||
import { Box, Flex } from '@chakra-ui/react';
|
import { Box, Flex } from '@chakra-ui/react';
|
||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
|
import { stateSelector } from 'app/store/store';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions';
|
import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions';
|
||||||
import IAIDropOverlay from 'common/components/IAIDropOverlay';
|
import IAIDropOverlay from 'common/components/IAIDropOverlay';
|
||||||
import IAICanvas from 'features/canvas/components/IAICanvas';
|
import IAICanvas from 'features/canvas/components/IAICanvas';
|
||||||
import IAICanvasResizer from 'features/canvas/components/IAICanvasResizer';
|
import IAICanvasResizer from 'features/canvas/components/IAICanvasResizer';
|
||||||
import IAICanvasToolbar from 'features/canvas/components/IAICanvasToolbar/IAICanvasToolbar';
|
import IAICanvasToolbar from 'features/canvas/components/IAICanvasToolbar/IAICanvasToolbar';
|
||||||
import { canvasSelector } from 'features/canvas/store/canvasSelectors';
|
|
||||||
import { requestCanvasRescale } from 'features/canvas/store/thunks/requestCanvasScale';
|
import { requestCanvasRescale } from 'features/canvas/store/thunks/requestCanvasScale';
|
||||||
import { useDroppableTypesafe } from 'features/dnd/hooks/typesafeHooks';
|
import { useDroppableTypesafe } from 'features/dnd/hooks/typesafeHooks';
|
||||||
import { CanvasInitialImageDropData } from 'features/dnd/types';
|
import { CanvasInitialImageDropData } from 'features/dnd/types';
|
||||||
import { isValidDrop } from 'features/dnd/util/isValidDrop';
|
import { isValidDrop } from 'features/dnd/util/isValidDrop';
|
||||||
import { uiSelector } from 'features/ui/store/uiSelectors';
|
|
||||||
import { memo, useLayoutEffect } from 'react';
|
import { memo, useLayoutEffect } from 'react';
|
||||||
import UnifiedCanvasToolSettingsBeta from './UnifiedCanvasBeta/UnifiedCanvasToolSettingsBeta';
|
|
||||||
import UnifiedCanvasToolbarBeta from './UnifiedCanvasBeta/UnifiedCanvasToolbarBeta';
|
|
||||||
|
|
||||||
const selector = createSelector(
|
const selector = createSelector(
|
||||||
[canvasSelector, uiSelector],
|
[stateSelector],
|
||||||
(canvas, ui) => {
|
({ canvas }) => {
|
||||||
const { doesCanvasNeedScaling } = canvas;
|
const { doesCanvasNeedScaling } = canvas;
|
||||||
const { shouldUseCanvasBetaLayout } = ui;
|
|
||||||
return {
|
return {
|
||||||
doesCanvasNeedScaling,
|
doesCanvasNeedScaling,
|
||||||
shouldUseCanvasBetaLayout,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
defaultSelectorOptions
|
defaultSelectorOptions
|
||||||
@ -37,8 +32,7 @@ const droppableData: CanvasInitialImageDropData = {
|
|||||||
const UnifiedCanvasContent = () => {
|
const UnifiedCanvasContent = () => {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
const { doesCanvasNeedScaling, shouldUseCanvasBetaLayout } =
|
const { doesCanvasNeedScaling } = useAppSelector(selector);
|
||||||
useAppSelector(selector);
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
isOver,
|
isOver,
|
||||||
@ -59,52 +53,6 @@ const UnifiedCanvasContent = () => {
|
|||||||
return () => window.removeEventListener('resize', resizeCallback);
|
return () => window.removeEventListener('resize', resizeCallback);
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
|
|
||||||
if (shouldUseCanvasBetaLayout) {
|
|
||||||
return (
|
|
||||||
<Box
|
|
||||||
layerStyle="first"
|
|
||||||
ref={setDroppableRef}
|
|
||||||
tabIndex={0}
|
|
||||||
sx={{
|
|
||||||
w: 'full',
|
|
||||||
h: 'full',
|
|
||||||
p: 4,
|
|
||||||
borderRadius: 'base',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Flex
|
|
||||||
sx={{
|
|
||||||
w: 'full',
|
|
||||||
h: 'full',
|
|
||||||
gap: 4,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<UnifiedCanvasToolbarBeta />
|
|
||||||
<Flex
|
|
||||||
sx={{
|
|
||||||
flexDir: 'column',
|
|
||||||
w: 'full',
|
|
||||||
h: 'full',
|
|
||||||
gap: 4,
|
|
||||||
position: 'relative',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<UnifiedCanvasToolSettingsBeta />
|
|
||||||
<Box sx={{ w: 'full', h: 'full', position: 'relative' }}>
|
|
||||||
{doesCanvasNeedScaling ? <IAICanvasResizer /> : <IAICanvas />}
|
|
||||||
{isValidDrop(droppableData, active) && (
|
|
||||||
<IAIDropOverlay
|
|
||||||
isOver={isOver}
|
|
||||||
label="Set Canvas Initial Image"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Box>
|
|
||||||
</Flex>
|
|
||||||
</Flex>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
ref={setDroppableRef}
|
ref={setDroppableRef}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user