Skip to content

fix: Power Puter outputs widget — Nodes 2.0 (Vue renderer) compatibility#727

Open
phazei wants to merge 1 commit into
rgthree:mainfrom
phazei:fix/power_puter_nodes_2
Open

fix: Power Puter outputs widget — Nodes 2.0 (Vue renderer) compatibility#727
phazei wants to merge 1 commit into
rgthree:mainfrom
phazei:fix/power_puter_nodes_2

Conversation

@phazei
Copy link
Copy Markdown
Contributor

@phazei phazei commented May 23, 2026

Problem

The Power Puter's custom OutputsWidget (output type chips + "+" button) is completely
non-functional in the Nodes 2.0 Vue renderer:

  1. Clicks don't register — clicking chips or the "+" button does nothing
  2. Widget doesn't redraw after adding/removing/changing outputs
  3. Output port labels are missing — dots appear but without type labels (FLOAT, INT, etc.)

All three work correctly in the legacy LiteGraph renderer.

Root Cause

Click handling (utils_widgets.ts): WidgetLegacy.vue wraps custom widgets in a
mini-canvas. On pointerdown, coordinates are mini-canvas-local (correct), so hitArea
bounds matching works and handlers are queued in downedHitAreasForClick. On pointerup,
coordinates arrive in node-local space (offset by title bar + widgets above) via
CanvasPointer.finally in processWidgetClick. The bounds re-check on pointerup always
fails because the coordinate systems don't match.

Widget redraw (power_puter.ts): LiteGraph continuously repaints the canvas, so
draw() is called every frame. The Vue renderer only calls draw() when
widget.triggerDraw() is invoked. After stabilize() modifies the outputs, nothing
triggers a redraw.

Output labels (power_puter.ts): addOutput("", "") creates slots with name="".
setOutputs() sets type and label but not name. Vue's OutputSlot.vue hides the
label text when name === "" (via hasNoLabel computed). In LiteGraph, the canvas renderer
falls through to label for display, so this was never noticed.

Fix

utils_widgets.ts — Remove pointerup bounds re-check for onClick handlers. The
downedHitAreasForClick array is only populated during pointerdown after a successful
bounds check. Re-validating on pointerup is redundant (and broken in Vue mode). This is
safe 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.tsstabilize(): Added triggerDraw() call to refresh the mini-canvas
widget, and an outputs array splice to poke Vue's shallowReactive proxy so output slot
components re-render with updated properties.

power_puter.tssetOutputs(): Added output.name = outputLabel || output.type
alongside the existing label assignment so Vue's OutputSlot displays 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 in WidgetLegacy.vue). The node's mini-canvas
won'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

  • Nodes 2.0 ON: chips clickable, context menus appear, add/remove/change outputs works,
    output port labels show correctly
  • Nodes 2.0 OFF: no behavior change from current main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant