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?
This commit is contained in:
chainchompa 2023-09-20 18:12:50 -04:00 committed by GitHub
commit 6ec347bd41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 48 additions and 45 deletions

View File

@ -32,15 +32,15 @@ function IAIInformationalPopover({
children, children,
placement, placement,
}: Props): JSX.Element { }: Props): JSX.Element {
const shouldDisableInformationalPopovers = useAppSelector( const shouldEnableInformationalPopovers = useAppSelector(
(state) => state.system.shouldDisableInformationalPopovers (state) => state.system.shouldEnableInformationalPopovers
); );
const { t } = useTranslation(); const { t } = useTranslation();
const heading = t(`popovers.${details}.heading`); const heading = t(`popovers.${details}.heading`);
const paragraph = t(`popovers.${details}.paragraph`); const paragraph = t(`popovers.${details}.paragraph`);
if (shouldDisableInformationalPopovers) { if (!shouldEnableInformationalPopovers) {
return children; return children;
} else { } else {
return ( return (

View File

@ -1,4 +1,4 @@
import { Flex, Spacer, Text } from '@chakra-ui/react'; import { Box, Flex, Spacer, Text } from '@chakra-ui/react';
import { createSelector } from '@reduxjs/toolkit'; import { createSelector } from '@reduxjs/toolkit';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import IAIIconButton from 'common/components/IAIIconButton'; import IAIIconButton from 'common/components/IAIIconButton';
@ -94,20 +94,22 @@ export default function ParamBoundingBoxSize() {
}} }}
> >
<Flex alignItems="center" gap={2}> <Flex alignItems="center" gap={2}>
<IAIInformationalPopover details="paramRatio"> <Box width="full">
<Text <IAIInformationalPopover details="paramRatio">
sx={{ <Text
fontSize: 'sm', sx={{
width: 'full', fontSize: 'sm',
color: 'base.700', width: 'full',
_dark: { color: 'base.700',
color: 'base.300', _dark: {
}, color: 'base.300',
}} },
> }}
{t('parameters.aspectRatio')} >
</Text> {t('parameters.aspectRatio')}
</IAIInformationalPopover> </Text>
</IAIInformationalPopover>
</Box>
<Spacer /> <Spacer />
<ParamAspectRatio /> <ParamAspectRatio />
<IAIIconButton <IAIIconButton

View File

@ -1,4 +1,4 @@
import { Flex, Spacer, Text } from '@chakra-ui/react'; import { Box, Flex, Spacer, Text } from '@chakra-ui/react';
import { createSelector } from '@reduxjs/toolkit'; import { createSelector } from '@reduxjs/toolkit';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import IAIIconButton from 'common/components/IAIIconButton'; import IAIIconButton from 'common/components/IAIIconButton';
@ -84,20 +84,21 @@ export default function ParamSize() {
}} }}
> >
<Flex alignItems="center" gap={2}> <Flex alignItems="center" gap={2}>
<IAIInformationalPopover details="paramRatio"> <Box width="full">
<Text <IAIInformationalPopover details="paramRatio">
sx={{ <Text
fontSize: 'sm', sx={{
width: 'full', fontSize: 'sm',
color: 'base.700', color: 'base.700',
_dark: { _dark: {
color: 'base.300', color: 'base.300',
}, },
}} }}
> >
{t('parameters.aspectRatio')} {t('parameters.aspectRatio')}
</Text> </Text>
</IAIInformationalPopover> </IAIInformationalPopover>
</Box>
<Spacer /> <Spacer />
<ParamAspectRatio /> <ParamAspectRatio />
<IAIIconButton <IAIIconButton

View File

