Skip to content

Replace mutable merged tracks with read-only projections - #1849

Draft
PaulHax wants to merge 3 commits into
hierarchical-classification-pr2-mutationsfrom
hierarchical-classification-pr3-projections
Draft

Replace mutable merged tracks with read-only projections#1849
PaulHax wants to merge 3 commits into
hierarchical-classification-pr2-mutationsfrom
hierarchical-classification-pr3-projections

Conversation

@PaulHax

@PaulHax PaulHax commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Replace mutable merged tracks with read-only projections

The multicamera track list returned a cloned Track model. The clone still had mutation methods
and notification state. A caller could change the clone without changing the stored camera tracks.

The single-camera path returned a live model. Thus, the two paths had different read and write
behavior.

Changes

  • Add a data-only TrackProjection for logical-track reads.
  • Give single-camera and multicamera callers the same read interface.
  • Remove mutation methods, notification state, and revision references from projections.
  • Add pure helpers for display type, features, interpolation, split checks, and keyframe navigation.
  • Cache each projection until a source camera track or camera set changes.
  • Route notes, attributes, feature attributes, keyframes, and interpolation through CameraStore
    commands.
  • Remove the obsolete notification bypass from Track.merge.

An edit in any camera invalidates the related projection. This includes an edit in a camera that is
not the canonical camera.

Manual tests

Test data: download and extract classification.zip. Paths below are relative to dive-classification-test-data/.

Multicamera row edits

  1. Create the dataset from
    dive-classification-test-data/classification/multicamera-linked-types/.
  2. Edit a note, track attribute, detection attribute, and keyframe; then save, reload, and switch
    cameras.

Verify: The logical-track view shows the saved note, attributes, and keyframe geometry after reload.

Projection refresh from either camera

  1. Create the dataset from
    dive-classification-test-data/multicamera/divergent-classification-replicas/.
  2. Edit track 2 from port, then edit it from starboard.

Verify: The list and Track Details refresh after either camera track changes.

Stack

This is PR 6 of 9. Previous: centralize classification changes.
Next: make lifecycle operations classification-safe.

  1. Allow devDependency imports in TypeScript spec files
  2. Preserve warnings from every Desktop import file
  3. Copy source metadata when creating a single-camera soft clone
  4. Add hierarchical track classification
  5. Centralize hierarchical classification changes
  6. Current — Replace mutable merged tracks with read-only projections
  7. Make track lifecycle operations classification-safe
  8. Add lossless DIVE KWCOCO classification support
  9. Define raw and resolved classification boundaries

This PR is stacked on hierarchical-classification-pr2-mutations.

Overall: 24 files, +808/-151. Commits: 523556b9 through 9bc865e1.

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.

1 participant