Claude/refactor mvc violations r887u - #74
Merged
Merged
Conversation
… models 1.1 Frame-number computation: add VideoPlaybackModel.timeToFrame(), currentFrameProperty, and seekByFrames(). All views now delegate to the model instead of inlining Math.round(time * frameRate) / division-by- frameDuration formulas. DigitizingOverlayNode reads currentFrameProperty; PlaybackControlsNode calls playback.timeToFrame(); AutoTrackerNode receives a timeToFrame callback through its options. 1.2 Frame-seeking logic: move seekByFrames() body from VideoPlayerNode into VideoPlaybackModel.seekByFrames(direction). The view now calls playback.seekByFrames() and syncs videoElement.currentTime to the updated model property. 1.3 Async tracker staleness: move initVersion counter from AutoTrackerNode into TrackingModel. resetTracker() increments the counter; initTracker() returns Promise<boolean> (true = ready, false = superseded). The view no longer needs a private initVersion field or captured-version checks. 1.4 Duplicate-frame deduplication: move the recordedFrames Set out of AutoTrackerNode into TrackingModel.addPointToTrack(), which now skips (rather than overwrites) an existing point for the same frame. The view calls addPointToTrack unconditionally and lets the model enforce the policy. 1.5 Video metadata extraction: add extractVideoFileMetadata() to webcam.ts (alongside the existing countWebmFrames / getAnimatedWebPInfo helpers). VideoSourceControlNode replaces its three-branch file-upload handler (WebP detection, WebM frame counting, generic duration probe) with a single await. https://claude.ai/code/session_01ExhrdqGJEXwHoYSzvQBQML
Replace info!.frameCount with info?.frameCount in extractVideoFileMetadata to satisfy Biome's noNonNullAssertion rule. https://claude.ai/code/session_01ExhrdqGJEXwHoYSzvQBQML
Use conditional spread (...(count > 0 ? { frameCount: count } : {})) instead
of assigning number | undefined to an optional number property, which is
rejected by TypeScript's exactOptionalPropertyTypes compiler option.
https://claude.ai/code/session_01ExhrdqGJEXwHoYSzvQBQML
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.
No description provided.