refactor: narrow constructor arguments to specific sub-models instead of SimModel - #62
Merged
Merged
Conversation
… of SimModel Replace broad `model: SimModel` parameters with the minimal sub-model or property each class actually needs: - ControlPanel, MeasurementToolsPanel → overlayTools: OverlayToolsModel - PlaybackControlsNode → playback: VideoPlaybackModel - TrackListPanel, TrackRowNode, DataTableNode → tracking: TrackingModel - CalibrationToolNode, CoordinateSystemNode → overlayTools + activeTrackIdProperty - KinematicsGraphNode → tracking + overlayTools + videoLoadedProperty - WebcamPanel options → frameRateProperty replaces model: SimModel - buildKinematicsPlottableGroups → overlayTools: OverlayToolsModel Call sites in SimScreenView, VideoPlayerNode, and VideoSourceControlNode updated to pass the relevant sub-model or property rather than the whole model. https://claude.ai/code/session_01NwMcFY46cgSh2ZcSPTp8Hb
AutoTrackerNode: replace `model: SimModel` with an `AutoTrackerNodeOptions` object containing only the specific dependencies it uses — `tracking`, `videoDimensionsProperty`, `frameRateProperty`, and `modelViewTransformProperty`. `pixelToModelCoords` is now computed inline via the transform. DigitizingOverlayNode: replace `model: SimModel` with a `DigitizingOverlayNodeOptions` object — `tracking`, `playback`, `magnifyVideoProperty`, and `modelViewTransformProperty`. VideoPlayerNode: the stored field is narrowed from `SimModel` to `VideoPlaybackModel`; private methods (`rewindToStart`, `seekByFrames`) now use `this.playback` directly. Child construction calls are updated to pass the narrowed options objects to AutoTrackerNode and DigitizingOverlayNode. VideoSourceControlNode: replace `model: SimModel` with three focused arguments — `sources: VideoSourceModel`, `isPlayingProperty: TProperty<boolean>`, and `activation: VideoSourceActivation` (a structural interface for the three atomic activation methods). `frameRateProperty` is passed explicitly. https://claude.ai/code/session_01NwMcFY46cgSh2ZcSPTp8Hb
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.
Replace broad
model: SimModelparameters with the minimal sub-model orproperty each class actually needs:
Call sites in SimScreenView, VideoPlayerNode, and VideoSourceControlNode
updated to pass the relevant sub-model or property rather than the whole model.
https://claude.ai/code/session_01NwMcFY46cgSh2ZcSPTp8Hb