Add bypass action to selection toolbox (#2616)

This commit is contained in:
Chenlei Hu
2025-02-18 12:25:49 -05:00
committed by GitHub
parent 28dd6a2702
commit 25e5ab3a36
5 changed files with 55 additions and 8 deletions

View File

@@ -6,6 +6,19 @@
content: 'p-0 flex flex-row'
}"
>
<Button
v-if="nodeSelected"
severity="secondary"
text
@click="
() => commandStore.execute('Comfy.Canvas.ToggleSelectedNodes.Bypass')
"
data-testid="bypass-button"
>
<template #icon>
<i-game-icons:detour />
</template>
</Button>
<Button
severity="secondary"
text
@@ -31,12 +44,19 @@
<script setup lang="ts">
import Button from 'primevue/button'
import Panel from 'primevue/panel'
import { computed } from 'vue'
import { useRefreshableSelection } from '@/composables/useRefreshableSelection'
import { useCommandStore } from '@/stores/commandStore'
import { useCanvasStore } from '@/stores/graphStore'
import { isLGraphNode } from '@/utils/litegraphUtil'
const commandStore = useCommandStore()
const canvasStore = useCanvasStore()
const { isRefreshable, refreshSelected } = useRefreshableSelection()
const nodeSelected = computed(() =>
canvasStore.selectedItems.some(isLGraphNode)
)
</script>
<style scoped>