Skip to content

chore(cleanup): move pure-math out of components/video-editor/videoPlayback/ into lib/zoomMath - #197

Merged
EtienneLescot merged 1 commit into
release/v1.8.0from
ponytail/move-zoom-math-to-lib
Jul 29, 2026
Merged

chore(cleanup): move pure-math out of components/video-editor/videoPlayback/ into lib/zoomMath#197
EtienneLescot merged 1 commit into
release/v1.8.0from
ponytail/move-zoom-math-to-lib

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

What

Pure-rename cleanup. The folder src/components/video-editor/videoPlayback/ was a misnomer — it contained 11 files of pure zoom/spring/focus math (zero React), but the components/ location kept implying they were React components. They aren't. Move them into a clearer home: src/lib/zoomMath/.

Why

The directory has been importing across the codebase as if it were React, and types in components/ are being pulled into pure-math modules across the lib/ boundary. src/lib/zoomMath/ puts the math next to its peers (compositeLayout, cursor, exporter) and out of the components tree, where the contents actually belong.

Files moved (9 source + 2 co-located unit tests)

cameraFullscreenUtils.ts
cameraFullscreenUtils.test.ts
constants.ts
cursorFollowUtils.ts
focusUtils.ts
focusUtils.test.ts (does not exist — listed for completeness)
mathUtils.ts
motionSmoothing.ts
zoomRegionUtils.ts
zoomSpring.ts
zoomSpring.test.ts
zoomTransform.ts

git mv was used throughout — every change is a true rename, history is preserved.

Import sites updated (8 files, ~15 import specifiers)

src/native/sceneDescription.test.ts
src/lib/exporter/wgsl/evaluate.ts
src/lib/exporter/frameRenderer.ts
src/lib/cursor/pixiCursorRenderer.ts
src/lib/cursor/cursorPathSmoothing.ts
src/lib/ai-edition/timeline/zoom-preview.ts
src/components/ai-edition/ZoomFocusOverlay.tsx
src/components/ai-edition/PreviewCanvas.tsx

Plus 5 internal ../types -> @/components/video-editor/types fixes inside the moved files (cameraFullscreenUtils, constants, cursorFollowUtils, focusUtils, zoomRegionUtils) and the one inside the moved cameraFullscreenUtils.test.ts.

src/components/video-editor/types.ts was intentionally left in place — it is still a real (if misnamed) shared types module used by src/lib/ai-edition/. The directory src/components/video-editor/ itself stays; only the misnamed videoPlayback/ subfolder moved. types.ts is on the todo list for a future cleanup once the ai-edition rename is done.

The old src/components/video-editor/videoPlayback/ directory is removed; it was empty after the move.

Doc comments

Two prose references to the moved files were updated to the new paths:

  • technical-documentation/architecture/cursor.md (cursorFollowUtils.ts reference)
  • crates/compositor/src/cursor.rs (constants.ts reference)

Stale comments referencing files outside this move (VideoPlayback.tsx, videoPlayback/overlayUtils.ts, videoPlayback/videoEventHandlers.ts) were left alone — out of scope.

Classification

  • Type: Refactor / maintenance
  • Severity: Minor
  • Platform specificity: Not platform-specific
  • Risk: Low — pure rename, no behavior change

Testing

  • npx tsc --noEmit — clean
  • npm run test1144/1144 passing (baseline 1144/1144)
  • npm run lint0 new warnings vs baseline (baseline has 7 pre-existing warnings in NewProjectModal.test.tsx, rafCoalesce.test.ts, and useNativeCompositorView.ts — none in files touched here)

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eb2d0119-bae4-4a25-af02-8c899d7f6ad5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ponytail/move-zoom-math-to-lib

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.

…ayback/ into lib/zoomMath

Pure rename: the misnomer directory src/components/video-editor/videoPlayback/ contained 11 files of pure zoom/spring/focus math (zero React). Moved into a clearer home: src/lib/zoomMath/.

Files moved (9 source + 2 co-located unit tests):
  cameraFullscreenUtils.ts
  cameraFullscreenUtils.test.ts
  constants.ts
  cursorFollowUtils.ts
  focusUtils.ts
  mathUtils.ts
  motionSmoothing.ts
  zoomRegionUtils.ts
  zoomRegionUtils.test.ts (does not exist; the 2 tests are co-located above)
  zoomSpring.ts
  zoomSpring.test.ts
  zoomTransform.ts

Import sites updated (8 files, ~15 import specifiers):
  src/native/sceneDescription.test.ts
  src/lib/exporter/wgsl/evaluate.ts
  src/lib/exporter/frameRenderer.ts
  src/lib/cursor/pixiCursorRenderer.ts
  src/lib/cursor/cursorPathSmoothing.ts
  src/lib/ai-edition/timeline/zoom-preview.ts
  src/components/ai-edition/ZoomFocusOverlay.tsx
  src/components/ai-edition/PreviewCanvas.tsx

Internal relative imports of ../types rewritten to @/components/video-editor/types (5 sites: cameraFullscreenUtils, constants, cursorFollowUtils, focusUtils, zoomRegionUtils; plus the moved test). types.ts itself stays in components/video-editor/ — it is still a real shared types module used by src/lib/ai-edition/, and the parent directory src/components/video-editor/ stays in place; only the misnamed videoPlayback/ subfolder moved.

Doc references to the moved files (technical-documentation/architecture/cursor.md, crates/compositor/src/cursor.rs) updated to the new paths. Stale comments referencing files outside this move (VideoPlayback.tsx, videoPlayback/overlayUtils.ts, videoPlayback/videoEventHandlers.ts) are left alone — out of scope.

No behavior change. Verified with: tsc --noEmit (clean), vitest --run (1144/1144 passing), biome check (0 new warnings vs baseline).
@EtienneLescot
EtienneLescot force-pushed the ponytail/move-zoom-math-to-lib branch from 9125f7f to c9b6629 Compare July 29, 2026 07:31
@EtienneLescot
EtienneLescot merged commit 9769287 into release/v1.8.0 Jul 29, 2026
9 checks passed
@EtienneLescot
EtienneLescot deleted the ponytail/move-zoom-math-to-lib branch July 29, 2026 08:25
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