fix(timeline): roll playhead seconds into the next minute#671
fix(timeline): roll playhead seconds into the next minute#671soufian3hm wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR fixes a rounding inconsistency in playhead time formatting. ChangesPlayhead Time Rounding
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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
formatPlayheadTimerounds the seconds component independently of the minutes/hours, so a time that rounds up to60.0does not carry into the next minute. During playback/scrubbing the editor's playhead clock then renders invalid labels.Root cause
(59.97).toFixed(1)becomes"60.0", which is appended to the already-computed minute.Observed (before)
60.0s1:00.060.0s1:00.01:60.02:00.0Fix
Round to the displayed precision (tenths of a second) first, then split into minutes/seconds so any carry rolls into the minute correctly. Existing outputs (
1234 -> 1.2s,61400 -> 1:01.4) are unchanged.Tests
Added a regression test covering the rollover boundary. Full
time.test.tssuite passes (7/7).Risk
Minimal — pure display formatting, no behavioural change outside the rounding boundary; existing assertions preserved.
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests