-
Notifications
You must be signed in to change notification settings - Fork 624
fix: suppress link rendering during slot sync after graph reconfigure #8367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
299386a
bf21a05
2e1845b
c2d548b
0e97abc
312d0ae
14d5bbe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,8 @@ import { reactive, unref } from 'vue' | |
| import { shallowRef } from 'vue' | ||
|
|
||
| import { useCanvasPositionConversion } from '@/composables/element/useCanvasPositionConversion' | ||
| import { layoutStore } from '@/renderer/core/layout/store/layoutStore' | ||
| import { flushScheduledSlotLayoutSync } from '@/renderer/extensions/vueNodes/composables/useSlotElementTracking' | ||
| import { registerProxyWidgets } from '@/core/graph/subgraph/proxyWidget' | ||
| import { st, t } from '@/i18n' | ||
| import type { IContextMenuValue } from '@/lib/litegraph/src/interfaces' | ||
|
|
@@ -730,17 +732,31 @@ export class ComfyApp { | |
| private addAfterConfigureHandler(graph: LGraph) { | ||
| const { onConfigure } = graph | ||
| graph.onConfigure = function (...args) { | ||
| fixLinkInputSlots(this) | ||
| // Set pending sync flag to suppress link rendering until slots are synced | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential stuck state: if
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in commit c2d548b - wrapped the |
||
| if (LiteGraph.vueNodesMode) { | ||
| layoutStore.setPendingSlotSync(true) | ||
| } | ||
|
|
||
| try { | ||
| fixLinkInputSlots(this) | ||
|
|
||
| // Fire callbacks before the onConfigure, this is used by widget inputs to setup the config | ||
| triggerCallbackOnAllNodes(this, 'onGraphConfigured') | ||
| // Fire callbacks before the onConfigure, this is used by widget inputs to setup the config | ||
| triggerCallbackOnAllNodes(this, 'onGraphConfigured') | ||
|
|
||
| const r = onConfigure?.apply(this, args) | ||
| const r = onConfigure?.apply(this, args) | ||
|
|
||
| // Fire after onConfigure, used by primitives to generate widget using input nodes config | ||
| triggerCallbackOnAllNodes(this, 'onAfterGraphConfigured') | ||
| // Fire after onConfigure, used by primitives to generate widget using input nodes config | ||
| triggerCallbackOnAllNodes(this, 'onAfterGraphConfigured') | ||
|
|
||
| return r | ||
| return r | ||
| } finally { | ||
| // Flush pending slot layout syncs to fix link alignment after undo/redo | ||
| // Using finally ensures links aren't permanently suppressed if an error occurs | ||
| if (LiteGraph.vueNodesMode) { | ||
| flushScheduledSlotLayoutSync() | ||
| app.canvas?.setDirty(true, true) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.