Compare commits

...

4 Commits

Author SHA1 Message Date
Alexander Brown
07a5fbe16d Merge branch 'main' into litegraph/prune-lgraph-misc-hooks 2026-05-18 15:35:42 -07:00
Connor Byrne
dfeeb7b49a fix: mark unused beforeChange info param with underscore
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-14 15:25:19 -07:00
Alexander Brown
fcb7e01259 Merge branch 'main' into litegraph/prune-lgraph-misc-hooks 2026-05-13 18:24:35 -07:00
Connor Byrne
dad1eaddd5 refactor(litegraph): delete dead LGraph onGetNodeMenuOptions + onBeforeChange
Delete two remaining LGraph instance hook fields confirmed dead by
AUDIT-LG.9:

- LGraph.onGetNodeMenuOptions field + dispatcher in
  LGraphCanvas.ts (context-menu construction).
- LGraph.onBeforeChange field + dispatcher in LGraph.ts:1374.

LGraphCanvas.onBeforeChange is a SEPARATE field and is preserved.

Stacks on #12228. Closes the LGraph-side portion of #12224.
2026-05-13 16:47:49 -07:00
2 changed files with 1 additions and 10 deletions

View File

@@ -42,7 +42,6 @@ import type {
DefaultConnectionColors,
Dictionary,
HasBoundingRect,
IContextMenuValue,
INodeInputSlot,
INodeOutputSlot,
LinkNetwork,
@@ -332,16 +331,11 @@ export class LGraph
onNodeAdded?(node: LGraphNode): void
onNodeRemoved?(node: LGraphNode): void
onTrigger?: LGraphTriggerHandler
onBeforeChange?(graph: LGraph, info?: LGraphNode): void
onAfterChange?(graph: LGraph, info?: LGraphNode | null): void
onConnectionChange?(node: LGraphNode): void
on_change?(graph: LGraph): void
onSerialize?(data: ISerialisedGraph | SerialisableGraph): void
onConfigure?(data: ISerialisedGraph | SerialisableGraph): void
onGetNodeMenuOptions?(
options: (IContextMenuValue<unknown> | null)[],
node: LGraphNode
): void
// @ts-expect-error - Private property type needs fixing
private _input_nodes?: LGraphNode[]
@@ -1370,8 +1364,7 @@ export class LGraph
}
// used for undo, called before any change is made to the graph
beforeChange(info?: LGraphNode): void {
this.onBeforeChange?.(this, info)
beforeChange(_info?: LGraphNode): void {
this.canvasAction((c) => c.onBeforeChange?.(this))
}

View File

@@ -8643,8 +8643,6 @@ export class LGraphCanvas implements CustomEventDispatcher<LGraphCanvasEventMap>
callback: LGraphCanvas.onMenuNodeRemove
})
node.graph?.onGetNodeMenuOptions?.(options, node)
return options
}