mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-05 05:32:02 +00:00
refactor: unify widget promotion to use store as single source of truth
SubgraphInput.connect() dispatches widget-promotion-requested event for widget-backed slots instead of creating input slots and links. EmptySubgraphInput.connect() checks for widgets before creating input slots. All promotions now flow through promotionStore. Removed ~200 lines of linked-promotion infrastructure from SubgraphNode (LinkedPromotionEntry, _resolveLinkedPromotionByInputName, _syncPromotions, _buildPromotionReconcileState, _setWidget, etc.). Removed _widget property from SubgraphInput, NodeInputSlot, INodeInputSlot, and LGraphNode.removeWidget(). Amp-Thread-ID: https://ampcode.com/threads/T-019ccb06-9ebd-7161-a547-ab84d6ac2afd Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -49,9 +49,12 @@ function addLinkedInteriorInput(
|
||||
const node = new LGraphNode(`Interior-${linkedInputName}`)
|
||||
const input = node.addInput(linkedInputName, '*')
|
||||
node.addWidget('text', widgetName, '', () => undefined)
|
||||
input.widget = { name: widgetName }
|
||||
subgraph.add(node)
|
||||
|
||||
// Connect without .widget set so SubgraphInput creates a real link
|
||||
// (widget-backed inputs now dispatch an event instead of creating links)
|
||||
inputSlot.connect(input, node)
|
||||
input.widget = { name: widgetName }
|
||||
|
||||
if (input.link == null)
|
||||
throw new Error(`Expected link to be created for input ${linkedInputName}`)
|
||||
|
||||
Reference in New Issue
Block a user