var-picker not update when edges change in node panel
Self Checks
- [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [X] Please do not modify this template :) and fill in all the required fields.
Dify version
0.8.0
Cloud or Self Hosted
Cloud
Steps to reproduce
When focusing on a node and changing the connection, the variables in the var-picker will not be updated to the latest.
https://github.com/user-attachments/assets/d51d62e5-0c65-4aee-822d-b91d6b268a56
✔️ Expected Behavior
var list updated to the latest when connected edges change.
❌ Actual Behavior
Refresh only when switching node panel.
Hey @HiChen404! 👋 I'm here to help you with bug fixes, questions, and more while you wait for a human maintainer. Let's squash those bugs together!
The var-picker does not update when edges change in the node panel in Dify version 0.8.0 because the current implementation lacks logic to update the var-picker when edges are modified. The existing code handles various node interactions but does not include functionality to update the var-picker based on edge changes [1].
To resolve this issue, you need to add logic to update the var-picker whenever edges are changed. This could involve adding a function that specifically updates the var-picker and calling it within the relevant edge-handling functions. The useEdgesInteractions hook includes functions like handleEdgesChange that manage edge interactions and could be extended to trigger updates to the var-picker [2].
Additionally, leveraging the event emitter context (useEventEmitterContextContext) could help trigger updates to the var-picker by subscribing to relevant events and dispatching commands accordingly [3].
To continue talking to Dosu, mention @dosu.
Fixed: https://github.com/langgenius/dify/pull/8259