feat: drag and copy using alt+drag - #2738
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Builder reviewed your changes and found 1 potential issue 🟡
Review Details
Code Review Summary
PR #2738 adds Option/Alt-drag duplication for overview frames, including multi-frame selections, and tightens the editor's optimistic create/update path so concurrent duplicates are not lost. It also changes primitive creation selection semantics and forces a full preview document refresh for structural element copies. The overall approach is thoughtful: gesture cleanup is centralized, live refs avoid stale geometry, and the new unit/E2E coverage exercises frame, group, and element-copy behavior.
Risk assessment: Standard. The main concern is a multi-selection state-management issue: independent duplicate completions each focus their own newly created screen, so the final selection and camera depend on whichever request resolves last. This undermines the expected copied-group workflow and the explicit camera-stability intent. Other reviewed paths, including modifier release/cancellation, locked frames, and concurrent mutation handling, looked sound.
Key Findings
- 🟡 MEDIUM — Multi-frame alt-drag does not preserve the copied group as the final selection and may move the camera to an arbitrary clone.
🧪 Browser testing: Will run after this review (PR touches UI code)
| fromCount: screensRef.current.length, | ||
| addedCount: targets.length, | ||
| }; | ||
| targets.forEach((target) => { |
There was a problem hiding this comment.
🟡 Preserve the copied group selection after multi-frame alt-drag
Each selected frame starts an independent onDuplicate call, and each completion in the editor focuses its own newly created screen. As a result, the final selection (and camera focus) is whichever clone finishes last, rather than the copied group, despite this gesture explicitly suppressing camera recentering. Batch the operation or coordinate the completions so all created IDs are selected and the camera is retained once the group is complete.
Additional Info
Found by 1 of 3 code-review agents; validated against the per-frame completion path in DesignEditor.
|
Here's a visual recap of what changed: Open the full interactive recap |

No description provided.