fix motion blur regressions#499
Conversation
📝 WalkthroughWalkthroughMotion blur tuning defaults and constraints are updated across types, defaults are increased, dev-only settings are stripped from persistence, cursor style defaults change, debug slider maximums rise, and comprehensive test coverage validates the full flow. ChangesMotion Blur Defaults & Persistence Cleanup
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/video-editor/editorPreferences.ts`:
- Around line 271-338: The candidate mapping in editorPreferences.ts is missing
three persisted zoom motion blur scalars, so when sanitize
(stripPersistedDevMotionBlurSettings) returns them they are dropped and
normalizeProjectEditor receives undefined; add zoomTemporalMotionBlur,
zoomMotionBlurSampleCount, and zoomMotionBlurShutterFraction to the candidate
object using the same pattern (sanitizedRaw.<field> ?? fallback.<field>) so
persisted values are preserved (refer to candidate,
stripPersistedDevMotionBlurSettings, and normalizeProjectEditor to locate the
logic).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0655e957-d7ae-4cea-b7fd-199cab730942
📒 Files selected for processing (8)
src/components/video-editor/SettingsPanel.tsxsrc/components/video-editor/VideoEditor.tsxsrc/components/video-editor/VideoPlayback.tsxsrc/components/video-editor/audio.test.tssrc/components/video-editor/editorPreferences.test.tssrc/components/video-editor/editorPreferences.tssrc/components/video-editor/projectPersistence.tssrc/components/video-editor/types.ts
| const sanitizedRaw = stripPersistedDevMotionBlurSettings(raw); | ||
| const candidate: PartialEditorControls = { | ||
| wallpaper: raw.wallpaper ?? fallback.wallpaper, | ||
| shadowIntensity: raw.shadowIntensity ?? fallback.shadowIntensity, | ||
| backgroundBlur: raw.backgroundBlur ?? fallback.backgroundBlur, | ||
| zoomMotionBlur: raw.zoomMotionBlur ?? fallback.zoomMotionBlur, | ||
| zoomMotionBlurTuning: raw.zoomMotionBlurTuning ?? fallback.zoomMotionBlurTuning, | ||
| zoomTemporalMotionBlur: raw.zoomTemporalMotionBlur ?? fallback.zoomTemporalMotionBlur, | ||
| zoomMotionBlurSampleCount: | ||
| raw.zoomMotionBlurSampleCount ?? fallback.zoomMotionBlurSampleCount, | ||
| zoomMotionBlurShutterFraction: | ||
| raw.zoomMotionBlurShutterFraction ?? fallback.zoomMotionBlurShutterFraction, | ||
| connectZooms: raw.connectZooms ?? fallback.connectZooms, | ||
| zoomInDurationMs: raw.zoomInDurationMs ?? fallback.zoomInDurationMs, | ||
| zoomInOverlapMs: raw.zoomInOverlapMs ?? fallback.zoomInOverlapMs, | ||
| zoomOutDurationMs: raw.zoomOutDurationMs ?? fallback.zoomOutDurationMs, | ||
| connectedZoomGapMs: raw.connectedZoomGapMs ?? fallback.connectedZoomGapMs, | ||
| connectedZoomDurationMs: raw.connectedZoomDurationMs ?? fallback.connectedZoomDurationMs, | ||
| zoomInEasing: raw.zoomInEasing ?? fallback.zoomInEasing, | ||
| zoomOutEasing: raw.zoomOutEasing ?? fallback.zoomOutEasing, | ||
| connectedZoomEasing: raw.connectedZoomEasing ?? fallback.connectedZoomEasing, | ||
| showCursor: raw.showCursor ?? fallback.showCursor, | ||
| loopCursor: raw.loopCursor ?? fallback.loopCursor, | ||
| cursorStyle: raw.cursorStyle ?? fallback.cursorStyle, | ||
| cursorSize: raw.cursorSize ?? fallback.cursorSize, | ||
| cursorSmoothing: raw.cursorSmoothing ?? fallback.cursorSmoothing, | ||
| wallpaper: sanitizedRaw.wallpaper ?? fallback.wallpaper, | ||
| shadowIntensity: sanitizedRaw.shadowIntensity ?? fallback.shadowIntensity, | ||
| backgroundBlur: sanitizedRaw.backgroundBlur ?? fallback.backgroundBlur, | ||
| zoomMotionBlur: sanitizedRaw.zoomMotionBlur ?? fallback.zoomMotionBlur, | ||
| connectZooms: sanitizedRaw.connectZooms ?? fallback.connectZooms, | ||
| zoomInDurationMs: sanitizedRaw.zoomInDurationMs ?? fallback.zoomInDurationMs, | ||
| zoomInOverlapMs: sanitizedRaw.zoomInOverlapMs ?? fallback.zoomInOverlapMs, | ||
| zoomOutDurationMs: sanitizedRaw.zoomOutDurationMs ?? fallback.zoomOutDurationMs, | ||
| connectedZoomGapMs: | ||
| sanitizedRaw.connectedZoomGapMs ?? fallback.connectedZoomGapMs, | ||
| connectedZoomDurationMs: | ||
| sanitizedRaw.connectedZoomDurationMs ?? fallback.connectedZoomDurationMs, | ||
| zoomInEasing: sanitizedRaw.zoomInEasing ?? fallback.zoomInEasing, | ||
| zoomOutEasing: sanitizedRaw.zoomOutEasing ?? fallback.zoomOutEasing, | ||
| connectedZoomEasing: | ||
| sanitizedRaw.connectedZoomEasing ?? fallback.connectedZoomEasing, | ||
| showCursor: sanitizedRaw.showCursor ?? fallback.showCursor, | ||
| loopCursor: sanitizedRaw.loopCursor ?? fallback.loopCursor, | ||
| cursorStyle: sanitizedRaw.cursorStyle ?? fallback.cursorStyle, | ||
| cursorSize: sanitizedRaw.cursorSize ?? fallback.cursorSize, | ||
| cursorSmoothing: sanitizedRaw.cursorSmoothing ?? fallback.cursorSmoothing, | ||
| cursorSpringStiffnessMultiplier: | ||
| raw.cursorSpringStiffnessMultiplier ?? fallback.cursorSpringStiffnessMultiplier, | ||
| sanitizedRaw.cursorSpringStiffnessMultiplier ?? | ||
| fallback.cursorSpringStiffnessMultiplier, | ||
| cursorSpringDampingMultiplier: | ||
| raw.cursorSpringDampingMultiplier ?? fallback.cursorSpringDampingMultiplier, | ||
| sanitizedRaw.cursorSpringDampingMultiplier ?? | ||
| fallback.cursorSpringDampingMultiplier, | ||
| cursorSpringMassMultiplier: | ||
| raw.cursorSpringMassMultiplier ?? fallback.cursorSpringMassMultiplier, | ||
| sanitizedRaw.cursorSpringMassMultiplier ?? fallback.cursorSpringMassMultiplier, | ||
| cameraSpringStiffnessMultiplier: | ||
| raw.cameraSpringStiffnessMultiplier ?? fallback.cameraSpringStiffnessMultiplier, | ||
| sanitizedRaw.cameraSpringStiffnessMultiplier ?? | ||
| fallback.cameraSpringStiffnessMultiplier, | ||
| cameraSpringDampingMultiplier: | ||
| raw.cameraSpringDampingMultiplier ?? fallback.cameraSpringDampingMultiplier, | ||
| sanitizedRaw.cameraSpringDampingMultiplier ?? | ||
| fallback.cameraSpringDampingMultiplier, | ||
| cameraSpringMassMultiplier: | ||
| raw.cameraSpringMassMultiplier ?? fallback.cameraSpringMassMultiplier, | ||
| cursorMotionBlur: raw.cursorMotionBlur ?? fallback.cursorMotionBlur, | ||
| cursorClickBounce: raw.cursorClickBounce ?? fallback.cursorClickBounce, | ||
| sanitizedRaw.cameraSpringMassMultiplier ?? fallback.cameraSpringMassMultiplier, | ||
| cursorMotionBlur: sanitizedRaw.cursorMotionBlur ?? fallback.cursorMotionBlur, | ||
| cursorClickBounce: sanitizedRaw.cursorClickBounce ?? fallback.cursorClickBounce, | ||
| cursorClickBounceDuration: | ||
| raw.cursorClickBounceDuration ?? fallback.cursorClickBounceDuration, | ||
| cursorSway: raw.cursorSway ?? fallback.cursorSway, | ||
| borderRadius: raw.borderRadius ?? fallback.borderRadius, | ||
| padding: raw.padding ?? fallback.padding, | ||
| frame: raw.frame !== undefined ? raw.frame : fallback.frame, | ||
| webcam: raw.webcam ?? fallback.webcam, | ||
| aspectRatio: raw.aspectRatio ?? fallback.aspectRatio, | ||
| exportEncodingMode: raw.exportEncodingMode ?? fallback.exportEncodingMode, | ||
| sanitizedRaw.cursorClickBounceDuration ?? fallback.cursorClickBounceDuration, | ||
| cursorSway: sanitizedRaw.cursorSway ?? fallback.cursorSway, | ||
| borderRadius: sanitizedRaw.borderRadius ?? fallback.borderRadius, | ||
| padding: sanitizedRaw.padding ?? fallback.padding, | ||
| frame: sanitizedRaw.frame !== undefined ? sanitizedRaw.frame : fallback.frame, | ||
| webcam: sanitizedRaw.webcam ?? fallback.webcam, | ||
| aspectRatio: sanitizedRaw.aspectRatio ?? fallback.aspectRatio, | ||
| exportEncodingMode: | ||
| sanitizedRaw.exportEncodingMode ?? fallback.exportEncodingMode, | ||
| exportBackendPreference: | ||
| raw.exportBackendPreference === undefined | ||
| sanitizedRaw.exportBackendPreference === undefined | ||
| ? fallback.exportBackendPreference | ||
| : normalizeExportBackendPreference(raw.exportBackendPreference), | ||
| : normalizeExportBackendPreference(sanitizedRaw.exportBackendPreference), | ||
| exportPipelineModel: | ||
| raw.exportPipelineModel === undefined | ||
| sanitizedRaw.exportPipelineModel === undefined | ||
| ? fallback.exportPipelineModel | ||
| : normalizeExportPipelineModel(raw.exportPipelineModel), | ||
| exportQuality: raw.exportQuality ?? fallback.exportQuality, | ||
| : normalizeExportPipelineModel(sanitizedRaw.exportPipelineModel), | ||
| exportQuality: sanitizedRaw.exportQuality ?? fallback.exportQuality, | ||
| mp4FrameRate: | ||
| raw.mp4FrameRate === undefined | ||
| sanitizedRaw.mp4FrameRate === undefined | ||
| ? fallback.mp4FrameRate | ||
| : normalizeExportMp4FrameRate(raw.mp4FrameRate), | ||
| exportFormat: raw.exportFormat ?? fallback.exportFormat, | ||
| gifFrameRate: raw.gifFrameRate ?? fallback.gifFrameRate, | ||
| gifLoop: raw.gifLoop ?? fallback.gifLoop, | ||
| gifSizePreset: raw.gifSizePreset ?? fallback.gifSizePreset, | ||
| : normalizeExportMp4FrameRate(sanitizedRaw.mp4FrameRate), | ||
| exportFormat: sanitizedRaw.exportFormat ?? fallback.exportFormat, | ||
| gifFrameRate: sanitizedRaw.gifFrameRate ?? fallback.gifFrameRate, | ||
| gifLoop: sanitizedRaw.gifLoop ?? fallback.gifLoop, | ||
| gifSizePreset: sanitizedRaw.gifSizePreset ?? fallback.gifSizePreset, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
helper_file="$(fd -p 'projectPersistence.ts$' | head -n1)"
if [[ -z "${helper_file:-}" ]]; then
echo "projectPersistence.ts not found" >&2
exit 1
fi
echo "== stripPersistedDevMotionBlurSettings definition and related fields =="
rg -n -C5 'stripPersistedDevMotionBlurSettings|zoomMotionBlurTuning|zoomTemporalMotionBlur|zoomMotionBlurSampleCount|zoomMotionBlurShutterFraction' "$helper_file"
echo
echo "== editorPreferences mapping =="
rg -n -C3 'zoomMotionBlurTuning|zoomTemporalMotionBlur|zoomMotionBlurSampleCount|zoomMotionBlurShutterFraction' src/components/video-editor/editorPreferences.ts
echo
echo "== existing regression coverage =="
rg -n -C3 'zoomMotionBlurTuning|zoomTemporalMotionBlur|zoomMotionBlurSampleCount|zoomMotionBlurShutterFraction' src/components/video-editor/editorPreferences.test.ts src/components/video-editor/audio.test.tsRepository: webadderallorg/Recordly
Length of output: 10635
🏁 Script executed:
# Show the complete normalizeEditorControls function including the return statement
sed -n '260,400p' src/components/video-editor/editorPreferences.ts | cat -nRepository: webadderallorg/Recordly
Length of output: 7844
Critical persistence regression: Three motion blur settings will reset to defaults on every load.
The candidate object (lines 271-338) omits zoomTemporalMotionBlur, zoomMotionBlurSampleCount, and zoomMotionBlurShutterFraction entirely. While stripPersistedDevMotionBlurSettings correctly removes only zoomMotionBlurTuning, these three scalar fields remain in sanitizedRaw. However, since they are not assigned to the candidate object, they are passed to normalizeProjectEditor as undefined, causing the normalization logic to apply defaults instead of preserving persisted values.
Users who previously saved these settings will lose them on the next load. These fields must be added to the candidate mapping:
zoomTemporalMotionBlur: sanitizedRaw.zoomTemporalMotionBlur ?? fallback.zoomTemporalMotionBlur,
zoomMotionBlurSampleCount: sanitizedRaw.zoomMotionBlurSampleCount ?? fallback.zoomMotionBlurSampleCount,
zoomMotionBlurShutterFraction: sanitizedRaw.zoomMotionBlurShutterFraction ?? fallback.zoomMotionBlurShutterFraction,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/components/video-editor/editorPreferences.ts` around lines 271 - 338, The
candidate mapping in editorPreferences.ts is missing three persisted zoom motion
blur scalars, so when sanitize (stripPersistedDevMotionBlurSettings) returns
them they are dropped and normalizeProjectEditor receives undefined; add
zoomTemporalMotionBlur, zoomMotionBlurSampleCount, and
zoomMotionBlurShutterFraction to the candidate object using the same pattern
(sanitizedRaw.<field> ?? fallback.<field>) so persisted values are preserved
(refer to candidate, stripPersistedDevMotionBlurSettings, and
normalizeProjectEditor to locate the logic).
Summary
Testing
Summary by CodeRabbit
New Features
Improvements
Tests