Fix: set output label alongside name for LiteGraph rendering
This commit is contained in:
@@ -87,7 +87,7 @@ app.registerExtension({
|
|||||||
delete oldSlots[key];
|
delete oldSlots[key];
|
||||||
} else {
|
} else {
|
||||||
// New key — create a fresh slot
|
// New key — create a fresh slot
|
||||||
newOutputs.push({ name: key, type: type, links: null });
|
newOutputs.push({ name: key, label: key, type: type, links: null });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,6 +189,7 @@ app.registerExtension({
|
|||||||
if (keys.length > 0) {
|
if (keys.length > 0) {
|
||||||
for (let i = 0; i < this.outputs.length && i < keys.length; i++) {
|
for (let i = 0; i < this.outputs.length && i < keys.length; i++) {
|
||||||
this.outputs[i].name = keys[i].trim();
|
this.outputs[i].name = keys[i].trim();
|
||||||
|
this.outputs[i].label = keys[i].trim();
|
||||||
if (types[i]) this.outputs[i].type = types[i];
|
if (types[i]) this.outputs[i].type = types[i];
|
||||||
}
|
}
|
||||||
while (this.outputs.length > keys.length) {
|
while (this.outputs.length > keys.length) {
|
||||||
@@ -205,10 +206,10 @@ app.registerExtension({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// === DIAGNOSTIC (remove after debugging) ===
|
// === DIAGNOSTIC (remove after debugging) ===
|
||||||
console.log("[JDL-DEBUG] this.outputs AFTER RENAME:", JSON.stringify(this.outputs?.map(o => ({name: o.name, type: o.type}))));
|
console.log("[JDL-DEBUG] this.outputs AFTER RENAME:", JSON.stringify(this.outputs?.map(o => ({name: o.name, label: o.label, type: o.type}))));
|
||||||
const _node = this;
|
const _node = this;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log("[JDL-DEBUG] this.outputs 1s LATER:", JSON.stringify(_node.outputs?.map(o => ({name: o.name, type: o.type}))));
|
console.log("[JDL-DEBUG] this.outputs 1s LATER:", JSON.stringify(_node.outputs?.map(o => ({name: o.name, label: o.label, type: o.type}))));
|
||||||
}, 1000);
|
}, 1000);
|
||||||
// === END DIAGNOSTIC ===
|
// === END DIAGNOSTIC ===
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user