Skip to content

fix(canvas): drag every picked layer together, not just the one pressed - #471

Merged
kgoedecke merged 2 commits into
mainfrom
kgoedecke/fix-multi-element-layer
Nov 10, 2026
Merged

kgoedecke merged 2 commits into
mainfrom
kgoedecke/fix-multi-element-layer

Conversation

@kgoedecke

Copy link
Copy Markdown
Collaborator

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 takes followers, the rest of the pick. A move of 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: styleGesture passes followers on begin.
  • 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.md notes 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

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>
@greptile-apps

greptile-apps Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both previous findings are addressed, and no new actionable issue was found.

Summary

Dragging a picked layer now moves the other eligible picks in the same gesture.

  • Dragging a picked layer moves the other picked layers with it.

Review was based on source inspection. No tests or browser captures were run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Press a picked layer or drawing] --> B[Find the picked root]
  B --> C[Begin shared style gesture]
  C --> D[Keep eligible followers and remove nested duplicates]
  D --> E[Translate each layer by the same delta]
  E --> F{Finish}
  F -->|Release| G[Save once]
  F -->|Escape| H[Restore original styles]
Loading

Reviews (2) · Last reviewed commit: "fix(canvas): move a picked drawing and p..." · Reviewed by Greptile

Comment thread src/components/ElementMove.tsx Resolved
Comment thread src/lib/frameRuntime.ts Resolved
…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>
@kgoedecke

Copy link
Copy Markdown
Collaborator Author

@greptileai

@kgoedecke
kgoedecke merged commit 29bd283 into main Nov 10, 2026
9 of 11 checks passed
kgoedecke added a commit that referenced this pull request Nov 10, 2026
#484 made patchStyle take the element so it can weigh a stylesheet's
!important, and the multi-layer drag (#471) still handed it a style object:
every follower threw inside the frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kgoedecke added a commit that referenced this pull request Nov 11, 2026
#484 made patchStyle take the element so it can weigh a stylesheet's
!important, and the multi-layer drag (#471) still handed it a style object:
every follower threw inside the frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant