@remotion/studio: When duplicating composition, jump to new one#6618
@remotion/studio: When duplicating composition, jump to new one#6618JonnyBurger merged 2 commits intomainfrom
@remotion/studio: When duplicating composition, jump to new one#6618Conversation
There was a problem hiding this comment.
Clean, minimal change. The onSuccess callback follows the established navigation pattern from InitialCompositionLoader and the optional prop is backward-compatible with existing CodemodFooter consumers (DeleteComposition, RenameComposition). No issues found.
There was a problem hiding this comment.
Clean, well-scoped change. The onSuccess callback pattern in CodemodFooter is a good extension point, and DuplicateComposition follows the same navigation pattern established by useSelectComposition in InitialCompositionLoader.tsx. The optional prop avoids any regression for DeleteComposition and RenameComposition. LGTM.
There was a problem hiding this comment.
Pull request overview
This PR improves the Studio duplication flow by automatically navigating to the newly duplicated composition after the codemod succeeds, reducing confusion from staying on the original composition.
Changes:
- Add an optional
onSuccesscallback toCodemodFooter, invoked after a successful codemod apply. - Use the new
onSuccesshook inDuplicateCompositionto push the new URL, update canvas content, and focus the compositions panel.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/studio/src/components/NewComposition/DuplicateComposition.tsx | After duplication, navigates to the new composition by updating URL + canvas content and focusing the compositions panel. |
| packages/studio/src/components/NewComposition/CodemodFooter.tsx | Extends the footer API with an optional onSuccess callback and invokes it after codemod success. |
649ccb9 to
b50406f
Compare
After duplicating a composition, push the URL to the new composition ID. When HMR registers the new composition, InitialCompositionLoader detects the URL/canvasContent mismatch and navigates to it. Closes #5111 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b50406f to
7217502
Compare
@remotion/studio: When duplicating composition, jump to new one
packages/studio/src/components/NewComposition/CodemodFooter.tsx
Outdated
Show resolved
Hide resolved
|
Both review comments from @JonnyBurger have already been addressed in commit
No further changes needed. |

Summary
onSuccesscallback toCodemodFooter, called after the codemod is successfully appliedDuplicateCompositionuses this callback to push the URL and set the canvas content to the new composition IDPreviously, after duplicating a composition the user stayed on the original composition, which was confusing.
Closes #5111
Test plan
onSuccessprop)🤖 Generated with Claude Code