Skip to content

Fix critical graph bugs and coordinate system drag bounds - #11

Merged
veillette merged 6 commits into
mainfrom
claude/address-code-review-MPO9t
Feb 20, 2026
Merged

veillette merged 6 commits into
mainfrom
claude/address-code-review-MPO9t

Conversation

@veillette

Copy link
Copy Markdown
Collaborator
  • ConfigurableGraph: add Number.isFinite() guard so NaN values from
    null kinematics don't corrupt graph rendering and axis ranges
  • GraphInteractionHandler: negate Y-axis touch-pan delta so dragging
    down pans values downward (matching X-axis behaviour)
  • GraphInteractionHandler: pass setManualFlag=true in zoomIn/zoomOut
    so explicit zoom isn't overridden by auto-rescaling on new data
  • CoordinateSystemNode: clamp coordOriginProperty to video bounds so
    the coordinate system cannot be dragged completely off-screen
  • SimModel: export VIDEO_CENTER_X / VIDEO_CENTER_Y for use in view

https://claude.ai/code/session_01DtpSnHGs128wFfuLfRPN7d

- ConfigurableGraph: add Number.isFinite() guard so NaN values from
  null kinematics don't corrupt graph rendering and axis ranges
- GraphInteractionHandler: negate Y-axis touch-pan delta so dragging
  down pans values downward (matching X-axis behaviour)
- GraphInteractionHandler: pass setManualFlag=true in zoomIn/zoomOut
  so explicit zoom isn't overridden by auto-rescaling on new data
- CoordinateSystemNode: clamp coordOriginProperty to video bounds so
  the coordinate system cannot be dragged completely off-screen
- SimModel: export VIDEO_CENTER_X / VIDEO_CENTER_Y for use in view

https://claude.ai/code/session_01DtpSnHGs128wFfuLfRPN7d
- CalibrationToolNode: show red endpoint highlight and warning text when
  calibration endpoints are within 10 px of each other, giving clear
  visual feedback instead of silently falling back to identity transform
- AutoTrackerNode: add initVersion counter so if a new drag starts while
  the previous initFromVideo is still awaiting WASM load, the stale result
  is discarded rather than overwriting the newer selection

https://claude.ai/code/session_01DtpSnHGs128wFfuLfRPN7d
The comprehensive implementation (KeyboardShorcutsNode.ts, 72 lines) was
dead code due to a filename typo — main.ts imported the 22-line stub that
only showed generic SceneryStack shortcuts. Delete the stub and rename the
comprehensive version (simulation controls + graph interactions) to the
correct filename so it is actually used.

https://claude.ai/code/session_01DtpSnHGs128wFfuLfRPN7d
- SimModel: replace localeCompare() with charCodeAt() for deterministic
  ASCII ordering of single-letter track symbols (A–Z)
- DataTableNode: align CSV and on-screen display to 4 decimal places so
  exported data matches what users see in the table
- DataTableNode: remove document.body.appendChild/removeChild around the
  CSV download link — modern browsers don't require DOM insertion
- AutoTrackerNode: compute frame index via time × frameRate instead of
  time / frameDuration to reduce floating-point error at 29.97 fps
- TrackLabColors: expand TRACK_COLORS from 8 to 26 distinct colours so
  every track A–Z has a unique hue without wrapping

https://claude.ai/code/session_01DtpSnHGs128wFfuLfRPN7d
Security:
- OpenCVTracker: extract captureFrame() helper that wraps getImageData() in
  a try/catch, converting SecurityError from cross-origin videos into a
  descriptive Error (initFromVideo) or a silent null return (track())

Performance:
- GraphDataManager: pool trail Circle nodes and update their properties
  instead of destroying and recreating nodes on every updateTrail() call
  (called on pan, zoom, resize, and every new data point)
- DigitizingOverlayNode: cache rendered video bounds (aspect ratio) and
  only recompute on loadedmetadata; invalidate the cache listener is
  removed in dispose() to avoid leaks
- DigitizingOverlayNode: use time × frameRate for frame index calculation
  (same fix as AutoTrackerNode) to reduce floating-point error at 29.97 fps

https://claude.ai/code/session_01DtpSnHGs128wFfuLfRPN7d
- CoordinateSystemNode: replace non-existent Vector2.withXY() with copy().setXY()
- OpenCVTracker: work around ES2020 Error constructor not accepting {cause}
- GraphDataManager: replace indexed loop + non-null assertion with for...of entries()
- DataTableNode: replace Map.get()! after has() with explicit undefined check

https://claude.ai/code/session_01DtpSnHGs128wFfuLfRPN7d
@veillette
veillette merged commit ede7e13 into main Feb 20, 2026
@veillette
veillette deleted the claude/address-code-review-MPO9t branch February 20, 2026 16:45
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