Skip to content

Session mode: Annotation comparison tool #13

@pgivel

Description

@pgivel

Summary

In session mode (#6), add a comparison interaction: click one annotation, click another, and the tool visually links them with a comparison result (size match/mismatch, color match/mismatch, distance delta).

Use case

"Are these two buttons the same size?" / "Do these two headings use the same color?" — the user has already placed two annotations and wants to compare them without doing mental arithmetic.

Interaction

  1. User activates comparison mode (keyboard shortcut, or a modifier like C while in session mode).
  2. Click on an existing annotation → it highlights as "selected for comparison."
  3. Click on a second annotation → comparison result is displayed.
  4. (Optional: Shift+click to compare without entering a dedicated mode — just click two annotations in sequence.)

Display

  • A connecting line is drawn between the two annotations.
  • A comparison label at the midpoint of the line shows the result:
  • Line color indicates result at a glance:
    • Green — match (within tolerance).
    • Red/orange — mismatch, with the delta shown.
  • The comparison persists as its own annotation (can be undone with Ctrl+Z).

Tolerance

  • Default tolerance: 0 px (exact match) or 1 px (to account for sub-pixel rounding).
  • Could be configurable via scroll wheel while in comparison mode, or a global setting.

Implementation notes

  • Comparison is a derived annotation type: {type: "comparison", annotationA: id, annotationB: id, result: {...}}.
  • Stored in the annotation model alongside regular annotations.
  • QML: rendered as a Canvas line + MeasurementLabel for the comparison text.
  • Comparison logic lives in Python (@pyqtSlot on RulerBackend) or JS, depending on complexity:
    • Size comparison: trivial arithmetic.
    • Color comparison (ΔE): best done in Python with a small color-distance formula (CIEDE2000 or simpler CIE76).

Depends on

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions