Skip to content

Comments

@remotion/studio: When duplicating composition, jump to new one#6618

Merged
JonnyBurger merged 2 commits intomainfrom
fix/jump-to-duplicated-composition
Feb 20, 2026
Merged

@remotion/studio: When duplicating composition, jump to new one#6618
JonnyBurger merged 2 commits intomainfrom
fix/jump-to-duplicated-composition

Conversation

@JonnyBurger
Copy link
Member

Summary

  • After duplicating a composition, the studio now automatically navigates to the new composition
  • Adds an optional onSuccess callback to CodemodFooter, called after the codemod is successfully applied
  • DuplicateComposition uses this callback to push the URL and set the canvas content to the new composition ID

Previously, after duplicating a composition the user stayed on the original composition, which was confusing.

Closes #5111

Test plan

  • Right-click a composition → Duplicate → confirm duplication
  • Verify the studio navigates to the newly created composition after duplication
  • Verify rename and delete codemods still work as before (no regression from the optional onSuccess prop)

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings February 20, 2026 14:16
@vercel
Copy link
Contributor

vercel bot commented Feb 20, 2026

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

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Feb 20, 2026 3:05pm
remotion Ready Ready Preview, Comment Feb 20, 2026 3:05pm

Request Review

Copy link
Contributor

@pullfrog pullfrog bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Pullfrog  | View workflow runpullfrog.com𝕏

Copy link
Contributor

@pullfrog pullfrog bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Pullfrog  | View workflow runpullfrog.com𝕏

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 onSuccess callback to CodemodFooter, invoked after a successful codemod apply.
  • Use the new onSuccess hook in DuplicateComposition to 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.

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>
@JonnyBurger JonnyBurger force-pushed the fix/jump-to-duplicated-composition branch from b50406f to 7217502 Compare February 20, 2026 14:30
@JonnyBurger JonnyBurger changed the title Studio: Jump to duplicated composition after creation @remotion/studio: When duplicating composition, jump to new one Feb 20, 2026
Copy link
Member Author

@JonnyBurger JonnyBurger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pullfrog can you

@pullfrog
Copy link
Contributor

pullfrog bot commented Feb 20, 2026

Both review comments from @JonnyBurger have already been addressed in commit cfb59940bd:

  1. InitialCompositionLoader.tsx:97 — An explanatory comment was added describing the URL-based composition switching logic.
  2. CodemodFooter.tsx:21onSuccess was changed from optional (onSuccess?: () => void) to mandatory but nullable (onSuccess: (() => void) | null), with DeleteComposition and RenameComposition updated to pass onSuccess={null}.

No further changes needed.

Pullfrog  | View workflow run | Using Cursor CLI | Triggered by Pullfrogpullfrog.com𝕏

@JonnyBurger JonnyBurger merged commit d3f0b60 into main Feb 20, 2026
18 checks passed
@JonnyBurger JonnyBurger deleted the fix/jump-to-duplicated-composition branch February 20, 2026 15:16
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.

Studio: Once a composition is "duplicated", it should jump to it

1 participant