`@remotion/canvas`: Support composition edits in Canvas codemods
Problem
@remotion/canvas supports authoring interactions for sequences, props, keyframes, and outlines, but it does not expose composition or folder editing through its codemod integration.
The composition-editing work in #11747 adds explicit operations for:
- adding, duplicating, renaming, updating, deleting, and moving compositions
- adding, renaming, unwrapping, and moving folders
Canvas-based authoring interfaces cannot currently use the equivalent workflow while keeping their composition tree and node paths synchronized.
They also do not inherit Studio's no-flicker Fast Refresh synchronization. @remotion/browser-bundler currently performs React Refresh before template-vibe-code publishes the newly compiled files and re-registers node paths with controller.setSequenceNodePaths(). This can temporarily pair the refreshed React tree with stale source node paths.
Desired behavior
Add composition-edit support for Canvas codemods, including the node-path remappings needed to preserve selection and editing state when a composition or folder edit changes source order.
The Canvas API should cover the composition and folder operations supported by Studio and Browser Studio without requiring consumers to reproduce Studio-specific request handling.
Acceptance criteria
- Composition and folder edits expose the node-path remappings needed by Canvas-based editors.
- Canvas or Browser Bundler hosts can stage those remappings before applying a Fast Refresh update.
- The remappings are committed synchronously immediately before React commits the refreshed tree, so there is no render with new elements paired to old node paths.
- Selection, overrides, timeline entries, and inspector state follow the remapped paths without flickering or temporarily targeting neighboring elements.
template-vibe-codeuses this mechanism instead of repairing its Canvas node-path registration only afterapplyBundle()resolves.
Source: remotion-dev/remotion