remove event forwarding hack. todo: add link moving in vue

This commit is contained in:
bymyself
2025-09-04 19:19:13 -07:00
parent e8dae57a6a
commit f6051f6634
5 changed files with 2 additions and 256 deletions

View File

@@ -13,7 +13,6 @@
:style="{
height: slotHeight + 'px'
}"
@pointerdown="handleClick"
>
<!-- Connection Dot -->
<SlotConnectionDot
@@ -63,10 +62,6 @@ interface InputSlotProps {
const props = defineProps<InputSlotProps>()
const emit = defineEmits<{
'slot-click': [event: PointerEvent]
}>()
// Error boundary implementation
const renderError = ref<string | null>(null)
const { toastErrorHandler } = useErrorHandling()
@@ -83,13 +78,6 @@ const slotColor = computed(() => getSlotColor(props.slotData.type))
// Get slot height from litegraph constants
const slotHeight = COMFY_VUE_NODE_DIMENSIONS.components.SLOT_HEIGHT
// Handle click events
const handleClick = (event: PointerEvent) => {
if (!props.readonly) {
emit('slot-click', event)
}
}
const transformState = inject<TransformState | undefined>(
'transformState',
undefined

View File

@@ -12,9 +12,6 @@
:node-id="nodeInfo?.id != null ? String(nodeInfo.id) : ''"
:index="getActualInputIndex(input, index)"
:readonly="readonly"
@slot-click="
handleInputSlotClick(getActualInputIndex(input, index), $event)
"
/>
</div>
@@ -26,16 +23,14 @@
:node-id="nodeInfo?.id != null ? String(nodeInfo.id) : ''"
:index="index"
:readonly="readonly"
@slot-click="handleOutputSlotClick(index, $event)"
/>
</div>
</div>
</template>
<script setup lang="ts">
import { computed, onErrorCaptured, onUnmounted, ref } from 'vue'
import { computed, onErrorCaptured, ref } from 'vue'
import { useEventForwarding } from '@/composables/graph/useEventForwarding'
import type { VueNodeData } from '@/composables/graph/useGraphNodeManager'
import { useErrorHandling } from '@/composables/useErrorHandling'
import type { INodeSlot, LGraphNode } from '@/lib/litegraph/src/litegraph'
@@ -107,26 +102,6 @@ const getActualInputIndex = (
return actualIndex !== -1 ? actualIndex : filteredIndex
}
// Set up event forwarding for slot interactions
const { handleSlotPointerDown, cleanup } = useEventForwarding()
// Handle input slot click
const handleInputSlotClick = (_index: number, event: PointerEvent) => {
// Forward the event to LiteGraph for native slot handling
handleSlotPointerDown(event)
}
// Handle output slot click
const handleOutputSlotClick = (_index: number, event: PointerEvent) => {
// Forward the event to LiteGraph for native slot handling
handleSlotPointerDown(event)
}
// Clean up event listeners on unmount
onUnmounted(() => {
cleanup()
})
// Error boundary implementation
const renderError = ref<string | null>(null)
const { toastErrorHandler } = useErrorHandling()

View File

@@ -23,7 +23,6 @@
:index="getWidgetInputIndex(widget)"
:readonly="readonly"
:dot-only="true"
@slot-click="handleWidgetSlotClick($event, widget)"
/>
</div>
<!-- Widget Component -->
@@ -40,9 +39,8 @@
</template>
<script setup lang="ts">
import { computed, onErrorCaptured, onUnmounted, ref } from 'vue'
import { computed, onErrorCaptured, ref } from 'vue'
import { useEventForwarding } from '@/composables/graph/useEventForwarding'
import type {
SafeWidgetData,
VueNodeData
@@ -70,9 +68,6 @@ interface NodeWidgetsProps {
const props = defineProps<NodeWidgetsProps>()
// Set up event forwarding for slot interactions
const { handleSlotPointerDown, cleanup } = useEventForwarding()
// Use widget renderer composable
const { getWidgetComponent, shouldRenderAsVue } = useWidgetRenderer()
@@ -166,18 +161,4 @@ const getWidgetInputIndex = (widget: ProcessedWidget): number => {
})
return idx >= 0 ? idx : 0
}
// Handle widget slot click
const handleWidgetSlotClick = (
event: PointerEvent,
_widget: ProcessedWidget
) => {
// Forward the event to LiteGraph for native slot handling
handleSlotPointerDown(event)
}
// Clean up event listeners on unmount
onUnmounted(() => {
cleanup()
})
</script>

View File

@@ -14,7 +14,6 @@
:style="{
height: slotHeight + 'px'
}"
@pointerdown="handleClick"
>
<!-- Slot Name -->
<span
@@ -61,10 +60,6 @@ interface OutputSlotProps {
const props = defineProps<OutputSlotProps>()
const emit = defineEmits<{
'slot-click': [event: PointerEvent]
}>()
// Error boundary implementation
const renderError = ref<string | null>(null)
@@ -82,13 +77,6 @@ const slotColor = computed(() => getSlotColor(props.slotData.type))
// Get slot height from litegraph constants
const slotHeight = COMFY_VUE_NODE_DIMENSIONS.components.SLOT_HEIGHT
// Handle click events
const handleClick = (event: PointerEvent) => {
if (!props.readonly) {
emit('slot-click', event)
}
}
const transformState = inject<TransformState | undefined>(
'transformState',
undefined