mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 06:44:32 +00:00
Node ghost mode when adding nodes (#8694)
## Summary Adds option for adding a node as a "ghost" that follows the cursor until the user left clicks to confirm, or esc/right click to cancel. ## Changes - **What**: Adds option for `ghost` when calling `graph.add` This adds the node with a `flag` of ghost which causes it to render transparent Selects the node, then sets the canvas as dragging to stick the node to the cursor ## Screenshots (if applicable) https://github.com/user-attachments/assets/dcb5702f-aba3-4983-aa40-c51f24a4767a ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8694-Node-ghost-mode-when-adding-nodes-2ff6d73d3650815591f2c28415050463) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -70,6 +70,7 @@ export interface VueNodeData {
|
||||
color?: string
|
||||
flags?: {
|
||||
collapsed?: boolean
|
||||
ghost?: boolean
|
||||
pinned?: boolean
|
||||
}
|
||||
hasErrors?: boolean
|
||||
@@ -526,6 +527,15 @@ export function useGraphNodeManager(graph: LGraph): GraphNodeManager {
|
||||
}
|
||||
})
|
||||
break
|
||||
case 'flags.ghost':
|
||||
vueNodeData.set(nodeId, {
|
||||
...currentData,
|
||||
flags: {
|
||||
...currentData.flags,
|
||||
ghost: Boolean(propertyEvent.newValue)
|
||||
}
|
||||
})
|
||||
break
|
||||
case 'flags.pinned':
|
||||
vueNodeData.set(nodeId, {
|
||||
...currentData,
|
||||
|
||||
Reference in New Issue
Block a user