Skip to content

refactor: narrow constructor arguments to specific sub-models instead of SimModel - #62

Merged
veillette merged 2 commits into
mainfrom
claude/refactor-class-arguments-Bc2BI
Feb 27, 2026
Merged

refactor: narrow constructor arguments to specific sub-models instead of SimModel#62
veillette merged 2 commits into
mainfrom
claude/refactor-class-arguments-Bc2BI

Conversation

@veillette

Copy link
Copy Markdown
Collaborator

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

… 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
@veillette
veillette merged commit e49e4ea into main Feb 27, 2026
1 check passed
@veillette
veillette deleted the claude/refactor-class-arguments-Bc2BI branch March 1, 2026 01:13
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.

2 participants