diff --git a/browser_tests/ComfyPage.ts b/browser_tests/ComfyPage.ts index 982d79896..c2647b0ca 100644 --- a/browser_tests/ComfyPage.ts +++ b/browser_tests/ComfyPage.ts @@ -233,9 +233,8 @@ export const comfyPageFixture = base.extend<{ comfyPage: ComfyPage }>({ font-family: 'Roboto Mono', 'Noto Color Emoji'; }`, }); - await page.waitForFunction(() => document.fonts.ready); - await page.waitForFunction(() => window["app"] != undefined); + await page.waitForFunction(() => window["app"] !== undefined); await page.evaluate(() => { window["app"]["canvas"].show_info = false; }); 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 33b55ae7d..c889c8ec4 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 2e134d053..bbd6f22a9 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 388aa2972..078bb04ae 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 b1b8a1efe..8296c599c 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 2e134d053..bbd6f22a9 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 0f90acd57..fbb8c6c57 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 83deac9d7..f501ef88b 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 a7dec06e6..73089aa21 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 b1c3569e4..17e635f2a 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 944d42014..1e0bb1aa0 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 2e134d053..bbd6f22a9 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/nodeSearchBox.spec.ts-snapshots/added-node-chromium-linux.png b/browser_tests/nodeSearchBox.spec.ts-snapshots/added-node-chromium-linux.png index aed0ae8f4..2c5b412c3 100644 Binary files a/browser_tests/nodeSearchBox.spec.ts-snapshots/added-node-chromium-linux.png and b/browser_tests/nodeSearchBox.spec.ts-snapshots/added-node-chromium-linux.png differ diff --git a/browser_tests/nodeSearchBox.spec.ts-snapshots/auto-linked-node-chromium-linux.png b/browser_tests/nodeSearchBox.spec.ts-snapshots/auto-linked-node-chromium-linux.png index 0549b9621..470bf2df4 100644 Binary files a/browser_tests/nodeSearchBox.spec.ts-snapshots/auto-linked-node-chromium-linux.png and b/browser_tests/nodeSearchBox.spec.ts-snapshots/auto-linked-node-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 12eda99f3..52509d5bf 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 dc8e04567..2336fdb40 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 890932e8c..e09a9c6df 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 6beee8947..45ab0746f 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 8b7a8d1cb..8a37e795f 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 13842e6af..5235a790b 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 599c8a93c..998c693e7 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/playwright.config.ts b/playwright.config.ts index 467d9e600..f3469e302 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -36,7 +36,7 @@ export default defineConfig({ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, - timeout: 3000, + timeout: 5000, }, // { diff --git a/src/App.vue b/src/App.vue index e03e796a7..85dc3722f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,13 +9,13 @@ import { onMounted, onUnmounted, provide, ref } from "vue"; import NodeSearchboxPopover from "@/components/NodeSearchBoxPopover.vue"; import ProgressSpinner from "primevue/progressspinner"; -import { api } from "@/scripts/api"; 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); @@ -37,7 +37,7 @@ const updateNodeSearchSetting = (e: LiteGraphNodeSearchSettingEvent) => { }; const init = async () => { - const nodeDefs = Object.values(await api.getNodeDefs()); + const nodeDefs = Object.values(app.nodeDefs); nodeSearchService.value = new NodeSearchService([ ...nodeDefs, ...SYSTEM_NODE_DEFS, @@ -48,6 +48,9 @@ const init = async () => { "comfy:setting:litegraph-node-search", updateNodeSearchSetting ); + + app.ui.settings.refreshSetting("Comfy.NodeSearchBoxImpl"); + app.ui.settings.refreshSetting("Comfy.ColorPalette"); }; onMounted(async () => { diff --git a/src/main.ts b/src/main.ts index 884fa3102..aee15636f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,22 +7,23 @@ import App from "./App.vue"; import { app as comfyApp } from "@/scripts/app"; const app = createApp(App); -app - .use(PrimeVue, { - theme: { - preset: Aura, - options: { - prefix: "p", - cssLayer: false, - // This is a workaround for the issue with the dark mode selector - // https://github.com/primefaces/primevue/issues/5515 - darkModeSelector: ".dark-theme, :root:has(.dark-theme)", - }, - }, - }) - .mount("#vue-app"); comfyApp.setup().then(() => { window["app"] = comfyApp; window["graph"] = comfyApp.graph; + + app + .use(PrimeVue, { + theme: { + preset: Aura, + options: { + prefix: "p", + cssLayer: false, + // This is a workaround for the issue with the dark mode selector + // https://github.com/primefaces/primevue/issues/5515 + darkModeSelector: ".dark-theme, :root:has(.dark-theme)", + }, + }, + }) + .mount("#vue-app"); }); diff --git a/src/scripts/app.ts b/src/scripts/app.ts index 37936667d..91c52e017 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -115,6 +115,7 @@ export class ComfyApp { bodyRight: HTMLElement; bodyBottom: HTMLElement; menu: ComfyAppMenu; + nodeDefs: Record; constructor() { this.ui = new ComfyUI(this); @@ -1871,7 +1872,6 @@ export class ComfyApp { this.#addAfterConfigureHandler(); this.canvas = new LGraphCanvas(canvasEl, this.graph); - this.ui.settings.refreshSetting("Comfy.NodeSearchBoxImpl"); this.ctx = canvasEl.getContext("2d"); LiteGraph.release_link_on_empty_shows_menu = true; @@ -1955,9 +1955,9 @@ export class ComfyApp { * Registers nodes with the graph */ async registerNodes() { - const app = this; // Load node definitions from the backend const defs = await api.getNodeDefs(); + this.nodeDefs = defs; await this.registerNodesFromDefs(defs); await this.#invokeExtensionsAsync("registerCustomNodes"); }