- `LLink.resolve`: Resolves all IDs on the link to their respective
objects (node IDs, slot indexes)
- `LinkNetwork.getLink`: a more concise pattern to resolve links
### Virtual helper "slots"
Adds a virtual input and output slot to native reroutes, allowing links
to be dragged from them to other reroutes or nodes.
https://github.com/user-attachments/assets/67d308c4-4732-4b04-a2b9-0a2b0c79b413
### Notes
- Reroute slots automatically show an outline as the pointer gets close
- When the slot is clickable, it will highlight in the same colour as
the reroute
- Enables opposite direction connecting: from reroute to node outputs
- Floating reroutes only show one slot - to whichever side is not
connected
Adds a global API to notify devs / users of deprecated features.
- Custom callbacks may be added
- By default, remembers message text and only sends each message once
- Sends to console.warn by default
```ts
// Add a custom notification when a warning is encountered
const warnMessage = (message: string, source?: object) => {
addToast({ message, detail: object })
}
LiteGraph.onDeprecationWarning.push(warnMessage)
```
```ts
// Debugging flag. Repeats deprecation warnings every time they are reported.
// May impact performance.
LiteGraph.alwaysRepeatWarnings = true
```
Generate a warning
```ts
import { warnDeprecated } from "@/utils/feedback"
warnDeprecated(
"[DEPRECATED] graph.oldFeature() will be removed from Litegraph. " +
"Please use graph.newFeature() instead. https://helpful.site/faq",
objectThatCausedThis
)
```
Restores the full left-arrow button click area for widgets. Previously
lost ~5 canvas pixels to clicks intercepted by input sockets.
Supporting refactors:
- Maps concrete node slot impls. to private array, once per frame
- Converts slot boundingRect to use absolute canvas pos (same as other
elements)
- Stores parent node ref in concrete slot classes
### Node resize overhaul
- Precisely calculates node minimum size
- Prevents input & output overlap
- Prevents (normal*) widgets from rendering text over the edge of nodes
- Performance impact was sub-millisecond for normal usage in a 500-node
graph

_Minimum size for a few example node configurations_
### Widgets
- Converts hard-coded draw render values to class static properties
- Adds widget button draw function for left/right arrow widgets
_*_ Exception: `control_after_generate`, as it is not a true input /
widget. A check may be added later to handle this special case.
- `draw` is now skipped for slots that should not be shown (prev. drawn
with 0 alpha)
- Fixes slot always rendered when widget not found in `node.widgets`
- Remove redundant check from `isWidgetInputSlot` - type is already
`INodeInputSlot`
- Converts type assertions to use inference via discriminated unions
- Removes the LayoutElement class (only used by node slots, and recently
reduced to a single function)
- Splits `boundingRect` property out from `Positionable` interface
- Slots now use the standard `boundingRect` property
- Perf improvements / Removes redundant code
The current impls. do not work as intended; they will only assign the
additional info properties if there are at least three items in the
input array.
Adding replacements would be trivial, if required, and would benefit by
not inheriting the current public interface.
Confirmed unused via code search.
`reset()` is no longer automatically called after `dropLinks`. This
brings the API in line with original intent, and how canvas is already
configured; reset is called by `pointer.finally()`.
- Checks if `e.preventDefault()` has been called for all cancellable
LinkConnector callbacks
- Sets `cancelable: true` on dispatched events
- Dedupes canvas pointer calls
Follow up on https://github.com/Comfy-Org/litegraph.js/pull/915
Filter out non-serializable widgets during node configuration. Current
usage in frontend should not be affected as preview media widgets are
mostly dynamically added at the end of widget list.
Currently, when node defs are refreshed (e.g., by pressing "r"
shortcut), every single node def is logged, which is useless when
there's hundred of nodes and clutters console. This PR changes to only
log those messages when in debug mode.
https://github.com/Comfy-Org/ComfyUI_frontend/pull/3323
Some widgets are only used for display purpose (The preview image
widget), their value shouldn't be serialized into the workflow. This PR
adds a flag to allow widget to skip value serialization.
- Uses CanvasPointer click to open context menu (formerly occurred on
`pointerdown`)
- Frees up right-click & drag to be used by future features
- Right-clicking a reroute now selects the reroute, using the same
selection logic used for right-clicking nodes
Current: Right click in e.g. `textarea` leaves litegraph context menus
open.
Proposed: Any click anywhere outside the context menu (or its sub-menus)
will close all context menus.