Repository navigation
fix: subgraph output slot labels not updating in v2 renderer - #9266
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughIntroduces reactive node outputs (shallowReactive) and a new 'node:slot-label:changed' graph event; SubgraphNode emits the event when slot labels are renamed; useGraphNodeManager handles the trigger to refresh node.outputs; duplicated test added to verify label reactivity. Changes
Sequence DiagramsequenceDiagram
participant User as "User"
participant SubgraphNode as "SubgraphNode"
participant LGraph as "LGraph"
participant Manager as "useGraphNodeManager"
participant VueReactivity as "VueReactivity"
User->>SubgraphNode: Rename slot label
SubgraphNode->>LGraph: trigger('node:slot-label:changed', { nodeId, slotType })
LGraph->>Manager: onTrigger dispatch
Manager->>Manager: locate nodeRef, reassign inputs/outputs (shallow replace)
Manager->>VueReactivity: update reactiveOutputs array (shallowReactive)
VueReactivity->>User: UI reflects updated slot label
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can enforce grammar and style rules using `languagetool`.Configure the |
🎭 Playwright: ⏳ Running... |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/lib/litegraph/src/subgraph/SubgraphNode.ts`:
- Around line 222-224: The event 'node:slot-label:changed' emitted from
SubgraphNode (see the trigger call) is fired for both input and output label
renames, but the handler in useGraphNodeManager.ts (the
'node:slot-label:changed' listener around the nodeRef.outputs refresh) only
reassigns nodeRef.outputs; update that listener to also refresh nodeRef.inputs
(e.g., reassign nodeRef.inputs = [...nodeRef.inputs] or otherwise force Vue
reactivity) so input label changes produce the same reactive update as outputs.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/composables/graph/useGraphNodeManager.test.tssrc/composables/graph/useGraphNodeManager.tssrc/lib/litegraph/src/LGraph.tssrc/lib/litegraph/src/subgraph/SubgraphNode.tssrc/lib/litegraph/src/types/graphTriggers.ts
artokun
left a comment
There was a problem hiding this comment.
Pulled/rebased and pushed d02b4a3.
Addressed the scoped nits here: explicit descriptors, input coverage, slotType on the slot-label trigger, and a no-throw guard test. I left the onTrigger switch dedupe note alone for scope.
Custom names set on subgraph output nodes were ignored in the v2 renderer, always showing the data type name instead. The outputs array was a one-time snapshot that never picked up label changes. Made outputs reactive (matching inputs) and added a slot-label trigger so the Vue layer re-renders when labels change.
Addresses CodeRabbit feedback — the handler was only refreshing outputs but the trigger fires for input renames too.
d02b4a3 to
fedf8a1
Compare
christian-byrne
left a comment
There was a problem hiding this comment.
all feedback addressed cleanly - slotType discriminant, explicit descriptors, and test coverage all look good
|
|
|
|
Custom names set on subgraph output nodes are ignored in the v2 renderer — it always shows the data type name (e.g. "texts") instead of the user-defined label. Works correctly in v1. - **What**: Made `outputs` in `extractVueNodeData` reactive via `shallowReactive` + `defineProperty` (matching the existing `inputs` pattern). Added a `node:slot-label:changed` graph trigger that `SubgraphNode` fires when input/output labels are renamed, so the Vue layer picks up the change. - The `outputs` reactivity mirrors `inputs` exactly — same `shallowReactive` + setter pattern. The new trigger event forces `shallowReactive` to detect the deep property change by re-assigning the array. - Also handles input label renames for consistency, even though the current bug report is output-specific. **v1 — output correctly shows custom label "output_text":** <img width="1076" height="628" alt="Screenshot 2026-02-26 at 4 43 00 PM" src="https://github.com/user-attachments/assets/b4d6ae4c-9970-4d99-a872-4ce1b28522f2" /> **v2 before fix — output shows type name "texts" instead of custom label:** <img width="808" height="298" alt="Screenshot 2026-02-26 at 4 43 30 PM" src="https://github.com/user-attachments/assets/cf06aa6c-6d4d-4be9-9bcd-dcc072ed1907" /> **v2 after fix — output correctly shows "output_text":** <img width="1013" height="292" alt="Screenshot 2026-02-26 at 5 14 44 PM" src="https://github.com/user-attachments/assets/3c43fa9b-0615-4758-bee6-be3481168675" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9266-fix-subgraph-output-slot-labels-not-updating-in-v2-renderer-3146d73d365081979327fd775a6ef62b) by [Unito](https://www.unito.io)
Custom names set on subgraph output nodes are ignored in the v2 renderer — it always shows the data type name (e.g. "texts") instead of the user-defined label. Works correctly in v1. - **What**: Made `outputs` in `extractVueNodeData` reactive via `shallowReactive` + `defineProperty` (matching the existing `inputs` pattern). Added a `node:slot-label:changed` graph trigger that `SubgraphNode` fires when input/output labels are renamed, so the Vue layer picks up the change. - The `outputs` reactivity mirrors `inputs` exactly — same `shallowReactive` + setter pattern. The new trigger event forces `shallowReactive` to detect the deep property change by re-assigning the array. - Also handles input label renames for consistency, even though the current bug report is output-specific. **v1 — output correctly shows custom label "output_text":** <img width="1076" height="628" alt="Screenshot 2026-02-26 at 4 43 00 PM" src="https://github.com/user-attachments/assets/b4d6ae4c-9970-4d99-a872-4ce1b28522f2" /> **v2 before fix — output shows type name "texts" instead of custom label:** <img width="808" height="298" alt="Screenshot 2026-02-26 at 4 43 30 PM" src="https://github.com/user-attachments/assets/cf06aa6c-6d4d-4be9-9bcd-dcc072ed1907" /> **v2 after fix — output correctly shows "output_text":** <img width="1013" height="292" alt="Screenshot 2026-02-26 at 5 14 44 PM" src="https://github.com/user-attachments/assets/3c43fa9b-0615-4758-bee6-be3481168675" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9266-fix-subgraph-output-slot-labels-not-updating-in-v2-renderer-3146d73d365081979327fd775a6ef62b) by [Unito](https://www.unito.io)
|
|
|
|
…rg#9266) Custom names set on subgraph output nodes are ignored in the v2 renderer — it always shows the data type name (e.g. "texts") instead of the user-defined label. Works correctly in v1. - **What**: Made `outputs` in `extractVueNodeData` reactive via `shallowReactive` + `defineProperty` (matching the existing `inputs` pattern). Added a `node:slot-label:changed` graph trigger that `SubgraphNode` fires when input/output labels are renamed, so the Vue layer picks up the change. - The `outputs` reactivity mirrors `inputs` exactly — same `shallowReactive` + setter pattern. The new trigger event forces `shallowReactive` to detect the deep property change by re-assigning the array. - Also handles input label renames for consistency, even though the current bug report is output-specific. **v1 — output correctly shows custom label "output_text":** <img width="1076" height="628" alt="Screenshot 2026-02-26 at 4 43 00 PM" src="https://github.com/user-attachments/assets/b4d6ae4c-9970-4d99-a872-4ce1b28522f2" /> **v2 before fix — output shows type name "texts" instead of custom label:** <img width="808" height="298" alt="Screenshot 2026-02-26 at 4 43 30 PM" src="https://github.com/user-attachments/assets/cf06aa6c-6d4d-4be9-9bcd-dcc072ed1907" /> **v2 after fix — output correctly shows "output_text":** <img width="1013" height="292" alt="Screenshot 2026-02-26 at 5 14 44 PM" src="https://github.com/user-attachments/assets/3c43fa9b-0615-4758-bee6-be3481168675" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9266-fix-subgraph-output-slot-labels-not-updating-in-v2-renderer-3146d73d365081979327fd775a6ef62b) by [Unito](https://www.unito.io)
…rg#9266) Custom names set on subgraph output nodes are ignored in the v2 renderer — it always shows the data type name (e.g. "texts") instead of the user-defined label. Works correctly in v1. - **What**: Made `outputs` in `extractVueNodeData` reactive via `shallowReactive` + `defineProperty` (matching the existing `inputs` pattern). Added a `node:slot-label:changed` graph trigger that `SubgraphNode` fires when input/output labels are renamed, so the Vue layer picks up the change. - The `outputs` reactivity mirrors `inputs` exactly — same `shallowReactive` + setter pattern. The new trigger event forces `shallowReactive` to detect the deep property change by re-assigning the array. - Also handles input label renames for consistency, even though the current bug report is output-specific. **v1 — output correctly shows custom label "output_text":** <img width="1076" height="628" alt="Screenshot 2026-02-26 at 4 43 00 PM" src="https://github.com/user-attachments/assets/b4d6ae4c-9970-4d99-a872-4ce1b28522f2" /> **v2 before fix — output shows type name "texts" instead of custom label:** <img width="808" height="298" alt="Screenshot 2026-02-26 at 4 43 30 PM" src="https://github.com/user-attachments/assets/cf06aa6c-6d4d-4be9-9bcd-dcc072ed1907" /> **v2 after fix — output correctly shows "output_text":** <img width="1013" height="292" alt="Screenshot 2026-02-26 at 5 14 44 PM" src="https://github.com/user-attachments/assets/3c43fa9b-0615-4758-bee6-be3481168675" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9266-fix-subgraph-output-slot-labels-not-updating-in-v2-renderer-3146d73d365081979327fd775a6ef62b) by [Unito](https://www.unito.io)
|
@DrJKL Backport PRs ready for review:
Both typecheck clean and affected tests pass. Conflicts resolved by keeping target branch versions of |
… v2 renderer (#10727) Backport of #9266 to core/1.41. Cherry-pick of merge commit 5640eb7 with conflict resolution in: - `useGraphNodeManager.ts` — kept target's `extractVueNodeData` re-call - `SubgraphNode.ts` — kept target's comment and `_invalidatePromotedViewsCache` ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10727-backport-core-1-41-fix-subgraph-output-slot-labels-not-updating-in-v2-renderer-3336d73d3650819494f1f51b89aa2017) by [Unito](https://www.unito.io)
…n v2 renderer (#10728) Backport of #9266 to cloud/1.41. Cherry-pick of merge commit 5640eb7 with conflict resolution in: - `useGraphNodeManager.ts` — kept target's `extractVueNodeData` re-call - `SubgraphNode.ts` — kept target's comment and `_invalidatePromotedViewsCache` ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10728-backport-cloud-1-41-fix-subgraph-output-slot-labels-not-updating-in-v2-renderer-3336d73d365081e587bff11b35972f91) by [Unito](https://www.unito.io)
## Summary Custom names set on subgraph output nodes are ignored in the v2 renderer — it always shows the data type name (e.g. "texts") instead of the user-defined label. Works correctly in v1. ## Changes - **What**: Made `outputs` in `extractVueNodeData` reactive via `shallowReactive` + `defineProperty` (matching the existing `inputs` pattern). Added a `node:slot-label:changed` graph trigger that `SubgraphNode` fires when input/output labels are renamed, so the Vue layer picks up the change. ## Review Focus - The `outputs` reactivity mirrors `inputs` exactly — same `shallowReactive` + setter pattern. The new trigger event forces `shallowReactive` to detect the deep property change by re-assigning the array. - Also handles input label renames for consistency, even though the current bug report is output-specific. ## Screenshots **v1 — output correctly shows custom label "output_text":** <img width="1076" height="628" alt="Screenshot 2026-02-26 at 4 43 00 PM" src="https://github.com/user-attachments/assets/b4d6ae4c-9970-4d99-a872-4ce1b28522f2" /> **v2 before fix — output shows type name "texts" instead of custom label:** <img width="808" height="298" alt="Screenshot 2026-02-26 at 4 43 30 PM" src="https://github.com/user-attachments/assets/cf06aa6c-6d4d-4be9-9bcd-dcc072ed1907" /> **v2 after fix — output correctly shows "output_text":** <img width="1013" height="292" alt="Screenshot 2026-02-26 at 5 14 44 PM" src="https://github.com/user-attachments/assets/3c43fa9b-0615-4758-bee6-be3481168675" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9266-fix-subgraph-output-slot-labels-not-updating-in-v2-renderer-3146d73d365081979327fd775a6ef62b) by [Unito](https://www.unito.io)

Summary
Custom names set on subgraph output nodes are ignored in the v2 renderer — it always shows the data type name (e.g. "texts") instead of the user-defined label. Works correctly in v1.
Changes
outputsinextractVueNodeDatareactive viashallowReactive+defineProperty(matching the existinginputspattern). Added anode:slot-label:changedgraph trigger thatSubgraphNodefires when input/output labels are renamed, so the Vue layer picks up the change.Review Focus
outputsreactivity mirrorsinputsexactly — sameshallowReactive+ setter pattern. The new trigger event forcesshallowReactiveto detect the deep property change by re-assigning the array.Screenshots
v1 — output correctly shows custom label "output_text":

v2 before fix — output shows type name "texts" instead of custom label:

v2 after fix — output correctly shows "output_text":

┆Issue is synchronized with this Notion page by Unito