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
- User activates comparison mode (keyboard shortcut, or a modifier like
C while in session mode).
- Click on an existing annotation → it highlights as "selected for comparison."
- Click on a second annotation → comparison result is displayed.
- (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
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
Cwhile in session mode).Display
Match ✓if dimensions are equal within a configurable tolerance (e.g. ±1 px), orΔ12×3 pxshowing the width and height difference.Match ✓if colors are identical, or the hex values side-by-side + ΔE color distance. Optionally show WCAG contrast ratio between the two colors.143 px vs 145 px — Δ2 px.Tolerance
Implementation notes
{type: "comparison", annotationA: id, annotationB: id, result: {...}}.Canvasline +MeasurementLabelfor the comparison text.@pyqtSlotonRulerBackend) or JS, depending on complexity:Depends on