feat: copy and paste scene settings - #2377
Open
YoavLevavi wants to merge 2 commits into
Open
YoavLevavi wants to merge 2 commits into
YoavLevavi wants to merge 2 commits into
Conversation
Copy / Paste buttons on a selected scene (and Command-Shift-C / Command-Shift-V on selected scenes) carry its layout mode, split and camera framing and transitions to other scenes. Pasting applies to every selected scene and leaves each scene's timing untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| setCopiedSceneSettings({ | ||
| mode: segment.mode, | ||
| splitLayout: segment.splitLayout | ||
| ? structuredClone(segment.splitLayout) |
Contributor
There was a problem hiding this comment.
When a scene has a splitLayout, both Copy buttons and the timeline shortcut pass a scene from the Solid store to this helper. structuredClone cannot clone the nested store proxy, so copying throws before the settings reach the clipboard. Pasting that scene’s settings is therefore unavailable. Unwrap the layout before cloning it; the current test uses a plain object and does not cover this path.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/routes/editor/scene-clipboard.ts
Line: 18
Comment:
**Copying scene layouts throws**
When a scene has a `splitLayout`, both Copy buttons and the timeline shortcut pass a scene from the Solid store to this helper. `structuredClone` cannot clone the nested store proxy, so copying throws before the settings reach the clipboard. Pasting that scene’s settings is therefore unavailable. Unwrap the layout before cloning it; the current test uses a plain object and does not cover this path.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Author
There was a problem hiding this comment.
Fixed in daaa3bc. The split layout is now copied field by field instead of with structuredClone, so a scene from the store proxy copies correctly. Added a regression test that passes a Proxy-wrapped layout; structuredClone throws on it, and copying now succeeds.
structuredClone throws on Solid store proxies, so copying a scene with a split layout failed. Copy the layout fields explicitly instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Copy and paste scene settings between scenes.
This makes it quick to set up one scene and reuse its framing across a long edit.
Implementation
scene-clipboard.ts: pure helpers that extract the settings from a scene segment and apply them to others, keepingstart/end.pasteSceneSettingsapplies them to the selected scenes in onesetProjectcall, so each paste is a single undo step.Testing
tsc --noEmitare clean.🤖 Generated with Claude Code
The PR is not safe to merge until copying a scene with a layout override works from the store-backed editor.
Findings
Fix with agent prompt
Summary
The PR adds scene-setting copy and paste through sidebar buttons and timeline shortcuts, applying layout and transitions to selected scenes while preserving their timing.
Reviews (1) · Last reviewed commit: "feat: copy and paste scene settings"