-
Notifications
You must be signed in to change notification settings - Fork 376
fix Vue node widgets should be in disabled state if their slots are connected with a link #5834
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
base: main
Are you sure you want to change the base?
Conversation
🎭 Playwright Test Results❌ Some tests failed ⏰ Completed at: 09/28/2025, 08:47:05 PM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
<NodeWidgets | ||
v-if="nodeData.widgets?.length" | ||
v-memo="[nodeData.widgets?.length]" | ||
v-memo="[nodeData.widgets?.length, nodeData.inputs]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would happen if we just removed the v-memo
and let Vue handle it?
v-memo="[nodeData.widgets?.length, nodeData.inputs]" |
|
||
export class NodeInputSlot extends NodeSlot implements INodeInputSlot { | ||
link: LinkId | null | ||
private _link: LinkId | null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two points of personal preference for this pattern:
I usually like an Internal
suffix, i.e. linkInternal
to the underscore prefix. Feels more expressive and helps with IDEs' outlines if you sort fields lexicographically.
I also don't love null
over undefined
since it does usually entail adding nullish coalescing to pick the specific correct absent value (when otherwise the absent value is undefined
in the default case)
graph.trigger('node:slot-links:changed', { | ||
nodeId: this.node.id, | ||
slotType: NodeSlotType.INPUT, | ||
slotIndex: index, | ||
connected: this._link != null, | ||
linkId: this._link ?? null | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like something that we should be doing in a store, if not now, then soon. I don't like complex decisions being made in components.
nodeId: this.node.id, | ||
slotType: NodeSlotType.INPUT, | ||
slotIndex: index, | ||
connected: this._link != null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
connected: this._link != null, | |
connected: this.isConnected, |
slotType: NodeSlotType.INPUT, | ||
slotIndex: index, | ||
connected: this._link != null, | ||
linkId: this._link ?? null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linkId: this._link ?? null | |
linkId: this.link |
const index = this.node.inputs.indexOf(this) | ||
if (index === -1) return | ||
|
||
graph.trigger('node:slot-links:changed', { | ||
nodeId: this.node.id, | ||
slotType: NodeSlotType.INPUT, | ||
slotIndex: index, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
option:
const index = this.node.inputs.indexOf(this) | |
if (index === -1) return | |
graph.trigger('node:slot-links:changed', { | |
nodeId: this.node.id, | |
slotType: NodeSlotType.INPUT, | |
slotIndex: index, | |
const slotIndex = this.node.inputs.indexOf(this) | |
if (slotIndex === -1) return | |
graph.trigger('node:slot-links:changed', { | |
nodeId: this.node.id, | |
slotType: NodeSlotType.INPUT, | |
slotIndex, |
|
||
vueNodeData.set(nodeId, { | ||
...currentData, | ||
inputs: node.inputs ? [...node.inputs] : undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR, but what if we defined inputs and outputs as being required, so that a lack of them would just be an empty array? Would that simplify some of the logic?
Summary
Fixes #5692 by making widget link connection status trigger on change so Vue widgets with connected links could properly switch to the
disabled
state when they are implicitly converted to inputs.Changes
node:slot-links:changed
event tracking and reactive slot data synchronization for Vue widgetsReview Focus
Widget reactivity performance with frequent link changes and event handler memory management in graph operations.
┆Issue is synchronized with this Notion page by Unito