Skip to content

@remotion/studio: Refactor timeline selection state for multiple items - #7808

Merged
JonnyBurger merged 5 commits into
mainfrom
jonnyburger/multi-select-timeline-items
May 30, 2026
Merged

@remotion/studio: Refactor timeline selection state for multiple items#7808
JonnyBurger merged 5 commits into
mainfrom
jonnyburger/multi-select-timeline-items

Conversation

@JonnyBurger

Copy link
Copy Markdown
Member

Summary

Refactors the timeline selection state from a single selectedItem to a selectedItems array so 0..n items can be selected at once. Existing single-click behaviour is preserved; shift / cmd / ctrl + click now toggles items into or out of the selection.

Details

  • Selected items must all share the same type (rows or keyframes). Adding a differently-typed item replaces the selection, and a runtime assertion enforces the invariant.
  • selectItem now accepts an optional {additive} flag wired into the click handlers in TimelineRowChrome, TimelineSequence, and TimelineKeyframeDiamond.
  • isSelected and containsSelection consider every selected item.
  • Backspace fires one delete API call per selected item in parallel (Promise.all) and clears the selection.

Split out from #7782. Closes #7799.

…le items

Internally switches the timeline selection state from a single selectedItem
to a selectedItems array, allowing zero, one or many items to be selected
at once. Selected items must all share the same type (rows or keyframes);
attempting to mix types replaces the existing selection, and a runtime
assertion enforces the invariant.

- selectItem now accepts an optional {additive} flag; click handlers pass
  it when shift/meta/ctrl is held so users can toggle items in and out of
  the selection.
- containsSelection and isSelected now consider every selected item.
- Backspace deletes every selected item in parallel via Promise.all and
  clears the selection once the requests are dispatched.

Split out from #7782. Closes #7799.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vercel

vercel Bot commented May 29, 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 May 29, 2026 3:32pm
remotion Ready Ready Preview, Comment May 29, 2026 3:32pm

Request Review

…efactor only)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@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.

Reviewed changes — Refactored timeline selection state from a single selectedItem to a selectedItems array with additive selection support (shift/cmd/ctrl + click), parallel batch deletion, and cleanup of the now-unused keyframed-value interpolation path.

  • Multi-select state management in TimelineSelection.tsx — Replaced selectedItem with selectedItems, added SelectItemOptions for additive toggling, and optimized isSelected with a Set of selection keys.
  • Batch deletion in TimelineDeleteKeybindings.tsx — Backspace now fires deleteSelectedTimelineItem in parallel via Promise.all and clears the selection afterward.
  • Additive click handlersTimelineRowChrome, TimelineSequence, and TimelineKeyframeDiamond all pass {additive: e.shiftKey || e.metaKey || e.ctrlKey} to onSelect.
  • Removed dead keyframed-value code — Deleted interpolate-keyframed-status.ts, its test file, and TimelineKeyframedValue.tsx; removed frame parameter from computeEffectiveSchemaValuesDotNotation and wrapInSchema.
  • Cleaned up keyframeDisplayOffset plumbing — Removed the prop from all expanded row/field components since keyframed values are no longer rendered inline.

ℹ️ Nitpicks

  • CanUpdateSequencePropStatusKeyframed is still exported from packages/core/src/use-schema.ts and re-exported via Internals, but nothing in the codebase references it anymore after this PR. Consider removing the type and its export to keep the surface clean.
  • assertSameType in TimelineSelection.tsx (line 105) is defensive but effectively unreachable through normal UI interaction because selectItem already replaces the selection when a differently-typed item is added. It doesn't hurt, but it's redundant.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Kimi K2𝕏

Comment thread packages/studio/src/components/Timeline/TimelineSelection.tsx Outdated

@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.

Reviewed changes (incremental) — The follow-up commit 2de6be2 reverts the user-facing additive-selection UI (shift/cmd/ctrl + click) from TimelineRowChrome, TimelineSequence, and TimelineKeyframeDiamond while keeping the internal refactor intact. This is a clean, conservative approach: the state layer now supports multiple selections and batch deletion, but the UI continues to behave as single-select until a future PR enables multi-select interactions.

  • Revert is complete — No dangling SelectItemOptions imports or additive handler logic remains in the three UI components.
  • Types remain consistentuseTimelineRowSelection and useTimelineKeyframeSelection still expose onSelect(options?), but the consumers' () => void prop types are assignable in TypeScript (optional parameters are compatible).
  • No regressions introduced — The revert only removes the modifier-key click handling; all internal state, selectedItems array logic, and Promise.all batch deletion remain unchanged.

Pullfrog  | View workflow run | Using Kimi K2𝕏

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reverts the removal of CanUpdateSequencePropStatusKeyframed: the type
is now consumed by interpolate-keyframed-status.ts and re-exported from
internals.ts on main, so it is no longer unused.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JonnyBurger
JonnyBurger merged commit 06f07f8 into main May 30, 2026
30 of 31 checks passed
@JonnyBurger
JonnyBurger deleted the jonnyburger/multi-select-timeline-items branch May 30, 2026 05:42
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.

Timeline: Refactor selection state for multiple selected items

1 participant