fix: Power Puter outputs widget — Nodes 2.0 (Vue renderer) compatibility#727
Open
phazei wants to merge 1 commit into
Open
fix: Power Puter outputs widget — Nodes 2.0 (Vue renderer) compatibility#727phazei wants to merge 1 commit into
phazei wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Power Puter's custom OutputsWidget (output type chips + "+" button) is completely
non-functional in the Nodes 2.0 Vue renderer:
All three work correctly in the legacy LiteGraph renderer.
Root Cause
Click handling (
utils_widgets.ts):WidgetLegacy.vuewraps custom widgets in amini-canvas. On
pointerdown, coordinates are mini-canvas-local (correct), sohitAreabounds matching works and handlers are queued in
downedHitAreasForClick. Onpointerup,coordinates arrive in node-local space (offset by title bar + widgets above) via
CanvasPointer.finallyinprocessWidgetClick. The bounds re-check onpointerupalwaysfails because the coordinate systems don't match.
Widget redraw (
power_puter.ts): LiteGraph continuously repaints the canvas, sodraw()is called every frame. The Vue renderer only callsdraw()whenwidget.triggerDraw()is invoked. Afterstabilize()modifies the outputs, nothingtriggers a redraw.
Output labels (
power_puter.ts):addOutput("", "")creates slots withname="".setOutputs()setstypeandlabelbut notname. Vue'sOutputSlot.vuehides thelabel text when
name === ""(viahasNoLabelcomputed). In LiteGraph, the canvas rendererfalls through to
labelfor display, so this was never noticed.Fix
utils_widgets.ts— Removepointerupbounds re-check foronClickhandlers. ThedownedHitAreasForClickarray is only populated duringpointerdownafter a successfulbounds check. Re-validating on
pointerupis redundant (and broken in Vue mode). This issafe in LiteGraph mode — minor UX change where a click fires even if the cursor drifts
slightly between down and up, which is standard button behavior.
power_puter.ts—stabilize(): AddedtriggerDraw()call to refresh the mini-canvaswidget, and an outputs array splice to poke Vue's
shallowReactiveproxy so output slotcomponents re-render with updated properties.
power_puter.ts—setOutputs(): Addedoutput.name = outputLabel || output.typealongside the existing
labelassignment so Vue'sOutputSlotdisplays the type label.Known Limitation
When the "Workflow Overview" sidebar panel is open, it binds to the same widget and
overwrites
triggerDraw(single-slot design inWidgetLegacy.vue). The node's mini-canvaswon't update until the sidebar is closed or the node is resized. This is a ComfyUI frontend
architectural limitation, not something fixable from the extension side.
Testing
output port labels show correctly