fix: restore renamed slot labels after configure

Autogrow recreates inputs fresh during configure, losing custom labels.
Hook onConfigure to re-apply labels from serialized workflow data.
This commit is contained in:
Arthur R Longbottom
2026-03-27 19:15:00 -05:00
parent 08799e8163
commit 8b32d696f0

View File

@@ -185,6 +185,22 @@ function onBranchSelectorCreated(this: LGraphNode) {
}
})
// Restore renamed labels after configure (autogrow recreates inputs fresh)
this.onConfigure = useChainCallback(
this.onConfigure,
(data: { inputs?: Array<{ label?: string; name: string }> }) => {
if (!data?.inputs) return
for (const serializedInput of data.inputs) {
if (!serializedInput.label) continue
const match = node.inputs.find(
(inp) => inp.name === serializedInput.name
)
if (match) match.label = serializedInput.label
}
refreshBranchValues()
}
)
// Allow renaming autogrow input slots via context menu
this.getSlotMenuOptions = (slot) => {
const menu: { content: string; slot: typeof slot }[] = []