Skip to content

Commit 415ebfd

Browse files
Add muted state to Vue nodes (#5770)
## 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 - #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)
1 parent 97542ef commit 415ebfd

File tree

4 files changed

+64
-13
lines changed

4 files changed

+64
-13
lines changed

browser_tests/fixtures/VueNodeHelpers.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ export class VueNodeHelpers {
2222
)
2323
}
2424

25+
/**
26+
* Get locator for a Vue node by the node's title (displayed name in the header)
27+
*/
28+
getNodeByTitle(title: string): Locator {
29+
return this.page.locator(`[data-node-id]`).filter({ hasText: title })
30+
}
31+
2532
/**
2633
* Get total count of Vue nodes in the DOM
2734
*/

browser_tests/tests/vueNodes/nodeStates/bypass.spec.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ test.describe('Vue Node Bypass', () => {
1515
test('should allow toggling bypass on a selected node with hotkey', async ({
1616
comfyPage
1717
}) => {
18-
const checkpointNode = comfyPage.page.locator('[data-node-id]').filter({
19-
hasText: 'Load Checkpoint'
20-
})
21-
await checkpointNode.getByText('Load Checkpoint').click()
18+
await comfyPage.page.getByText('Load Checkpoint').click()
2219
await comfyPage.page.keyboard.press(BYPASS_HOTKEY)
20+
21+
const checkpointNode = comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
2322
await expect(checkpointNode).toHaveClass(BYPASS_CLASS)
2423

2524
await comfyPage.page.keyboard.press(BYPASS_HOTKEY)
@@ -29,15 +28,12 @@ test.describe('Vue Node Bypass', () => {
2928
test('should allow toggling bypass on multiple selected nodes with hotkey', async ({
3029
comfyPage
3130
}) => {
32-
const checkpointNode = comfyPage.page.locator('[data-node-id]').filter({
33-
hasText: 'Load Checkpoint'
34-
})
35-
const ksamplerNode = comfyPage.page.locator('[data-node-id]').filter({
36-
hasText: 'KSampler'
37-
})
38-
39-
await checkpointNode.getByText('Load Checkpoint').click()
40-
await ksamplerNode.getByText('KSampler').click({ modifiers: ['Control'] })
31+
await comfyPage.page.getByText('Load Checkpoint').click()
32+
await comfyPage.page.getByText('KSampler').click({ modifiers: ['Control'] })
33+
34+
const checkpointNode = comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
35+
const ksamplerNode = comfyPage.vueNodes.getNodeByTitle('KSampler')
36+
4137
await comfyPage.page.keyboard.press(BYPASS_HOTKEY)
4238
await expect(checkpointNode).toHaveClass(BYPASS_CLASS)
4339
await expect(ksamplerNode).toHaveClass(BYPASS_CLASS)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import {
2+
comfyExpect as expect,
3+
comfyPageFixture as test
4+
} from '../../../fixtures/ComfyPage'
5+
6+
const MUTE_HOTKEY = 'Control+m'
7+
const MUTE_CLASS = /opacity-50/
8+
9+
test.describe('Vue Node Mute', () => {
10+
test.beforeEach(async ({ comfyPage }) => {
11+
await comfyPage.setSetting('Comfy.VueNodes.Enabled', true)
12+
await comfyPage.vueNodes.waitForNodes()
13+
})
14+
15+
test('should allow toggling mute on a selected node with hotkey', async ({
16+
comfyPage
17+
}) => {
18+
await comfyPage.page.getByText('Load Checkpoint').click()
19+
await comfyPage.page.keyboard.press(MUTE_HOTKEY)
20+
21+
const checkpointNode = comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
22+
await expect(checkpointNode).toHaveClass(MUTE_CLASS)
23+
24+
await comfyPage.page.keyboard.press(MUTE_HOTKEY)
25+
await expect(checkpointNode).not.toHaveClass(MUTE_CLASS)
26+
})
27+
28+
test('should allow toggling mute on multiple selected nodes with hotkey', async ({
29+
comfyPage
30+
}) => {
31+
await comfyPage.page.getByText('Load Checkpoint').click()
32+
await comfyPage.page.getByText('KSampler').click({ modifiers: ['Control'] })
33+
34+
const checkpointNode = comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
35+
const ksamplerNode = comfyPage.vueNodes.getNodeByTitle('KSampler')
36+
37+
await comfyPage.page.keyboard.press(MUTE_HOTKEY)
38+
await expect(checkpointNode).toHaveClass(MUTE_CLASS)
39+
await expect(ksamplerNode).toHaveClass(MUTE_CLASS)
40+
41+
await comfyPage.page.keyboard.press(MUTE_HOTKEY)
42+
await expect(checkpointNode).not.toHaveClass(MUTE_CLASS)
43+
await expect(ksamplerNode).not.toHaveClass(MUTE_CLASS)
44+
})
45+
})

src/renderer/extensions/vueNodes/components/LGraphNode.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
'animate-pulse': executing,
2222
'opacity-50 before:rounded-2xl before:pointer-events-none before:absolute before:bg-bypass/60 before:inset-0':
2323
bypassed,
24+
'opacity-50 before:rounded-2xl before:pointer-events-none before:absolute before:inset-0':
25+
muted,
2426
'will-change-transform': isDragging
2527
},
2628
@@ -213,6 +215,7 @@ const hasAnyError = computed((): boolean => {
213215
})
214216
215217
const bypassed = computed((): boolean => nodeData.mode === 4)
218+
const muted = computed((): boolean => nodeData.mode === 2) // NEVER mode
216219
217220
// Use canvas interactions for proper wheel event handling and pointer event capture control
218221
const { handleWheel, shouldHandleNodePointerEvents } = useCanvasInteractions()

0 commit comments

Comments
 (0)