feat(ui): progress alert config setting

- Add `invocationProgressAlert` as a disable-able feature. Hide the alert and the setting in system settings when disabled.
- Fix merge conflict
This commit is contained in:
psychedelicious
2024-11-14 10:38:52 -08:00
parent 17c7b57145
commit 829bc1bc7d
6 changed files with 31 additions and 13 deletions

View File

@@ -77,7 +77,7 @@ const SettingsMenu = () => {
{t('common.hotkeysLabel')}
</MenuItem>
</HotkeysModal>
<SettingsModal config={{ shouldShowInvocationProgressDetailToggle: false }}>
<SettingsModal>
<MenuItem as="button" icon={<PiToggleRightFill />}>
{t('common.settingsLabel')}
</MenuItem>

View File

@@ -26,6 +26,7 @@ import { SettingsDeveloperLogLevel } from 'features/system/components/SettingsMo
import { SettingsDeveloperLogNamespaces } from 'features/system/components/SettingsModal/SettingsDeveloperLogNamespaces';
import { useClearIntermediates } from 'features/system/components/SettingsModal/useClearIntermediates';
import { StickyScrollable } from 'features/system/components/StickyScrollable';
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
import {
selectSystemShouldAntialiasProgressImage,
selectSystemShouldConfirmOnDelete,
@@ -58,7 +59,6 @@ type ConfigOptions = {
shouldShowResetWebUiText?: boolean;
shouldShowClearIntermediates?: boolean;
shouldShowLocalizationToggle?: boolean;
shouldShowInvocationProgressDetailToggle?: boolean;
};
const defaultConfig: ConfigOptions = {
@@ -66,7 +66,6 @@ const defaultConfig: ConfigOptions = {
shouldShowResetWebUiText: true,
shouldShowClearIntermediates: true,
shouldShowLocalizationToggle: true,
shouldShowInvocationProgressDetailToggle: true,
};
type SettingsModalProps = {
@@ -108,6 +107,7 @@ const SettingsModal = ({ config = defaultConfig, children }: SettingsModalProps)
const shouldEnableModelDescriptions = useAppSelector(selectSystemShouldEnableModelDescriptions);
const shouldConfirmOnNewSession = useAppSelector(selectSystemShouldConfirmOnNewSession);
const shouldShowInvocationProgressDetail = useAppSelector(selectSystemShouldShowInvocationProgressDetail);
const isInvocationProgressAlertEnabled = useFeatureStatus('invocationProgressAlert');
const onToggleConfirmOnNewSession = useCallback(() => {
dispatch(shouldConfirmOnNewSessionToggled());
}, [dispatch]);
@@ -233,7 +233,7 @@ const SettingsModal = ({ config = defaultConfig, children }: SettingsModalProps)
onChange={handleChangeShouldAntialiasProgressImage}
/>
</FormControl>
{Boolean(config?.shouldShowInvocationProgressDetailToggle) && (
{isInvocationProgressAlertEnabled && (
<FormControl>
<FormLabel>{t('settings.showDetailedInvocationProgress')}</FormLabel>
<Switch