Skip to content

Add Alt+drag layer duplication to the Layers panel - #4216

Merged
Keavon merged 2 commits into
masterfrom
alt-drag-layer-dupe
Jun 9, 2026
Merged

Keavon merged 2 commits into
masterfrom
alt-drag-layer-dupe

Conversation

@Keavon

@Keavon Keavon commented Jun 9, 2026

Copy link
Copy Markdown
Member

Closes #2824.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() uses expect(...) on a runtime lookup, so a missing NodeId(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: DuplicateSelectedLayersTo reparents 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

Comment thread editor/src/messages/portfolio/document/document_message_handler.rs
Comment thread editor/src/messages/portfolio/document/document_message_handler.rs Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@Keavon
Keavon merged commit bc1f63c into master Jun 9, 2026
10 checks passed
@Keavon
Keavon deleted the alt-drag-layer-dupe branch June 9, 2026 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate in Layers Panel with Alt+Drag

1 participant