Add Alt+drag layer duplication to the Layers panel - #4216
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to duplicate selected layers by holding the Alt key while dragging and dropping them in the layers panel. It adds a new DuplicateSelectedLayersTo message, implements a helper method duplicate_layer to handle copying a layer and its upstream node chain, and updates the frontend layers component to trigger duplication when the Alt key is pressed during a drag-and-drop operation. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
2 issues found across 4 files
Confidence score: 2/5
- There is a high-risk stability concern in
editor/src/messages/portfolio/document/document_message_handler.rs:duplicate_layer()usesexpect(...)on a runtime lookup, so a missingNodeId(0)can panic and crash the editor instead of failing gracefully. - There is also a concrete user-facing regression risk in
editor/src/messages/portfolio/document/document_message_handler.rs:DuplicateSelectedLayersToreparents duplicates without preserving world-space transform, which can cause duplicated layers to visibly jump under transformed parents. - Given the 6–7/10 severity issues and strong confidence on the panic path, this is likely not safe to merge until these behaviors are handled defensively.
- Pay close attention to
editor/src/messages/portfolio/document/document_message_handler.rs- prevent panic-based failure in duplication and preserve world-space transforms when reparenting duplicates.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Closes #2824.