feat(app): editor Annotations tab, core-decided placement, repair rules

This commit is contained in:
bchanot committed 2026-11-04 13:49:41 +01:00
1 parent 92c595caa1
commit 26097852ff
37 files changed
+5001 -6

No files matched your search

+19
View File
@@ -133,6 +133,25 @@ The application stylesheet: `.svg-canvas [data-state='current']` fills the
selected markers with the accent colour at 0.85, every `[data-anno-id]` shows
a pointer cursor and brightens on hover.
## Editor overlay (V1-2.6)
The draft editor (admin, tab Annotations and the crop rectangle of tab Views)
puts a second `<svg>` over the core's composed view, inside the same transformed
container, with the composed root's own `viewBox` and `preserveAspectRatio` (the
attribute text, read with `Number`, never `viewBox.baseVal`). It draws no
annotation: the markers stay the core's (`view.canvas`) and the drawing is never
modified. The overlay holds numbers only, drawn from the editor's state: the
selection outline (dashed), the vertex circles, the tracing in progress, the
pending or dragged outline, the hollow cross of a corrected position and the
crop rectangle. It sets `pointer-events: none` on its own shapes; the pointer
is read on the canvas box and mapped to drawing units through the overlay's
`getScreenCTM().inverse()`. No overlay shape carries `data-anno-id`, so click
targeting still reads the core's markers only.
The overlay only proposes geometry. Whether a position, a radius or a polygon
is acceptable (frame, minimum visible size, interior) is the core's verdict on
the candidate document; the page keeps no copy of those rules.
## PDF highlight
The engine composes the observation's zones of one view: the markers of the