Skip to content

@remotion/studio: Fix multiple marquee selection - #9505

Merged
JonnyBurger merged 4 commits into
mainfrom
codex/fix-multiple-marquee-selection
Jul 23, 2026
Merged

@remotion/studio: Fix multiple marquee selection#9505
JonnyBurger merged 4 commits into
mainfrom
codex/fix-multiple-marquee-selection

Conversation

@JonnyBurger

Copy link
Copy Markdown
Member

Summary

  • allow Cmd/Ctrl+marquee to extend the current keyframe and easing selection
  • preserve the existing selection from pointer-down through the marquee drag
  • avoid duplicate selections and add regression coverage

Testing

  • bun test packages/studio/src/test/clear-selection-on-pointer-down.test.ts packages/studio/src/test/timeline-selection.test.ts
  • bun run build
  • bun run stylecheck

Closes #9379

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Jul 23, 2026 9:07am
remotion Ready Ready Preview, Comment Jul 23, 2026 9:07am

Request Review

@pullfrog pullfrog 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 new issues found.

Reviewed changes — Allows Cmd/Ctrl+marquee drag to extend the existing timeline selection (keyframes, easings, sequences) instead of replacing it, while preserving Shift+marquee's existing no-op behavior.

  • Add extendTimelineMarqueeSelection — merges a current selection with a marquee-drag selection, filtering incompatible items and deduplicating by selection key.
  • Wire Cmd/Ctrl+marquee through useTimelineMarqueeSelection — captures selectedItems at pointer-down for use as the extending base, and applies extendTimelineMarqueeSelection when the marquee was started with a modifier key held.
  • Preserve selection on Cmd/Ctrl pointer-downshouldClearSelectionOnPointerDown now accepts ctrlKey/metaKey and returns false when either is true, preventing selection loss before an extending marquee starts.
  • Add regression tests — unit coverage for extend marquee merging, empty-marquee preservation, duplicate removal, and modifier-key blocking of selection clear.

The implementation is clean: the selectionBeforeMarquee snapshot captures the selection at pointer-down time, the extendSelection flag gates the extend path, and the merge function correctly handles empty marquees, incompatible kinds, and duplicates. The selectedItems dependency addition in useCallback is a standard pattern with negligible cost.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) (Claude Opus not used — the program covers this model; add its provider key to run your pick) | 𝕏

@pullfrog pullfrog 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 new issues found.

Reviewed changes since prior review — commit 4c3d07d tightens the shouldClearSelectionOnPointerDown parameter types from optional (ctrlKey?: boolean) to required-nullable (ctrlKey: boolean | null) and switches from truthy modifier-key checks to strict === true comparisons. Tests are updated to pass explicit null values.

  • Stricter parameter typing in shouldClearSelectionOnPointerDownctrlKey/metaKey are now required boolean | null fields, forcing callers to be explicit. The === true check is equivalent to the prior truthy check for boolean inputs and prevents inadvertent truthy matches on non-boolean values.
  • Test cleanup — all test callsites now pass ctrlKey: null, metaKey: null explicitly, making modifier-key intent visible at each assertion.

The callers (Preview.tsx, EditorContent.tsx) already pass standard DOM PointerEvent objects whose .ctrlKey/.metaKey are always boolean, so the type change requires no caller refactoring and the === true check produces identical runtime behavior.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) (Claude Opus not used — the program covers this model; add its provider key to run your pick) | 𝕏

@JonnyBurger
JonnyBurger merged commit 41d72ad into main Jul 23, 2026
30 of 31 checks passed
@JonnyBurger
JonnyBurger deleted the codex/fix-multiple-marquee-selection branch July 23, 2026 09:44
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.

Multiple marquee selection does not work

1 participant