-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: split action respects segment timescale (speed) #1446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: split action respects segment timescale (speed) #1446
Conversation
WalkthroughTwo files modified to account for segment timescale in clip-splitting logic. The splitTime calculation in ClipTrack now divides by timescale. In context.ts, duration calculations and segment boundaries are adjusted using timescale normalization through a new splitPositionInRecording variable. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related issues
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (6)**/*.tsx📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx,js,jsx,rs}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.ts📄 CodeRabbit inference engine (CLAUDE.md)
Files:
apps/desktop/**/*.ts📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧬 Code graph analysis (1)apps/desktop/src/routes/editor/context.ts (3)
🔇 Additional comments (2)
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 |
|
Amazing! |
Fix: Split action respects segment timescale (speed)
Problem
#1445 When using the split tool (scissors) on the timeline, if a previous segment had a modified playback speed (timescale), the split would occur at the wrong position instead of where the user clicked.
Root Cause
The code was mixing two different time representations:
(end - start) / timescaleend - startThe
splitClipSegmentfunction searched for the target segment using recording time durations instead of timeline time, causing incorrect segment detection when earlier segments had modified speeds.Example
Consider this timeline:
When clicking to split at 25% into Segment 1 (which is at 75s into the timeline):
Changes
apps/desktop/src/routes/editor/context.tstimescalewhen calculating segment duration during searchapps/desktop/src/routes/editor/Timeline/ClipTrack.tsxsplitTimein timeline time (divide bytimescale) to be consistent withprevDuration()Testing
Summary by CodeRabbit
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.