Refactor overlay tool nodes and improve data table panning - #63
Merged
Conversation
- SimModel: remove prevModelViewTransform private field; lazyLink already provides the previous value as its second argument, so the manual cache was redundant and mutation-prone. - DigitizingAwareOverlayNode: extract the shared "hide until video loaded + dim/lock during digitizing" pattern into an abstract base class. CoordinateSystemNode and CalibrationToolNode both extend it, removing ~25 lines of identical listener/dispose boilerplate from each. - isWebcamVideoProperty → isUserVideoProperty: the old name was misleading because the flag is also true for uploaded files (not just webcam streams). The new name accurately reflects "user-provided vs bundled sample". - DataTableNode: move the pan-drag listener inside the node itself. SimScreenView is a layout file and should not own interaction logic that belongs to the node being dragged. https://claude.ai/code/session_016hiUhJvruvQ8463TWCPYdf
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
This PR refactors shared behavior in overlay tool nodes into a reusable base class, moves data table panning logic into the DataTableNode itself, and makes several naming and implementation improvements across the codebase.
Key Changes
New
DigitizingAwareOverlayNodebase class: Extracted common visibility and interaction-locking behavior fromCoordinateSystemNodeandCalibrationToolNodeinto an abstract base class. Both nodes now:videoLoadedProperty)activeTrackIdProperty)Data table panning refactored: Moved drag listener logic from
SimScreenViewintoDataTableNodewhere it logically belongs, improving encapsulation and maintainabilityProperty naming improvement: Renamed
isWebcamVideoPropertytoisUserVideoPropertyinVideoSourceModelfor clarity—the property indicates whether the active video is user-provided (webcam or upload) vs. bundled sample videoModel-view transform handling: Simplified
SimModelto use thelazyLinkcallback'soldMvtparameter instead of manually caching the previous transformMinor type adjustments: Changed
Nodeimport totype NodeinCalibrationToolNodeand removed unusedTransform3import fromSimModelImplementation Details
The
DigitizingAwareOverlayNodeabstract base class handles property linking and cleanup in its constructor anddispose()method, allowing subclasses to focus on their specific UI logic. BothCoordinateSystemNodeandCalibrationToolNodenow callsuper(videoLoadedProperty, activeTrackIdProperty)to inherit this behavior automatically.https://claude.ai/code/session_016hiUhJvruvQ8463TWCPYdf