mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 07:00:23 +00:00
## Summary Added mute state support to Vue nodes with visual feedback and keyboard shortcut functionality. ## Changes - **What**: Implemented mute state (mode 2) for Vue nodes with opacity styling and `Ctrl+M` hotkey support ## Review Focus Visual consistency between bypass and mute states, and keyboard shortcut conflict detection with existing hotkeys. ## Test Coverage - Single node mute/unmute with `Ctrl+M` hotkey - Multi-selection mute/unmute operations - Visual state verification with opacity changes ## Related - https://github.com/Comfy-Org/ComfyUI_frontend/pull/5715 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5770-Add-muted-state-to-Vue-nodes-2796d73d36508143b3edfbcb782de7c1) by [Unito](https://www.unito.io)
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
import {
|
|
comfyExpect as expect,
|
|
comfyPageFixture as test
|
|
} from '../../../fixtures/ComfyPage'
|
|
|
|
const BYPASS_HOTKEY = 'Control+b'
|
|
const BYPASS_CLASS = /before:bg-bypass\/60/
|
|
|
|
test.describe('Vue Node Bypass', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.setSetting('Comfy.VueNodes.Enabled', true)
|
|
await comfyPage.vueNodes.waitForNodes()
|
|
})
|
|
|
|
test('should allow toggling bypass on a selected node with hotkey', async ({
|
|
comfyPage
|
|
}) => {
|
|
await comfyPage.page.getByText('Load Checkpoint').click()
|
|
await comfyPage.page.keyboard.press(BYPASS_HOTKEY)
|
|
|
|
const checkpointNode = comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
|
|
await expect(checkpointNode).toHaveClass(BYPASS_CLASS)
|
|
|
|
await comfyPage.page.keyboard.press(BYPASS_HOTKEY)
|
|
await expect(checkpointNode).not.toHaveClass(BYPASS_CLASS)
|
|
})
|
|
|
|
test('should allow toggling bypass on multiple selected nodes with hotkey', async ({
|
|
comfyPage
|
|
}) => {
|
|
await comfyPage.page.getByText('Load Checkpoint').click()
|
|
await comfyPage.page.getByText('KSampler').click({ modifiers: ['Control'] })
|
|
|
|
const checkpointNode = comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
|
|
const ksamplerNode = comfyPage.vueNodes.getNodeByTitle('KSampler')
|
|
|
|
await comfyPage.page.keyboard.press(BYPASS_HOTKEY)
|
|
await expect(checkpointNode).toHaveClass(BYPASS_CLASS)
|
|
await expect(ksamplerNode).toHaveClass(BYPASS_CLASS)
|
|
|
|
await comfyPage.page.keyboard.press(BYPASS_HOTKEY)
|
|
await expect(checkpointNode).not.toHaveClass(BYPASS_CLASS)
|
|
await expect(ksamplerNode).not.toHaveClass(BYPASS_CLASS)
|
|
})
|
|
})
|