mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 10:42:44 +00:00
* link release pops up searchbox by default (#348) * link release pops up searchbox by default * Update browser test * Fix tests * Update test expectations [skip ci] --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -27,6 +27,9 @@ test.describe('Node Interaction', () => {
|
|||||||
|
|
||||||
test('Can disconnect/connect edge', async ({ comfyPage }) => {
|
test('Can disconnect/connect edge', async ({ comfyPage }) => {
|
||||||
await comfyPage.disconnectEdge()
|
await comfyPage.disconnectEdge()
|
||||||
|
// Close search menu poped up.
|
||||||
|
await comfyPage.page.keyboard.press('Escape')
|
||||||
|
await comfyPage.nextFrame()
|
||||||
await expect(comfyPage.canvas).toHaveScreenshot(
|
await expect(comfyPage.canvas).toHaveScreenshot(
|
||||||
'disconnected-edge-with-menu.png'
|
'disconnected-edge-with-menu.png'
|
||||||
)
|
)
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 93 KiB |
@@ -8,16 +8,10 @@ test.describe('Node search box', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Can trigger on link release', async ({ comfyPage }) => {
|
test('Can trigger on link release', async ({ comfyPage }) => {
|
||||||
await comfyPage.page.keyboard.down('Shift')
|
|
||||||
await comfyPage.disconnectEdge()
|
await comfyPage.disconnectEdge()
|
||||||
await expect(comfyPage.searchBox.input).toHaveCount(1)
|
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 }) => {
|
test('Can add node', async ({ comfyPage }) => {
|
||||||
await comfyPage.doubleClickCanvas()
|
await comfyPage.doubleClickCanvas()
|
||||||
await expect(comfyPage.searchBox.input).toHaveCount(1)
|
await expect(comfyPage.searchBox.input).toHaveCount(1)
|
||||||
@@ -26,9 +20,7 @@ test.describe('Node search box', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Can auto link node', async ({ comfyPage }) => {
|
test('Can auto link node', async ({ comfyPage }) => {
|
||||||
await comfyPage.page.keyboard.down('Shift')
|
|
||||||
await comfyPage.disconnectEdge()
|
await comfyPage.disconnectEdge()
|
||||||
await comfyPage.page.keyboard.up('Shift')
|
|
||||||
await comfyPage.searchBox.fillAndSelectFirstNode('CLIPTextEncode')
|
await comfyPage.searchBox.fillAndSelectFirstNode('CLIPTextEncode')
|
||||||
await expect(comfyPage.canvas).toHaveScreenshot('auto-linked-node.png')
|
await expect(comfyPage.canvas).toHaveScreenshot('auto-linked-node.png')
|
||||||
})
|
})
|
||||||
@@ -44,7 +36,6 @@ test.describe('Node search box', () => {
|
|||||||
x: 5,
|
x: 5,
|
||||||
y: 5
|
y: 5
|
||||||
}
|
}
|
||||||
|
|
||||||
await comfyPage.page.keyboard.down('Shift')
|
await comfyPage.page.keyboard.down('Shift')
|
||||||
await comfyPage.dragAndDrop(outputSlot1Pos, emptySpacePos)
|
await comfyPage.dragAndDrop(outputSlot1Pos, emptySpacePos)
|
||||||
await comfyPage.page.keyboard.up('Shift')
|
await comfyPage.page.keyboard.up('Shift')
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export default defineConfig({
|
|||||||
{
|
{
|
||||||
name: 'chromium',
|
name: 'chromium',
|
||||||
use: { ...devices['Desktop Chrome'] },
|
use: { ...devices['Desktop Chrome'] },
|
||||||
timeout: 5000
|
timeout: 15000
|
||||||
}
|
}
|
||||||
|
|
||||||
// {
|
// {
|
||||||
|
|||||||
@@ -44,9 +44,14 @@ const betaMenuEnabled = computed(
|
|||||||
const nodeSearchEnabled = computed<boolean>(
|
const nodeSearchEnabled = computed<boolean>(
|
||||||
() => settingStore.get('Comfy.NodeSearchBoxImpl') === 'default'
|
() => settingStore.get('Comfy.NodeSearchBoxImpl') === 'default'
|
||||||
)
|
)
|
||||||
watch(nodeSearchEnabled, (newVal) => {
|
watch(
|
||||||
if (comfyApp.canvas) comfyApp.canvas.allow_searchbox = !newVal
|
nodeSearchEnabled,
|
||||||
})
|
(newVal) => {
|
||||||
|
LiteGraph.release_link_on_empty_shows_menu = !newVal
|
||||||
|
if (comfyApp.canvas) comfyApp.canvas.allow_searchbox = !newVal
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
)
|
||||||
|
|
||||||
let dropTargetCleanup = () => {}
|
let dropTargetCleanup = () => {}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import { LiteGraphCanvasEvent, ConnectingLink } from '@comfyorg/litegraph'
|
|||||||
import { FilterAndValue } from '@/services/nodeSearchService'
|
import { FilterAndValue } from '@/services/nodeSearchService'
|
||||||
import { ComfyNodeDefImpl, useNodeDefStore } from '@/stores/nodeDefStore'
|
import { ComfyNodeDefImpl, useNodeDefStore } from '@/stores/nodeDefStore'
|
||||||
import { ConnectingLinkImpl } from '@/types/litegraphTypes'
|
import { ConnectingLinkImpl } from '@/types/litegraphTypes'
|
||||||
|
import { LiteGraph } from '@comfyorg/litegraph'
|
||||||
|
|
||||||
interface LiteGraphPointerEvent extends Event {
|
interface LiteGraphPointerEvent extends Event {
|
||||||
canvasX: number
|
canvasX: number
|
||||||
@@ -83,13 +84,6 @@ const addNode = (nodeDef: ComfyNodeDefImpl) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const canvasEventHandler = (e: LiteGraphCanvasEvent) => {
|
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') {
|
if (e.detail.subType === 'empty-release') {
|
||||||
const context = e.detail.linkReleaseContext
|
const context = e.detail.linkReleaseContext
|
||||||
if (context.links.length === 0) {
|
if (context.links.length === 0) {
|
||||||
|
|||||||
@@ -1875,7 +1875,6 @@ export class ComfyApp {
|
|||||||
this.canvas = new LGraphCanvas(canvasEl, this.graph)
|
this.canvas = new LGraphCanvas(canvasEl, this.graph)
|
||||||
this.ctx = canvasEl.getContext('2d')
|
this.ctx = canvasEl.getContext('2d')
|
||||||
|
|
||||||
LiteGraph.release_link_on_empty_shows_menu = true
|
|
||||||
LiteGraph.alt_drag_do_clone_nodes = true
|
LiteGraph.alt_drag_do_clone_nodes = true
|
||||||
|
|
||||||
this.graph.start()
|
this.graph.start()
|
||||||
|
|||||||
Reference in New Issue
Block a user