fix(workflow): attach cmdk-added blocks to the selected block - #6836
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Auto-connect now picks a root-level source in order: the rightmost eligible selected block, then last interacted block this session (also used for z-order), then the only flow block on a fresh workflow. If nothing qualifies, the block is added without an edge instead of guessing a wire. Placement places connected blocks one autolayout column to the right of the source (vertically centered, then nudged below overlapping root blocks). Unattached adds park under the rightmost root flow column; viewport center is only the last fallback. Drag-drop and handle-release adds still use proximity-based Also includes the next dev generated Reviewed by Cursor Bugbot for commit 1a6f6fe. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR changes positionless workflow-block additions to connect and position relative to an eligible selected or recently interacted block, with a deterministic fallback for unattached additions.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx | Updates positionless block source resolution and placement; both previously reported selection-order and note-anchor issues are resolved at current HEAD. |
| apps/sim/AGENTS.md | Adds generated Next.js agent guidance without affecting application runtime behavior. |
Reviews (2): Last reviewed commit: "fix(workflow): validate positionless-add..." | Re-trigger Greptile
… park unattached blocks in the rightmost column
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1a6f6fe. Configure here.
| if (!node.selected || !isEligibleSource(node.id)) continue | ||
| if (!sourceId || blocks[node.id].position.x > blocks[sourceId].position.x) { | ||
| sourceId = node.id | ||
| } |
There was a problem hiding this comment.
Same-column multi-select source tie
Low Severity
When several eligible selected blocks share the same x — typical for fan-out siblings stacked by nudgeBelowOccupiedSpots — the rightmost picker only uses a strict > on blocks.position.x, so the winner stays whichever node appears first in getNodes(). That is not a visual-end choice and can auto-connect from an arbitrary co-column sibling.
Reviewed by Cursor Bugbot for commit 1a6f6fe. Configure here.


Summary
Type of Change
Testing
Tested manually against the running app: fresh-workflow first add, chained cmdk adds, deselected add (last-touched fallback), fan-out from a re-selected upstream block, and a fresh load of an untouched multi-block workflow (rightmost-column parking, no edge). Lint, type-check, and the full audit suite pass.
Checklist