Open johnpccd opened 7 hours ago
The issue you're experiencing with the 'Organize blocks' feature affecting the vertical order of nodes might be related to how the current implementation determines the order of nodes. The implementation compares the x-coordinates of nodes to determine their vertical order, which might not always align with the expected behavior [1].
The handleLayout
function in the useWorkflowOrganize
hook is responsible for organizing the nodes. It uses the getLayoutByDagre
utility to calculate the layout and updates the node positions based on this layout. This process might be causing the unexpected vertical order [2].
To address this, you might want to review the logic in the handleLayout
function and the criteria used for node positioning. Adjusting the logic to better account for the desired vertical order could help resolve the issue.
To continue talking to Dosu, mention @dosu.
Self Checks
Dify version
0.11.2
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Create a Workflow that looks like this: Click the Organize block button
✔️ Expected Behavior
Correct vertical order of blocks
❌ Actual Behavior