Skip to content

fix motion blur regressions#499

Merged
webadderall merged 1 commit into
mainfrom
fix-motion-blur-regressions
May 11, 2026
Merged

fix motion blur regressions#499
webadderall merged 1 commit into
mainfrom
fix-motion-blur-regressions

Conversation

@webadderall
Copy link
Copy Markdown
Collaborator

@webadderall webadderall commented May 11, 2026

Summary

  • bake in stronger split motion blur defaults and expand dev tuning range
  • stop persisting split blur dev tuning through project files and editor preferences
  • switch the default cursor style to macOS and align playback fallback/tests

Testing

  • npm test -- src/components/video-editor/editorPreferences.test.ts src/components/video-editor/audio.test.ts

Summary by CodeRabbit

  • New Features

    • Motion blur control sliders now support extended adjustment ranges for finer creative control
  • Improvements

    • Updated default cursor style to macOS
    • Enhanced motion blur tuning parameters and expanded validation ranges for greater flexibility
  • Tests

    • Added comprehensive test coverage for motion blur settings persistence and data integrity

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Walkthrough

Motion 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.

Changes

Motion Blur Defaults & Persistence Cleanup

Layer / File(s) Summary
Type & Constant Definitions
src/components/video-editor/types.ts
DEFAULT_CURSOR_STYLE changes from "tahoe" to "macos"; DEFAULT_ZOOM_MOTION_BLUR_TUNING updates zoomVelocityThreshold, maxDirectionalBlurPx, and maxRadialBlurStrength to new values.
Persistence Utility & Normalization Bounds
src/components/video-editor/projectPersistence.ts
Exports stripPersistedDevMotionBlurSettings helper function and PersistedDevMotionBlurSettings type to remove dev-only motion blur fields from editor objects; updates clamping ranges for maxDirectionalBlurPx (now 96) and maxRadialBlurStrength (now 1.5).
Editor Preference Sanitization
src/components/video-editor/editorPreferences.ts
Applies stripPersistedDevMotionBlurSettings in normalizeEditorControls and saveEditorPreferences to prevent dev motion blur overrides from persisting to localStorage.
Project Save/Load State Stripping
src/components/video-editor/VideoEditor.tsx
Applies stripPersistedDevMotionBlurSettings in buildPersistedEditorState when saving and in applyLoadedProject before normalization to remove dev settings from persisted/loaded project state.
UI Component Adjustments
src/components/video-editor/VideoPlayback.tsx, src/components/video-editor/SettingsPanel.tsx
VideoPlayback uses DEFAULT_CURSOR_STYLE constant; SettingsPanel dev debug sliders raise maximum bounds to 96 (pan) and 1.5 (zoom strength).
Test Coverage & Validation
src/components/video-editor/audio.test.ts, src/components/video-editor/editorPreferences.test.ts
New tests verify dev motion blur settings are stripped, cursor and tuning defaults match expectations, legacy overrides are ignored during load, and stripping occurs during save; existing test adjusted to partial matching.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • webadderallorg/Recordly#436: Both PRs refine zoom motion blur tuning surface by updating projectPersistence normalization and SettingsPanel slider maxima.
  • webadderallorg/Recordly#415: Both modify motion-blur and cursor configuration/persistence codepaths in types, projectPersistence, and editorPreferences.
  • webadderallorg/Recordly#369: Both modify VideoEditor.tsx's project save/load persistence logic.

Suggested labels

Checked, Slop

Poem

🐰 Blur settings get stripped and refined with care,
Defaults now dance in macos air,
Motion blur bounds stretch wide and strong,
Persistence cleanup rights a wrong,
Tests confirm the path is clear,
Nine-four-hundred pixels without fear! 🎬

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly addresses the main changes: fixing motion blur regressions by adjusting defaults, expanding tuning ranges, and preventing persistence of dev settings.
Description check ✅ Passed The description covers key objectives (motion blur defaults, tuning ranges, persistence changes, cursor style) and includes testing instructions, though it lacks detailed motivation and screenshots.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-motion-blur-regressions

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between dbc4962 and 3d9043f.

📒 Files selected for processing (8)
  • src/components/video-editor/SettingsPanel.tsx
  • src/components/video-editor/VideoEditor.tsx
  • src/components/video-editor/VideoPlayback.tsx
  • src/components/video-editor/audio.test.ts
  • src/components/video-editor/editorPreferences.test.ts
  • src/components/video-editor/editorPreferences.ts
  • src/components/video-editor/projectPersistence.ts
  • src/components/video-editor/types.ts

Comment on lines +271 to +338
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,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 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.ts

Repository: 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 -n

Repository: 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).

@webadderall webadderall merged commit 4c0dfd8 into main May 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant