mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-04 21:22:07 +00:00
Further subgraph improvements (#6466)
- Prune disconnected widgets on config panel open - Fix breakage of DOMWidgets on double nest - Fix self clipping of proxied DOMWidget nodes - Blacklist cloning of promtoed widget prop ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6466-Further-subgraph-improvements-29c6d73d365081c8b63dda068486805c) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -48,9 +48,12 @@ type Overlay = Partial<IBaseWidget> & {
|
||||
* on the linked widget
|
||||
*/
|
||||
type ProxyWidget = IBaseWidget & { _overlay: Overlay }
|
||||
function isProxyWidget(w: IBaseWidget): w is ProxyWidget {
|
||||
export function isProxyWidget(w: IBaseWidget): w is ProxyWidget {
|
||||
return (w as { _overlay?: Overlay })?._overlay?.isProxyWidget ?? false
|
||||
}
|
||||
export function isDisconnectedWidget(w: ProxyWidget) {
|
||||
return w instanceof disconnectedWidget.constructor
|
||||
}
|
||||
|
||||
export function registerProxyWidgets(canvas: LGraphCanvas) {
|
||||
//NOTE: canvasStore hasn't been initialized yet
|
||||
@@ -167,7 +170,7 @@ function resolveLinkedWidget(
|
||||
if (!n) return [undefined, undefined]
|
||||
const widget = n.widgets?.find((w: IBaseWidget) => w.name === widgetName)
|
||||
//Slightly hacky. Force recursive resolution of nested widgets
|
||||
if (widget instanceof disconnectedWidget.constructor && isProxyWidget(widget))
|
||||
if (widget && isProxyWidget(widget) && isDisconnectedWidget(widget))
|
||||
widget.computedHeight = 20
|
||||
return [n, widget]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user