Skip to content

Fix annotations#95

Merged
TeunHuijben merged 3 commits intomainfrom
fix-annotations
Feb 27, 2026
Merged

Fix annotations#95
TeunHuijben merged 3 commits intomainfrom
fix-annotations

Conversation

@TeunHuijben
Copy link
Collaborator

Fix annotation t_begin/t_end clamping and improve segment display

Fix bug where clicking an annotated cell caused t_begin/t_end to be incorrectly clamped to an unrelated track's unannotated segment bounds. Root cause: validation used a stale current_annotation_index pointing to the wrong segment. Fixed by storing current_toannotate_segment directly (set to None when the selected cell is not in an unannotated segment) and using it in validation instead of index-based lookup.

Extract _get_label_segments(track_data) helper that groups consecutive same-label frames into (first_t, last_t, label) tuples, replacing a duplicate manual loop in _update_label.

Add populate_annotated_segment_range(track_id, cell_time) that uses _get_label_segments to pre-fill t_begin/t_end with the bounds of the annotated segment the clicked cell belongs to (instead of the full track range).

Update fully-annotated status line from "entire track annotated" to "entire track annotated (H, S)", showing the unique labels present on the track.

@TeunHuijben TeunHuijben marked this pull request as ready for review February 27, 2026 18:07
@TeunHuijben TeunHuijben merged commit f64340f into main Feb 27, 2026
1 check passed
@TeunHuijben TeunHuijben deleted the fix-annotations branch February 27, 2026 18:07
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