diff --git a/browser_tests/copyPaste.spec.ts-snapshots/copied-node-chromium-linux.png b/browser_tests/copyPaste.spec.ts-snapshots/copied-node-chromium-linux.png index c889c8ec4..33b55ae7d 100644 Binary files a/browser_tests/copyPaste.spec.ts-snapshots/copied-node-chromium-linux.png and b/browser_tests/copyPaste.spec.ts-snapshots/copied-node-chromium-linux.png differ diff --git a/browser_tests/copyPaste.spec.ts-snapshots/no-node-copied-chromium-linux.png b/browser_tests/copyPaste.spec.ts-snapshots/no-node-copied-chromium-linux.png index bbd6f22a9..2e134d053 100644 Binary files a/browser_tests/copyPaste.spec.ts-snapshots/no-node-copied-chromium-linux.png and b/browser_tests/copyPaste.spec.ts-snapshots/no-node-copied-chromium-linux.png differ diff --git a/browser_tests/copyPaste.spec.ts-snapshots/paste-in-text-area-with-node-previously-copied-chromium-linux.png b/browser_tests/copyPaste.spec.ts-snapshots/paste-in-text-area-with-node-previously-copied-chromium-linux.png index 078bb04ae..f80a80aaa 100644 Binary files a/browser_tests/copyPaste.spec.ts-snapshots/paste-in-text-area-with-node-previously-copied-chromium-linux.png and b/browser_tests/copyPaste.spec.ts-snapshots/paste-in-text-area-with-node-previously-copied-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/adjusted-widget-value-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/adjusted-widget-value-chromium-linux.png index 8296c599c..b1b8a1efe 100644 Binary files a/browser_tests/interaction.spec.ts-snapshots/adjusted-widget-value-chromium-linux.png and b/browser_tests/interaction.spec.ts-snapshots/adjusted-widget-value-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/default-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/default-chromium-linux.png index bbd6f22a9..2e134d053 100644 Binary files a/browser_tests/interaction.spec.ts-snapshots/default-chromium-linux.png and b/browser_tests/interaction.spec.ts-snapshots/default-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/disconnected-edge-with-menu-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/disconnected-edge-with-menu-chromium-linux.png index fbb8c6c57..0f90acd57 100644 Binary files a/browser_tests/interaction.spec.ts-snapshots/disconnected-edge-with-menu-chromium-linux.png and b/browser_tests/interaction.spec.ts-snapshots/disconnected-edge-with-menu-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/panned-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/panned-chromium-linux.png index f501ef88b..83deac9d7 100644 Binary files a/browser_tests/interaction.spec.ts-snapshots/panned-chromium-linux.png and b/browser_tests/interaction.spec.ts-snapshots/panned-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/selected-node1-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/selected-node1-chromium-linux.png index 73089aa21..a7dec06e6 100644 Binary files a/browser_tests/interaction.spec.ts-snapshots/selected-node1-chromium-linux.png and b/browser_tests/interaction.spec.ts-snapshots/selected-node1-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/selected-node2-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/selected-node2-chromium-linux.png index 17e635f2a..b1c3569e4 100644 Binary files a/browser_tests/interaction.spec.ts-snapshots/selected-node2-chromium-linux.png and b/browser_tests/interaction.spec.ts-snapshots/selected-node2-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/zoomed-in-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/zoomed-in-chromium-linux.png index 1e0bb1aa0..944d42014 100644 Binary files a/browser_tests/interaction.spec.ts-snapshots/zoomed-in-chromium-linux.png and b/browser_tests/interaction.spec.ts-snapshots/zoomed-in-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/zoomed-out-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/zoomed-out-chromium-linux.png index bbd6f22a9..2e134d053 100644 Binary files a/browser_tests/interaction.spec.ts-snapshots/zoomed-out-chromium-linux.png and b/browser_tests/interaction.spec.ts-snapshots/zoomed-out-chromium-linux.png differ diff --git a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-bypassed-chromium-linux.png b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-bypassed-chromium-linux.png index 52509d5bf..12eda99f3 100644 Binary files a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-bypassed-chromium-linux.png and b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-bypassed-chromium-linux.png differ diff --git a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-chromium-linux.png b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-chromium-linux.png index 2336fdb40..dc8e04567 100644 Binary files a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-chromium-linux.png and b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-chromium-linux.png differ diff --git a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-collapsed-chromium-linux.png b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-collapsed-chromium-linux.png index e09a9c6df..890932e8c 100644 Binary files a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-collapsed-chromium-linux.png and b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-collapsed-chromium-linux.png differ diff --git a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-group-node-chromium-linux.png b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-group-node-chromium-linux.png index 45ab0746f..6beee8947 100644 Binary files a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-group-node-chromium-linux.png and b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-group-node-chromium-linux.png differ diff --git a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-properties-panel-chromium-linux.png b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-properties-panel-chromium-linux.png index 8a37e795f..e770e5019 100644 Binary files a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-properties-panel-chromium-linux.png and b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-properties-panel-chromium-linux.png differ diff --git a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-widget-converted-chromium-linux.png b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-widget-converted-chromium-linux.png index 5235a790b..13842e6af 100644 Binary files a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-widget-converted-chromium-linux.png and b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-widget-converted-chromium-linux.png differ diff --git a/browser_tests/rightClickMenu.spec.ts-snapshots/selected-2-nodes-chromium-linux.png b/browser_tests/rightClickMenu.spec.ts-snapshots/selected-2-nodes-chromium-linux.png index 998c693e7..599c8a93c 100644 Binary files a/browser_tests/rightClickMenu.spec.ts-snapshots/selected-2-nodes-chromium-linux.png and b/browser_tests/rightClickMenu.spec.ts-snapshots/selected-2-nodes-chromium-linux.png differ diff --git a/browser_tests/textWidgetTruncate.spec.ts-snapshots/empty-latent-resized-80-percent-chromium-linux.png b/browser_tests/textWidgetTruncate.spec.ts-snapshots/empty-latent-resized-80-percent-chromium-linux.png index 2cef5fa75..38e2872b3 100644 Binary files a/browser_tests/textWidgetTruncate.spec.ts-snapshots/empty-latent-resized-80-percent-chromium-linux.png and b/browser_tests/textWidgetTruncate.spec.ts-snapshots/empty-latent-resized-80-percent-chromium-linux.png differ diff --git a/browser_tests/textWidgetTruncate.spec.ts-snapshots/load-checkpoint-resized-min-width-chromium-linux.png b/browser_tests/textWidgetTruncate.spec.ts-snapshots/load-checkpoint-resized-min-width-chromium-linux.png index aa49d2a3f..5e12115bf 100644 Binary files a/browser_tests/textWidgetTruncate.spec.ts-snapshots/load-checkpoint-resized-min-width-chromium-linux.png and b/browser_tests/textWidgetTruncate.spec.ts-snapshots/load-checkpoint-resized-min-width-chromium-linux.png differ diff --git a/browser_tests/textWidgetTruncate.spec.ts-snapshots/resized-to-original-chromium-linux.png b/browser_tests/textWidgetTruncate.spec.ts-snapshots/resized-to-original-chromium-linux.png index 7d42dc96c..3a38ece33 100644 Binary files a/browser_tests/textWidgetTruncate.spec.ts-snapshots/resized-to-original-chromium-linux.png and b/browser_tests/textWidgetTruncate.spec.ts-snapshots/resized-to-original-chromium-linux.png differ diff --git a/src/App.vue b/src/App.vue index 2659d0a5c..bc715523d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -22,17 +22,15 @@ import { NodeSearchService, SYSTEM_NODE_DEFS, } from "./services/nodeSearchService"; -import { ColorPaletteLoadedEvent } from "./types/colorPalette"; -import { LiteGraphNodeSearchSettingEvent } from "./scripts/ui"; import { app } from "./scripts/app"; const isLoading = ref(true); const nodeSearchEnabled = ref(false); const nodeSearchService = ref(); -const updateTheme = (e: ColorPaletteLoadedEvent) => { +const updateTheme = (e) => { const DARK_THEME_CLASS = "dark-theme"; - const isDarkTheme = e.detail.id !== "light"; + const isDarkTheme = e.detail.value !== "light"; if (isDarkTheme) { document.body.classList.add(DARK_THEME_CLASS); @@ -41,8 +39,8 @@ const updateTheme = (e: ColorPaletteLoadedEvent) => { } }; -const updateNodeSearchSetting = (e: LiteGraphNodeSearchSettingEvent) => { - nodeSearchEnabled.value = !e.detail; +const updateNodeSearchSetting = (e) => { + nodeSearchEnabled.value = e.detail.value === "default"; }; const init = async () => { @@ -52,12 +50,11 @@ const init = async () => { ...SYSTEM_NODE_DEFS, ]); - document.addEventListener("comfy:setting:color-palette-loaded", updateTheme); - document.addEventListener( - "comfy:setting:litegraph-node-search", + app.ui.settings.addEventListener("Comfy.ColorPalette.change", updateTheme); + app.ui.settings.addEventListener( + "Comfy.NodeSearchBoxImpl.change", updateNodeSearchSetting ); - app.ui.settings.refreshSetting("Comfy.NodeSearchBoxImpl"); app.ui.settings.refreshSetting("Comfy.ColorPalette"); }; @@ -73,12 +70,9 @@ onMounted(async () => { }); onUnmounted(() => { - document.removeEventListener( - "comfy:setting:color-palette-loaded", - updateTheme - ); - document.removeEventListener( - "comfy:setting:litegraph-node-search", + app.ui.settings.removeEventListener("Comfy.ColorPalette.change", updateTheme); + app.ui.settings.removeEventListener( + "Comfy.NodeSearchBoxImpl.change", updateNodeSearchSetting ); }); diff --git a/src/components/sidebar/SideBarThemeToggleIcon.vue b/src/components/sidebar/SideBarThemeToggleIcon.vue index 4a0c2bebe..b18d2b2e7 100644 --- a/src/components/sidebar/SideBarThemeToggleIcon.vue +++ b/src/components/sidebar/SideBarThemeToggleIcon.vue @@ -3,12 +3,12 @@ diff --git a/src/extensions/core/colorPalette.ts b/src/extensions/core/colorPalette.ts index 2f1e5fe42..66036b28f 100644 --- a/src/extensions/core/colorPalette.ts +++ b/src/extensions/core/colorPalette.ts @@ -672,12 +672,6 @@ app.registerExtension({ } app.canvas.draw(true, true); } - - document.dispatchEvent( - new CustomEvent("comfy:setting:color-palette-loaded", { - detail: colorPalette, - }) - ); }; const getColorPalette = (colorPaletteId?) => { diff --git a/src/scripts/ui.ts b/src/scripts/ui.ts index b45afe28f..625273f2c 100644 --- a/src/scripts/ui.ts +++ b/src/scripts/ui.ts @@ -7,8 +7,6 @@ import { TaskItem } from "@/types/apiTypes"; export const ComfyDialog = _ComfyDialog; -export type LiteGraphNodeSearchSettingEvent = CustomEvent; - type Position2D = { x: number; y: number; @@ -434,11 +432,6 @@ export class ComfyUI { value = value || "default"; const useLitegraphSearch = value === "litegraph (legacy)"; app.canvas.allow_searchbox = useLitegraphSearch; - document.dispatchEvent( - new CustomEvent("comfy:setting:litegraph-node-search", { - detail: useLitegraphSearch, - }) - ); }, }); diff --git a/src/types/colorPalette.ts b/src/types/colorPalette.ts index 10d35b1b3..a7cbe8036 100644 --- a/src/types/colorPalette.ts +++ b/src/types/colorPalette.ts @@ -93,4 +93,3 @@ const colorPalettesSchema = z.record(paletteSchema); export type Colors = z.infer; export type Palette = z.infer; export type ColorPalettes = z.infer; -export type ColorPaletteLoadedEvent = CustomEvent;