Repository navigation
fix(audio): keep imported audio on its own clips through a clip reorder - #1045
Conversation
Every structural clip edit folded all fragments of a trackId into one span, first to last. After a reorder that span covered the clip now between the pieces, ran offsetMs past the end of the file, and pushed the next take past the programme end. Fold per stretch that still hangs together instead. A stretch that came apart becomes its own take and keeps its clip, length and offsetMs; moving the clip back joins them again. A clip edit that cuts a fragment's head now advances its offsetMs, so the file jumps where the footage was cut.
) When a move or a delete joins two clips, reanchorRows re-cut every take against the clips as they were. That put the absorbed clip's id back, and the rederive after it dropped the audio that clip carried: deleting or dragging away a word typed under a bed lost the bed after the word. Relabel only; the rederive re-cuts against the joined clips.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughAudio re-anchoring now separates detached stretches into takes and joins compatible adjacent takes. Timeline handling adjusts offsets when clamping anchored regions. Tests cover imported-audio spans and offsets across insertion, reordering, and other clip edits. ChangesImported Audio Re-anchoring
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to No confirmed issue currently blocks merging. In-app reorder and preview/export audio remain untested and should receive normal validation. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
trackId. A take that a clip edit pulled apart becomes separate takes that keep their clip, length andoffsetMs. Moving the clip back joins them again, loops included.offsetMs, so the file jumps where the footage was cut.Related issue
Closes #1011
Type of change
Release impact
Desktop impact
Testing
timeline.test.ts(the report's three-clip project with its numbers, move and move back, swap, insert, duplicate, delete and narrow under a bed, the 521d0bd offset repair) andinsertion.test.ts(typing, deleting and dragging away a word under a bed). 9 fail onmain; the other 2 guard behaviour that must not change.src/lib/ai-edition,electron/ai-edition,sceneDescriptionand the audio components: 1710 passed. Both tsc configs, Biome.🤖 Generated with Claude Code