Skip to content

Commit 6ec347b

Browse files
authored
set default for informational popups to be disabled (#4611)
## What type of PR is this? (check all applicable) - [ ] Refactor - [ ] Feature - [x] Bug Fix - [ ] Optimization - [ ] Documentation Update - [ ] Community Node Submission ## Have you discussed this change with the InvokeAI team? - [x] Yes - [ ] No, because: ## Have you updated all relevant documentation? - [ ] Yes - [ ] No ## Description ## Related Tickets & Documents <!-- For pull requests that relate or close an issue, please include them below. For example having the text: "closes #1234" would connect the current pull request to issue 1234. And when we merge the pull request, Github will automatically close the issue. --> - Related Issue # - Closes # ## QA Instructions, Screenshots, Recordings <!-- Please provide steps on how to test changes, any hardware or software specifications as well as any other pertinent information. --> ## Added/updated tests? - [ ] Yes - [ ] No : _please replace this line with details on why tests have not been included_ ## [optional] Are there any post deployment tasks we need to perform?
2 parents 0960518 + e54843a commit 6ec347b

File tree

6 files changed

+48
-45
lines changed

6 files changed

+48
-45
lines changed

invokeai/frontend/web/src/common/components/IAIInformationalPopover.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ function IAIInformationalPopover({
3232
children,
3333
placement,
3434
}: Props): JSX.Element {
35-
const shouldDisableInformationalPopovers = useAppSelector(
36-
(state) => state.system.shouldDisableInformationalPopovers
35+
const shouldEnableInformationalPopovers = useAppSelector(
36+
(state) => state.system.shouldEnableInformationalPopovers
3737
);
3838
const { t } = useTranslation();
3939

4040
const heading = t(`popovers.${details}.heading`);
4141
const paragraph = t(`popovers.${details}.paragraph`);
4242

43-
if (shouldDisableInformationalPopovers) {
43+
if (!shouldEnableInformationalPopovers) {
4444
return children;
4545
} else {
4646
return (

invokeai/frontend/web/src/features/parameters/components/Parameters/Canvas/BoundingBox/ParamBoundingBoxSize.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Flex, Spacer, Text } from '@chakra-ui/react';
1+
import { Box, Flex, Spacer, Text } from '@chakra-ui/react';
22
import { createSelector } from '@reduxjs/toolkit';
33
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
44
import IAIIconButton from 'common/components/IAIIconButton';
@@ -94,20 +94,22 @@ export default function ParamBoundingBoxSize() {
9494
}}
9595
>
9696
<Flex alignItems="center" gap={2}>
97-
<IAIInformationalPopover details="paramRatio">
98-
<Text
99-
sx={{
100-
fontSize: 'sm',
101-
width: 'full',
102-
color: 'base.700',
103-
_dark: {
104-
color: 'base.300',
105-
},
106-
}}
107-
>
108-
{t('parameters.aspectRatio')}
109-
</Text>
110-
</IAIInformationalPopover>
97+
<Box width="full">
98+
<IAIInformationalPopover details="paramRatio">
99+
<Text
100+
sx={{
101+
fontSize: 'sm',
102+
width: 'full',
103+
color: 'base.700',
104+
_dark: {
105+
color: 'base.300',
106+
},
107+
}}
108+
>
109+
{t('parameters.aspectRatio')}
110+
</Text>
111+
</IAIInformationalPopover>
112+
</Box>
111113
<Spacer />
112114
<ParamAspectRatio />
113115
<IAIIconButton

invokeai/frontend/web/src/features/parameters/components/Parameters/Core/ParamSize.tsx

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Flex, Spacer, Text } from '@chakra-ui/react';
1+
import { Box, Flex, Spacer, Text } from '@chakra-ui/react';
22
import { createSelector } from '@reduxjs/toolkit';
33
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
44
import IAIIconButton from 'common/components/IAIIconButton';
@@ -84,20 +84,21 @@ export default function ParamSize() {
8484
}}
8585
>
8686
<Flex alignItems="center" gap={2}>
87-
<IAIInformationalPopover details="paramRatio">
88-
<Text
89-
sx={{
90-
fontSize: 'sm',
91-
width: 'full',
92-
color: 'base.700',
93-
_dark: {
94-
color: 'base.300',
95-
},
96-
}}
97-
>
98-
{t('parameters.aspectRatio')}
99-
</Text>
100-
</IAIInformationalPopover>
87+
<Box width="full">
88+
<IAIInformationalPopover details="paramRatio">
89+
<Text
90+
sx={{
91+
fontSize: 'sm',
92+
color: 'base.700',
93+
_dark: {
94+
color: 'base.300',
95+
},
96+
}}
97+
>
98+
{t('parameters.aspectRatio')}
99+
</Text>
100+
</IAIInformationalPopover>
101+
</Box>
101102
<Spacer />
102103
<ParamAspectRatio />
103104
<IAIIconButton

invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
consoleLogLevelChanged,
2424
setEnableImageDebugging,
2525
setShouldConfirmOnDelete,
26-
setShouldDisableInformationalPopovers,
26+
setShouldEnableInformationalPopovers,
2727
shouldAntialiasProgressImageChanged,
2828
shouldLogToConsoleChanged,
2929
shouldUseNSFWCheckerChanged,
@@ -67,7 +67,7 @@ const selector = createSelector(
6767
shouldAntialiasProgressImage,
6868
shouldUseNSFWChecker,
6969
shouldUseWatermarker,
70-
shouldDisableInformationalPopovers,
70+
shouldEnableInformationalPopovers,
7171
} = system;
7272

7373
const {
@@ -87,7 +87,7 @@ const selector = createSelector(
8787
shouldUseNSFWChecker,
8888
shouldUseWatermarker,
8989
shouldAutoChangeDimensions,
90-
shouldDisableInformationalPopovers,
90+
shouldEnableInformationalPopovers,
9191
};
9292
},
9393
{
@@ -161,7 +161,7 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
161161
shouldUseNSFWChecker,
162162
shouldUseWatermarker,
163163
shouldAutoChangeDimensions,
164-
shouldDisableInformationalPopovers,
164+
shouldEnableInformationalPopovers,
165165
} = useAppSelector(selector);
166166

167167
const handleClickResetWebUI = useCallback(() => {
@@ -312,11 +312,11 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
312312
/>
313313
)}
314314
<SettingSwitch
315-
label="Disable informational popovers"
316-
isChecked={shouldDisableInformationalPopovers}
315+
label="Enable informational popovers"
316+
isChecked={shouldEnableInformationalPopovers}
317317
onChange={(e: ChangeEvent<HTMLInputElement>) =>
318318
dispatch(
319-
setShouldDisableInformationalPopovers(e.target.checked)
319+
setShouldEnableInformationalPopovers(e.target.checked)
320320
)
321321
}
322322
/>

invokeai/frontend/web/src/features/system/store/systemSlice.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const initialSystemState: SystemState = {
3535
language: 'en',
3636
shouldUseNSFWChecker: false,
3737
shouldUseWatermarker: false,
38-
shouldDisableInformationalPopovers: false,
38+
shouldEnableInformationalPopovers: false,
3939
status: 'DISCONNECTED',
4040
};
4141

@@ -76,11 +76,11 @@ export const systemSlice = createSlice({
7676
shouldUseWatermarkerChanged(state, action: PayloadAction<boolean>) {
7777
state.shouldUseWatermarker = action.payload;
7878
},
79-
setShouldDisableInformationalPopovers(
79+
setShouldEnableInformationalPopovers(
8080
state,
8181
action: PayloadAction<boolean>
8282
) {
83-
state.shouldDisableInformationalPopovers = action.payload;
83+
state.shouldEnableInformationalPopovers = action.payload;
8484
},
8585
},
8686
extraReducers(builder) {
@@ -241,7 +241,7 @@ export const {
241241
languageChanged,
242242
shouldUseNSFWCheckerChanged,
243243
shouldUseWatermarkerChanged,
244-
setShouldDisableInformationalPopovers,
244+
setShouldEnableInformationalPopovers,
245245
} = systemSlice.actions;
246246

247247
export default systemSlice.reducer;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface SystemState {
3333
shouldUseNSFWChecker: boolean;
3434
shouldUseWatermarker: boolean;
3535
status: SystemStatus;
36-
shouldDisableInformationalPopovers: boolean;
36+
shouldEnableInformationalPopovers: boolean;
3737
}
3838

3939
export const LANGUAGES = {

0 commit comments

Comments
 (0)