Skip to content

M7d annotation follow-ups: move-copy deselect + review roll-ups #96

Description

@Rowee13

Tracked follow-ups from the M7d (v0.2.4) build and final whole-branch review. All triaged track-not-fix — none are correctness bugs in shipped paths.

1. Move-copy (Ctrl-drag) silently deselects a co-selected annotation

tools/move_tool.py — the move-copy branch calls the pre-existing Selection.replace(instances=new_ids), which zeroes every unnamed field including _annotations. Effect: Ctrl-dragging an instance with an annotation also selected leaves the annotation data untouched (not moved, not copied, not corrupted) but drops it from the selection with no feedback. Move-copy-for-annotations semantics (copy? follow the copy? leave in place?) is a genuine product decision, deliberately out of M7d scope.

2. DeleteAnnotationsCommand.do() uses value-equality removal

commands/annotation_commands.py — uses list.remove(ann) (dataclass __eq__, value-based) rather than the identity-based approach CreateAnnotationCommand uses. Non-exploitable today (ids are model-unique, so no two live annotations are field-for-field equal; candidates are captured by id with true indices before removal). Align to identity-based for consistency.

3. Missing committed test: annotation + stale-instance-id delete

The _on_delete_selection path where an annotation is co-selected with an instance id that no longer exists is verified correct (by trace + adversarial repro) but has no committed regression test.

4. _plan_dimension/_plan_label degenerate degradation is untested at the edges

A degenerate extension line / arrowhead is silently dropped (segment count < expected) rather than raised — consistent with module precedent; graceful (plan still returned, hit boxes intact). Add explicit edge-case coverage if desired.

5. _EPS = 1e-9 is tight for pixel-space vectors

In annotations/draw_plan.py, a near-edge-on view can yield an unstable tick/leader direction (annotation skipped that frame, no NaN; reappears on rotation). Consider a pixel-scaled epsilon.

6. Cosmetic: selected-annotation colour not single-sourced

viewport/viewport_widget.py hardcodes QColor(51, 140, 242) for selected annotations; selected edges use scene_renderer._SELECTION_EDGE_COLOR(51, 140, 255). Visually indistinguishable; route both through one constant.

Milestone: M7d / v0.2.4. Python-only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions