diff --git a/browser_tests/interaction.spec.ts b/browser_tests/interaction.spec.ts index c67dcbe09..3917aa9df 100644 --- a/browser_tests/interaction.spec.ts +++ b/browser_tests/interaction.spec.ts @@ -27,6 +27,9 @@ test.describe('Node Interaction', () => { test('Can disconnect/connect edge', async ({ comfyPage }) => { await comfyPage.disconnectEdge() + // Close search menu poped up. + await comfyPage.page.keyboard.press('Escape') + await comfyPage.nextFrame() await expect(comfyPage.canvas).toHaveScreenshot( 'disconnected-edge-with-menu.png' ) 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..e9c0459da 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/nodeSearchBox.spec.ts b/browser_tests/nodeSearchBox.spec.ts index f05693e2b..278fc4b26 100644 --- a/browser_tests/nodeSearchBox.spec.ts +++ b/browser_tests/nodeSearchBox.spec.ts @@ -8,16 +8,10 @@ test.describe('Node search box', () => { }) test('Can trigger on link release', async ({ comfyPage }) => { - await comfyPage.page.keyboard.down('Shift') await comfyPage.disconnectEdge() await expect(comfyPage.searchBox.input).toHaveCount(1) }) - test('Does not trigger on link release (no shift)', async ({ comfyPage }) => { - await comfyPage.disconnectEdge() - await expect(comfyPage.searchBox.input).toHaveCount(0) - }) - test('Can add node', async ({ comfyPage }) => { await comfyPage.doubleClickCanvas() await expect(comfyPage.searchBox.input).toHaveCount(1) @@ -26,9 +20,7 @@ test.describe('Node search box', () => { }) test('Can auto link node', async ({ comfyPage }) => { - await comfyPage.page.keyboard.down('Shift') await comfyPage.disconnectEdge() - await comfyPage.page.keyboard.up('Shift') await comfyPage.searchBox.fillAndSelectFirstNode('CLIPTextEncode') await expect(comfyPage.canvas).toHaveScreenshot('auto-linked-node.png') }) @@ -44,7 +36,6 @@ test.describe('Node search box', () => { x: 5, y: 5 } - await comfyPage.page.keyboard.down('Shift') await comfyPage.dragAndDrop(outputSlot1Pos, emptySpacePos) await comfyPage.page.keyboard.up('Shift') diff --git a/playwright.config.ts b/playwright.config.ts index da2772efa..a83fc4a66 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -36,7 +36,7 @@ export default defineConfig({ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, - timeout: 5000 + timeout: 15000 } // { diff --git a/src/components/graph/GraphCanvas.vue b/src/components/graph/GraphCanvas.vue index e5ea76cd5..8f99c439c 100644 --- a/src/components/graph/GraphCanvas.vue +++ b/src/components/graph/GraphCanvas.vue @@ -44,9 +44,14 @@ const betaMenuEnabled = computed( const nodeSearchEnabled = computed( () => settingStore.get('Comfy.NodeSearchBoxImpl') === 'default' ) -watch(nodeSearchEnabled, (newVal) => { - if (comfyApp.canvas) comfyApp.canvas.allow_searchbox = !newVal -}) +watch( + nodeSearchEnabled, + (newVal) => { + LiteGraph.release_link_on_empty_shows_menu = !newVal + if (comfyApp.canvas) comfyApp.canvas.allow_searchbox = !newVal + }, + { immediate: true } +) let dropTargetCleanup = () => {} diff --git a/src/components/searchbox/NodeSearchBoxPopover.vue b/src/components/searchbox/NodeSearchBoxPopover.vue index 10c4dab24..95a76c32e 100644 --- a/src/components/searchbox/NodeSearchBoxPopover.vue +++ b/src/components/searchbox/NodeSearchBoxPopover.vue @@ -29,6 +29,7 @@ import { LiteGraphCanvasEvent, ConnectingLink } from '@comfyorg/litegraph' import { FilterAndValue } from '@/services/nodeSearchService' import { ComfyNodeDefImpl, useNodeDefStore } from '@/stores/nodeDefStore' import { ConnectingLinkImpl } from '@/types/litegraphTypes' +import { LiteGraph } from '@comfyorg/litegraph' interface LiteGraphPointerEvent extends Event { canvasX: number @@ -83,13 +84,6 @@ const addNode = (nodeDef: ComfyNodeDefImpl) => { } const canvasEventHandler = (e: LiteGraphCanvasEvent) => { - const shiftPressed = (e.detail.originalEvent as KeyboardEvent).shiftKey - // Ignore empty releases unless shift is pressed - // Empty release without shift is trigger right click menu - if (e.detail.subType === 'empty-release' && !shiftPressed) { - return - } - if (e.detail.subType === 'empty-release') { const context = e.detail.linkReleaseContext if (context.links.length === 0) { diff --git a/src/scripts/app.ts b/src/scripts/app.ts index bbcd12901..9a75794ae 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -1875,7 +1875,6 @@ export class ComfyApp { this.canvas = new LGraphCanvas(canvasEl, this.graph) this.ctx = canvasEl.getContext('2d') - LiteGraph.release_link_on_empty_shows_menu = true LiteGraph.alt_drag_do_clone_nodes = true this.graph.start()