Fixes bugs/styling

- Fixes missing web app state on new version:
Adds stateReconciler to redux-persist.

When we add more values to the state and then release the update app, they will be automatically merged in.

Reseting web UI will be needed far less.
7159ec

- Fixes console z-index
- Moves reset web UI button to visible area
This commit is contained in:
psychedelicious 2022-11-01 10:54:59 +11:00 committed by Lincoln Stein
parent 99bb9491ac
commit b4e3f771e0
9 changed files with 550 additions and 525 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

517
frontend/dist/assets/index.c37c72e0.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>InvokeAI - A Stable Diffusion Toolkit</title>
<link rel="shortcut icon" type="icon" href="./assets/favicon.0d253ced.ico" />
<script type="module" crossorigin src="./assets/index.044a626e.js"></script>
<link rel="stylesheet" href="./assets/index.52c8231e.css">
<script type="module" crossorigin src="./assets/index.c37c72e0.js"></script>
<link rel="stylesheet" href="./assets/index.354e501b.css">
</head>
<body>

View File

@ -5,12 +5,16 @@ import type { TypedUseSelectorHook } from 'react-redux';
import { persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage'; // defaults to localStorage for web
import optionsReducer from '../features/options/optionsSlice';
import galleryReducer from '../features/gallery/gallerySlice';
import inpaintingReducer from '../features/tabs/Inpainting/inpaintingSlice';
import optionsReducer, { OptionsState } from '../features/options/optionsSlice';
import galleryReducer, { GalleryState } from '../features/gallery/gallerySlice';
import inpaintingReducer, {
InpaintingState,
} from '../features/tabs/Inpainting/inpaintingSlice';
import systemReducer from '../features/system/systemSlice';
import systemReducer, { SystemState } from '../features/system/systemSlice';
import { socketioMiddleware } from './socketio/middleware';
import autoMergeLevel2 from 'redux-persist/es/stateReconciler/autoMergeLevel2';
import { PersistPartial } from 'redux-persist/es/persistReducer';
/**
* redux-persist provides an easy and reliable way to persist state across reloads.
@ -33,12 +37,14 @@ import { socketioMiddleware } from './socketio/middleware';
const rootPersistConfig = {
key: 'root',
storage,
stateReconciler: autoMergeLevel2,
blacklist: ['gallery', 'system', 'inpainting'],
};
const systemPersistConfig = {
key: 'system',
storage,
stateReconciler: autoMergeLevel2,
blacklist: [
'isCancelable',
'isConnected',
@ -58,6 +64,7 @@ const systemPersistConfig = {
const galleryPersistConfig = {
key: 'gallery',
storage,
stateReconciler: autoMergeLevel2,
whitelist: [
'galleryWidth',
'shouldPinGallery',
@ -71,17 +78,26 @@ const galleryPersistConfig = {
const inpaintingPersistConfig = {
key: 'inpainting',
storage,
stateReconciler: autoMergeLevel2,
blacklist: ['pastLines', 'futuresLines', 'cursorPosition'],
};
const reducers = combineReducers({
options: optionsReducer,
gallery: persistReducer(galleryPersistConfig, galleryReducer),
system: persistReducer(systemPersistConfig, systemReducer),
inpainting: persistReducer(inpaintingPersistConfig, inpaintingReducer),
gallery: persistReducer<GalleryState>(galleryPersistConfig, galleryReducer),
system: persistReducer<SystemState>(systemPersistConfig, systemReducer),
inpainting: persistReducer<InpaintingState>(
inpaintingPersistConfig,
inpaintingReducer
),
});
const persistedReducer = persistReducer(rootPersistConfig, reducers);
const persistedReducer = persistReducer<{
options: OptionsState;
gallery: GalleryState & PersistPartial;
system: SystemState & PersistPartial;
inpainting: InpaintingState & PersistPartial;
}>(rootPersistConfig, reducers);
// Continue with store setup
export const store = configureStore({

View File

@ -1,10 +1,3 @@
.console-resizable {
display: flex;
position: fixed;
left: 0;
bottom: 0;
}
.console {
width: 100vw;
display: flex;
@ -48,7 +41,7 @@
position: fixed !important;
left: 0.5rem;
bottom: 0.5rem;
z-index: 21;
z-index: 10000;
&:hover {
background: var(--console-icon-button-bg-color-hover) !important;
@ -67,7 +60,7 @@
position: fixed !important;
left: 0.5rem;
bottom: 3rem;
z-index: 21;
z-index: 10000;
&:hover {
background: var(--console-icon-button-bg-color-hover) !important;

View File

@ -99,7 +99,7 @@ const Console = () => {
position: 'fixed',
left: 0,
bottom: 0,
zIndex: 20,
zIndex: 9999,
}}
maxHeight={'90vh'}
>

View File

@ -126,6 +126,9 @@ const SettingsModal = ({ children }: SettingsModalProps) => {
<div className="settings-modal-reset">
<Heading size={'md'}>Reset Web UI</Heading>
<Button colorScheme="red" onClick={handleClickResetWebUI}>
Reset Web UI
</Button>
<Text>
Resetting the web UI only resets the browser's local cache of
your images and remembered settings. It does not delete any
@ -136,9 +139,6 @@ const SettingsModal = ({ children }: SettingsModalProps) => {
isn't working, please try resetting before submitting an issue
on GitHub.
</Text>
<Button colorScheme="red" onClick={handleClickResetWebUI}>
Reset Web UI
</Button>
</div>
</ModalBody>