refactor: stop fighting the DOM (#7421)

## Summary

Remove keyDown provider on the LGraphNode, remove inject on widget.

## Changes

- **What**: LGraphNode.vue ImagePreview.vue
- **Breaking**: <!-- Any breaking changes (if none, remove this line)
-->
- **Dependencies**: <!-- New dependencies (if none, remove this line)
-->

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7421-refactor-stop-fighting-the-DOM-2c76d73d365081e6b5e9c99a61bbd883)
by [Unito](https://www.unito.io)
This commit is contained in:
Simula_r
2025-12-12 14:40:26 -08:00
committed by GitHub
parent 3e97225ff6
commit 9c157296be
2 changed files with 3 additions and 29 deletions

View File

@@ -49,7 +49,6 @@
@dragover.prevent="handleDragOver"
@dragleave="handleDragLeave"
@drop.stop.prevent="handleDrop"
@keydown="handleNodeKeydown"
>
<div class="flex flex-col justify-center items-center relative">
<template v-if="isCollapsed">
@@ -132,16 +131,7 @@
<script setup lang="ts">
import { storeToRefs } from 'pinia'
import {
computed,
nextTick,
onErrorCaptured,
onMounted,
provide,
ref,
shallowRef,
watch
} from 'vue'
import { computed, nextTick, onErrorCaptured, onMounted, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import type { VueNodeData } from '@/composables/graph/useGraphNodeManager'
@@ -208,13 +198,6 @@ const isSelected = computed(() => {
return selectedNodeIds.value.has(nodeData.id)
})
const keyEvent = shallowRef<KeyboardEvent | null>(null)
provide('keyEvent', keyEvent)
const handleNodeKeydown = (event: KeyboardEvent) => {
keyEvent.value = event
}
const nodeLocatorId = computed(() => getLocatorIdFromNodeData(nodeData))
const { executing, progress } = useNodeExecutionState(nodeLocatorId)
const executionStore = useExecutionStore()