Skip to content

fix(studio): make a multi-selection work and survive - #3133

Merged
miguel-heygen merged 0 commit into
stack/p5-mixed-colour-swatchfrom
stack/p6-canvas-selection
Aug 9, 2026
Merged

fix(studio): make a multi-selection work and survive#3133
miguel-heygen merged 0 commit into
stack/p5-mixed-colour-swatchfrom
stack/p6-canvas-selection

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

Selecting several elements on the canvas works and stays selected: shift-click, marquee, timeline sync, and a URL that carries the whole selection.

Why

Multi-selection was broken in several independent ways. Shift-click added whichever element was hovered last rather than the one under the pointer. A marquee kept only the first element it caught. A group erased itself when the timeline synced back. Dropping a group deselected it. A marquee could not start outside the composition frame, so elements off-canvas were hard to reach. And a link to a bug hit with several elements selected only reproduced one of them, so reports read as "works for me".

How

The timeline is the source of truth for selection, and the canvas announces into it rather than holding a competing copy. Members are published only when there is more than one, since preserving a set that does not contain the id empties it. Losing one member re-resolves the group instead of clearing it. Snapping waits for the gesture to travel before it engages, so it cannot move a selection you have not dragged yet. The hash carries the rest of the selection as selGroup and reopens it; members whose element is gone are dropped rather than failing the others.

The frame handler moves to its own module on the way past — it had grown a snap block and a trace block inside a function already juggling four gesture kinds, past both the complexity and file-size gates.

Test plan

  • 2203 studio editor/hook/util tests
  • Marquee three elements from outside the canvas, drop them, and the selection survives; copy the hash, open it fresh, the same three come back

Sixth of eight stacked PRs re-cutting #3077. Carries the gesture-handler extraction the selection fixes build on.

@miguel-heygen
miguel-heygen force-pushed the stack/p6-canvas-selection branch from 1af1080 to 6fc7026 Compare August 9, 2026 15:39
@miguel-heygen
miguel-heygen merged commit 6fc7026 into main Aug 9, 2026
32 of 33 checks passed
@miguel-heygen
miguel-heygen deleted the stack/p6-canvas-selection branch August 9, 2026 15:40
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