@ -23,7 +23,7 @@ import {
consoleLogLevelChanged, consoleLogLevelChanged,
setEnableImageDebugging, setEnableImageDebugging,
setShouldConfirmOnDelete, setShouldConfirmOnDelete,
setShouldDisableInformationalPopovers, setShouldEnableInformationalPopovers,
shouldAntialiasProgressImageChanged, shouldAntialiasProgressImageChanged,
shouldLogToConsoleChanged, shouldLogToConsoleChanged,
shouldUseNSFWCheckerChanged, shouldUseNSFWCheckerChanged,
@ -67,7 +67,7 @@ const selector = createSelector(
shouldAntialiasProgressImage, shouldAntialiasProgressImage,
shouldUseNSFWChecker, shouldUseNSFWChecker,
shouldUseWatermarker, shouldUseWatermarker,
shouldDisableInformationalPopovers, shouldEnableInformationalPopovers,
} = system; } = system;
const { const {
@ -87,7 +87,7 @@ const selector = createSelector(
shouldUseNSFWChecker, shouldUseNSFWChecker,
shouldUseWatermarker, shouldUseWatermarker,
shouldAutoChangeDimensions, shouldAutoChangeDimensions,
shouldDisableInformationalPopovers, shouldEnableInformationalPopovers,
}; };
}, },
{ {
@ -161,7 +161,7 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
shouldUseNSFWChecker, shouldUseNSFWChecker,
shouldUseWatermarker, shouldUseWatermarker,
shouldAutoChangeDimensions, shouldAutoChangeDimensions,
shouldDisableInformationalPopovers, shouldEnableInformationalPopovers,
} = useAppSelector(selector); } = useAppSelector(selector);
const handleClickResetWebUI = useCallback(() => { const handleClickResetWebUI = useCallback(() => {
@ -312,11 +312,11 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
/> />
)} )}
<SettingSwitch <SettingSwitch
label="Disable informational popovers" label="Enable informational popovers"
isChecked={shouldDisableInformationalPopovers} isChecked={shouldEnableInformationalPopovers}
onChange={(e: ChangeEvent<HTMLInputElement>) => onChange={(e: ChangeEvent<HTMLInputElement>) =>
dispatch( dispatch(
setShouldDisableInformationalPopovers(e.target.checked) setShouldEnableInformationalPopovers(e.target.checked)
) )
} }
/> />

View File

@ -35,7 +35,7 @@ export const initialSystemState: SystemState = {
language: 'en', language: 'en',
shouldUseNSFWChecker: false, shouldUseNSFWChecker: false,
shouldUseWatermarker: false, shouldUseWatermarker: false,
shouldDisableInformationalPopovers: false, shouldEnableInformationalPopovers: false,
status: 'DISCONNECTED', status: 'DISCONNECTED',
}; };
@ -76,11 +76,11 @@ export const systemSlice = createSlice({
shouldUseWatermarkerChanged(state, action: PayloadAction<boolean>) { shouldUseWatermarkerChanged(state, action: PayloadAction<boolean>) {
state.shouldUseWatermarker = action.payload; state.shouldUseWatermarker = action.payload;
}, },
setShouldDisableInformationalPopovers( setShouldEnableInformationalPopovers(
state, state,
action: PayloadAction<boolean> action: PayloadAction<boolean>
) { ) {
state.shouldDisableInformationalPopovers = action.payload; state.shouldEnableInformationalPopovers = action.payload;
}, },
}, },
extraReducers(builder) { extraReducers(builder) {
@ -241,7 +241,7 @@ export const {
languageChanged, languageChanged,
shouldUseNSFWCheckerChanged, shouldUseNSFWCheckerChanged,
shouldUseWatermarkerChanged, shouldUseWatermarkerChanged,
setShouldDisableInformationalPopovers, setShouldEnableInformationalPopovers,
} = systemSlice.actions; } = systemSlice.actions;
export default systemSlice.reducer; export default systemSlice.reducer;

View File

@ -33,7 +33,7 @@ export interface SystemState {
shouldUseNSFWChecker: boolean; shouldUseNSFWChecker: boolean;
shouldUseWatermarker: boolean; shouldUseWatermarker: boolean;
status: SystemStatus; status: SystemStatus;
shouldDisableInformationalPopovers: boolean; shouldEnableInformationalPopovers: boolean;
} }
export const LANGUAGES = { export const LANGUAGES = {