Skip to content

Session mode: persistent annotations, measurement export & composite screenshot #6

@pgivel

Description

@pgivel

Summary

Add a session mode that turns Screen Ruler from a quick-check tool into a persistent annotation workspace for UI validation.

Entering / exiting session mode

  • Press Tab while in normal (quick) mode to enter session mode.
  • In session mode, Esc quits (with a prompt/confirmation if annotations exist — TBD).
  • Normal mode (current behavior) is unchanged: click copies measurement and quits.

Interaction changes in session mode

  • Click places a persistent annotation (marker + measurement label) on screen, using the current mode's measurement. The annotation stays visible.
  • Ctrl+Z / Z undoes the last annotation.
  • 1 / 2 / 3 / … switches measurement mode (crosshair, drag rect, container detection, and future modes).
  • Annotations accumulate — multiple measurements can coexist on screen.

Annotation model

Add a Python-side annotation list exposed to QML (e.g. as a QAbstractListModel or a simple list property). Each annotation stores:

  • Mode that produced it
  • Geometry (rect, point(s), or measurement bounds)
  • Measurement text
  • Optional: color info, guide reference

QML renders annotations via a Repeater over this model using existing visual components (SelectionOutline, MeasurementLabel, SnappedPointerMarker) instantiated per annotation.

Export: Ctrl+C — Markdown measurement list

Copy all current annotations as a Markdown-formatted list to the clipboard.

Example output:

- Crosshair @ (412, 230): 48 × 32 px
- Container @ (100, 80): 320 × 200 px
- Point-to-point: A(10, 20) → B(150, 45) — 143.4 px (Δx=140, Δy=25)

Export: Ctrl+Shift+C — Composite screenshot

  1. Enter a rectangle-drag selection (click & drag to choose export region).
  2. Render the selected region of the original screenshot with annotations overlaid into a composite image.
  3. Copy the resulting image to the clipboard.
  4. (Optional) Also support Ctrl+S to save to a file with a dialog.

This serves the "proof of correctness/error" use case — the user can paste the annotated screenshot directly into a ticket, Slack, etc.

Design notes

  • The current quick mode must remain the default — session mode is opt-in.
  • A visual indicator (e.g. small badge or tinted status) should signal that session mode is active.
  • Session mode is the prerequisite for annotation comparison, linking, and other future collaborative features.

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