Skip to content

Add manual particle tracking with labeled tracks panel - #5

Merged
veillette merged 1 commit into
mainfrom
claude/add-particle-tracking-kpM9l
Feb 18, 2026
Merged

Add manual particle tracking with labeled tracks panel#5
veillette merged 1 commit into
mainfrom
claude/add-particle-tracking-kpM9l

Conversation

@veillette

Copy link
Copy Markdown
Collaborator

Summary

This PR implements a manual particle tracking feature that allows users to create labeled tracks (A, B, C, etc.) and record data points by clicking on particles in video frames. A new right-side panel displays active tracks with color-coded badges and provides controls to add/remove tracks.

Key Changes

  • New Track data model (Track.ts): Defines Track and TrackPoint types to store particle tracking data with frame numbers, timestamps, and color-coded symbols.

  • Track management in SimModel: Added track lifecycle methods:

    • addTrack(): Creates new labeled tracks (A–Z) with assigned colors from a palette
    • removeTrack(): Deletes tracks by ID
    • addPointToTrack(): Records frame/time data points for a track
    • canAddTrack(): Checks if more tracks can be added (max 26)
    • tracksProperty: Observable property that notifies UI of track changes
  • TrackListPanel UI component: New right-side panel featuring:

    • Header and "+ Add Track" button (disabled until video loads)
    • Dynamic track rows with color badges, letter symbols, and trash buttons
    • Click-to-tag workflow: clicking a track row records current frame and advances video by one frame
    • Responsive visibility tied to video load state
  • VideoPlayerNode enhancement: Added public stepForward() method to advance playback by exactly one frame (1/30 s) for manual digitizing workflow.

  • Integration in SimScreenView: Positioned TrackListPanel to the right of the video player with proper layout spacing.

Notable Implementation Details

  • Track colors cycle through an 8-color palette and repeat for tracks beyond H
  • Trash icon is custom-drawn using Scenery primitives (rectangles and lines)
  • Track rows use separate clickable zones to prevent event bubbling conflicts with the trash button
  • Console logging tracks all track operations for debugging
  • Panel automatically hides when no video is loaded and re-enables controls when video is available

https://claude.ai/code/session_01CP5L71zPTyP7PVNarwE1sz

Users can now create named tracks (A, B, C …) from a right-side panel
that appears once a video is loaded. Each track is displayed as a
colour-coded box with its letter symbol and a trash-can delete button.

Clicking a track box records a data point (frame number + timestamp)
for that track and automatically advances the video by one frame,
enabling frame-by-frame manual digitising. All recorded points are
logged to the browser console.

Changes:
- src/screen-name/model/Track.ts (new) – TrackPoint / Track types
- src/screen-name/model/SimModel.ts – addTrack / removeTrack /
  addPointToTrack / canAddTrack methods + tracksProperty
- src/screen-name/view/TrackListPanel.ts (new) – TrackListPanel +
  TrackRowNode UI components
- src/screen-name/view/VideoPlayerNode.ts – public stepForward() method
- src/screen-name/view/SimScreenView.ts – wire TrackListPanel into layout

https://claude.ai/code/session_01CP5L71zPTyP7PVNarwE1sz
@veillette
veillette merged commit a5398e8 into main Feb 18, 2026
1 check passed
@veillette
veillette deleted the claude/add-particle-tracking-kpM9l branch February 18, 2026 17:11
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