fix(studio): make a multi-selection work and survive - #3133
Merged
miguel-heygen merged 0 commit intoAug 9, 2026
Conversation
miguel-heygen
force-pushed
the
stack/p6-canvas-selection
branch
from
August 9, 2026 15:39
1af1080 to
6fc7026
Compare
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.
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
Sixth of eight stacked PRs re-cutting #3077. Carries the gesture-handler extraction the selection fixes build on.