From 0792b9175e9b5c8842570a7c9e123e5537b719f3 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 20 Aug 2024 21:08:05 +1000 Subject: [PATCH] feat(ui): sort log namespaces --- invokeai/frontend/web/src/app/logging/logger.ts | 14 +++++++------- .../SettingsDeveloperLogNamespaces.tsx | 4 ++-- .../web/src/features/system/store/systemSlice.ts | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/invokeai/frontend/web/src/app/logging/logger.ts b/invokeai/frontend/web/src/app/logging/logger.ts index d8450db8bb..074e657630 100644 --- a/invokeai/frontend/web/src/app/logging/logger.ts +++ b/invokeai/frontend/web/src/app/logging/logger.ts @@ -16,16 +16,16 @@ export const BASE_CONTEXT = {}; export const $logger = atom(Roarr.child(BASE_CONTEXT)); export const zLogNamespace = z.enum([ - 'gallery', - 'models', - 'config', 'canvas', - 'generation', - 'workflows', - 'system', + 'config', 'events', - 'queue', + 'gallery', + 'generation', 'metadata', + 'models', + 'system', + 'queue', + 'workflows', ]); const zLogNamespacesArray = z.array(zLogNamespace); export type LogNamespace = z.infer; diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsDeveloperLogNamespaces.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsDeveloperLogNamespaces.tsx index a0f4b63aff..c3e7d58d74 100644 --- a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsDeveloperLogNamespaces.tsx +++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsDeveloperLogNamespaces.tsx @@ -15,11 +15,11 @@ export const SettingsDeveloperLogNamespaces = memo(() => { if (s.system.logNamespaces.length === 0) { return EMPTY_ARRAY; } else { - return s.system.logNamespaces.toSorted(); + return s.system.logNamespaces; } }); const disabledLogNamespaces = useMemo( - () => difference(zLogNamespace.options, enabledLogNamespaces).toSorted(), + () => difference(zLogNamespace.options, enabledLogNamespaces), [enabledLogNamespaces] ); diff --git a/invokeai/frontend/web/src/features/system/store/systemSlice.ts b/invokeai/frontend/web/src/features/system/store/systemSlice.ts index 44b5af7ea4..c10c9635ec 100644 --- a/invokeai/frontend/web/src/features/system/store/systemSlice.ts +++ b/invokeai/frontend/web/src/features/system/store/systemSlice.ts @@ -35,9 +35,9 @@ export const systemSlice = createSlice({ }, logNamespaceToggled: (state, action: PayloadAction) => { if (state.logNamespaces.includes(action.payload)) { - state.logNamespaces = uniq(state.logNamespaces.filter((n) => n !== action.payload)); + state.logNamespaces = uniq(state.logNamespaces.filter((n) => n !== action.payload)).toSorted(); } else { - state.logNamespaces = uniq([...state.logNamespaces, action.payload]); + state.logNamespaces = uniq([...state.logNamespaces, action.payload]).toSorted(); } }, shouldAntialiasProgressImageChanged: (state, action: PayloadAction) => {