fix(zoom): auto-placed zoom regions follow the cursor for their whole span - #118
Merged
Merged
Conversation
… span Auto zoom regions (created by the magic-wand cursor-dwell suggestion pass) were built with focusMode left undefined unless the separate, global "Auto Focus All" toggle was on. That meant the pan/zoom used the static dwell-centroid focus captured at suggestion time and never tracked the cursor afterward, even though the cursor-follow interpolation logic (zoomRegionUtils/cursorFollowUtils) already existed and just wasn't wired up by default for these regions. Auto-suggested regions now always get focusMode "auto" so they pan to track the cursor telemetry across their whole span, independent of the "Auto Focus All" toggle (which still only controls the default for manually-drawn zoom regions). Fixes #72 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAuto-generated zoom regions now always use automatic cursor-following focus, independent of the global ChangesAuto zoom focus behavior
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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 |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
source: "auto") were built withfocusModeleftundefinedunless the separate, global "Auto Focus All" toggle was on.focusModenot"auto", the zoom/pan render used the static dwell-centroidfocuspoint captured when the region was suggested and never tracked the cursor for the rest of the region — matching the reported symptom of the zoom "jumping to the cursor's position at the start and then staying fixed."zoomRegionUtils.ts/cursorFollowUtils.ts) already existed and worked correctly whenfocusMode: "auto"— it just wasn't being applied by default to auto-suggested regions.buildAutoZoomRegionsinsrc/components/video-editor/VideoEditor.tsxnow always setsfocusMode: "auto"for regions withsource: "auto", independent of the "Auto Focus All" toggle (which still only controls the default for manually-drawn zoom regions — unchanged).Root cause
src/components/video-editor/VideoEditor.tsx—buildAutoZoomRegions()setfocusMode: autoFocusAll ? "auto" : undefinedfor every auto-suggested region. SinceautoFocusAlldefaults tofalse, freshly auto-placed zoom regions gotfocusMode: undefined, whichgetResolvedFocus()insrc/components/video-editor/videoPlayback/zoomRegionUtils.tstreats as "manual" (staticfocuspoint), so the pan never sampled cursor telemetry across the region's time range.Test plan
src/components/video-editor/videoPlayback/zoomRegionUtils.test.ts: regression test asserting an auto-zoom region's resolved focus tracks moving cursor telemetry across its span, and that a manual-focus-mode region stays pinned to its static focus (manual regions unaffected).npx tsc --noEmit— no new errors (2 pre-existing unrelated errors for optional@xenova/transformers/onnxruntime-webdeps).npm run lint(biome check on changed files) — clean.npm run test— all 52 test files / 409 tests pass.Fixes #72
Summary by CodeRabbit
Bug Fixes
Tests