Repository navigation
fix(canvas): drag every picked layer together, not just the one pressed - #471
Merged
Merged
Conversation
A drag on one of several picked layers moved only that layer, and a press on a non-primary pick collapsed the selection. The runtime's style gesture now carries the rest of the pick as followers, translated by the pressed layer's delta, restored on Escape and saved with it as one undo step; the hit tests know the whole pick, so a press inside any picked element moves it; the pressed layer becomes the pick's primary. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge; both previous findings are addressed, and no new actionable issue was found. SummaryDragging a picked layer now moves the other eligible picks in the same gesture.
Review was based on source inspection. No tests or browser captures were run.
|
…f the pick A drawing picked with other layers went through the single-drawing path and left the others behind; a picked parent named after its picked child was dropped from the followers. The drawing hit test defers a multi-picked drawing to the layer gesture, and followers are filtered as a whole so a picked parent wins over its descendants, as doop:nudge does. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Pick two elements in the Layers panel and drag one of them on the canvas: only the layer under the pointer moved. Pressing a non-primary picked layer also collapsed the selection to that layer, and a press on a child of a picked element picked the child instead of the group.
Fix
src/lib/frameRuntime.ts: the style gesture takesfollowers, the rest of the pick. Amoveof the pressed element translates each follower by the same design-px delta through its own translation basis; Escape restores their original inline styles; the commit saves all of them as one step. Nested, locked and non-movable followers are filtered out. The move and drawing hit tests accept the whole picked set, so a press inside any picked element moves that element.src/lib/frameBridge.ts:styleGesturepasses followers onbegin.src/components/ElementMove.tsx: when the pressed layer is part of a multi-pick, the others become followers, the pick is kept with the pressed layer as primary, and the move is always a free translation (a layout drop stays a single-layer feature). An ⌥⇧ copy still copies only the pressed layer..context/TECHSTACK.mdnotes the behaviour.Tests
Three new cases in
tests/drawingBrowser.test.ts: both layers move from a press on a child of one of them with one save and one undo step; Escape puts both back without saving; dragging an unpicked layer moves only that one. Drawing, resize, rotate, runtime and selection suites pass, as do typecheck, lint and format.🤖 Generated with Claude Code