Files
faunosteo/.claude/audits/2026-11-05-v1-2-6-ux-feasibility.md

96 lines
7.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# V1-2.6 new editor UX: feasibility audit (read-only, 2026-11-05)
Brief « V1-2.6 : nouvelles maquettes UX approuvées sur le principe ». Read-only analysis of `crates/core` and the
V1-2.6 editor on `feature/v1-2-anatomical-sheets`; nothing built or run. Owner-facing summary in
`docs/design/v1-2-6/REVUE.md` § Faisabilité. Classes: SUPPORTED, UI-ONLY, CORE-OP MISSING, SCHEMA CHANGE.
## 1. Annotation categories: SCHEMA CHANGE (fixed categories, opacity)
- No fixed category. Equine draft: articulations #ff9500, os #a41e65, charnieres-vertebrales #ff0000, zone-colonne
#e100ff, cadrans-du-crane #1baa08; only the legacy importer names them (curation/legacy/categories.rs:15-29).
New sheet: `categories: []` (domain/sheet/create.rs:27); drawing tools disabled until one exists
(EditableAnnotations.tsx:113,138).
- Schema `{id, name, color: #rrggbb | null}` (schema.rs:219-228); `is_hex_color` = 7 chars, no alpha (domain/js.rs:180-183).
- Delete refused with `has_dependents` only while used (edit.rs:570-577, 903-908); every row has Delete
(general/CategoriesSection.tsx:108-116).
- Opacity: constants only. Point twin 0.65 main / 0.5 detail (anatomy/layer.rs:94,242), zone 0.3 (layer.rs:299),
trigger 0.06 (layer.rs:308), PDF highlight 0.85 (compose.rs:42), CSS selected 0.85 (styles/index.css:14);
ANNOTATION-RENDERING.md:25-27. No stroke-opacity.
- Displayed colour: annotation.color, else category colour, else #888888 (layer.rs:13,147-155).
- A schema change touches: ts-rs types; frozen N-1 reader `.strict()` (packages/core-wasm/tests/n-1/.../schema.ts:66-72);
PDF snapshot embeds categories (archive/snapshot_rules.rs:160-162); fingerprint = JCS of the validated document
(fingerprint.rs:1-11, equine alias :43-48); review digests (review.rs:349-382); SQL pins (migrations
20261010100000:12, 20261028110000:424); worker verdict strict read (verdict.rs:264-274); f64 breaks `Eq` on
AnnotationCategory (schema.rs:219); rendering change → ANNOTATION-RENDERING.md first, R3/R4 goldens owner decision.
## 2. Category and vertebral region: no link (UI-ONLY filter, or new rule)
- Only rule: region code exists, `annotation.region.missing` (validate.rs:348-365); also `region.code.duplicate`
(validate.rs:391), `region.count_range.invalid` (validate.rs:502-526). Code grammar: 1-16 chars, alnum, `_`, `-`,
alnum first (domain/js.rs:169-177).
- Practitioner picker keyed on `vertebral_region_code`, never on the category (domain/editor/zone.rs:101-102,
336-346; index.rs:145-164). Equine: only the 5 zone-colonne polygons carry a code.
## 3. Points: SUPPORTED (move, numeric radius); radius drag UI-ONLY
- Drag translates cx, cy after 4 CSS px, rounded 0.01 (editor/annotations/gesture.ts:5,12-22); one `update` on
pointer-up (useMoveGesture.ts:98-105; annotationCommit.ts:93-104).
- Checks after commit (issues.ts:123-175): `out_of_frame` (frame.rs:113-119,167-174), `too_small` when
2·max(2, r−12)·scale < 4 CSS px (layer.rs:260-262; frame.rs:63-67,160-165,219-221); no interior check on circles.
- r > 0 only (schema.rs:335-336). « 12 + 3 % » is a page default (editor/annotations/frame.ts:55-59).
## 4. Polygons: SUPPORTED as `update` of the points array; vertex drag / segment insert UI-ONLY
- Add vertex inserts the midpoint after the selected row (geometryEdit.ts:91-111); remove disabled at 3
(GeometryGroup.tsx:320); schema refuses < 3 (schema.rs:365-372). Overlay vertices `pointer-events-none`
(AnnotationOverlay.tsx:48-66,125).
- Checks: out_of_frame, too_small, `interior_too_small` (frame.rs:206-254; interior.rs:33-43). Self-intersection
allowed, nonzero fill decides (interior.rs:283).
- Undo: one entry per accepted commit, 8 MiB (undo.ts:7,52-74; editorEdit.ts:45-61); Ctrl+Z / Ctrl+Shift+Z
(useUndoShortcuts.ts:8-24). Preview on move, core on pointer-up (useMoveGesture.ts:90-105); < 61 ms on equine.
## 5. Paths: CORE-OP MISSING (point editing and translation)
- Core reads `d` to measure only (anatomy/path.rs:51-133): private Cursor/Pen, no segment model, no writer.
App: paths neither editable nor draggable (geometryEdit.ts:31-35; gesture.ts:32); C45 never reshaped
(repair.ts:55-70,95-100). No seed contains a path.
- Existing proposal, not built: `.claude/tasks/plans/2026-11-04-v1-2-6-path-repair-core-proposal.md`
(`sheet.path_points`, `sheet.path_move_points`, wasm 583 126 / 600 000 B gzip).
- Lossless handle editing also needs: number byte spans, relative-command compensation, H/V, implicit S/T controls,
arcs (endpoint only). Reusable: path.rs number grammar (private), `json::js_number` (json.rs:18),
`svg/number.rs:122`.
## 6. Detail views: crop SUPPORTED; derived asset not needed; remap on replacement MISSING
- `compose_canvas` clones the whole sanitised asset, root becomes `<g>` keeping defs and transforms, only the root
viewBox is the frame (compose.rs:94-160); reader strips only root class/style/transform/filter/mask/clip-path
(svg/sanitize.rs:243-249).
- Coordinates in the user space of the drawing shown (own asset, else up the parent chain) (compose.rs:74-90;
frame.rs:6-11).
- Replacement: clean_svg (crates/wasm/src/lib.rs:160) → upload → `addDrawing` (editorEdit.ts:85-104) → view
`update` of `svg_asset_id` (drawingUpload.ts:185); numbers kept, read in the new space. View box or drawing change:
geometry untouched, annotations → `to_confirm` (edit.rs:792-857); page refuses new geometry errors
(issues.ts:141-160); repair dialog only for previously unmeasured views (repair.ts:132-151, C33).
## 7. Name suggestion from a rectangle: CORE-OP MISSING
- No rectangle query or hit-test; clicks resolve through DOM `data-anno-id` (ops.rs:297,311-319;
useCanvasGestures.ts:57-64). Internal blocks: `frame::geometry_bounds`, `placement` (frame.rs:167-204), index
`name()` (index.rs:166-179). Sketch: `sheet.annotations_in_rect` {document, view_id, rect} →
[{id, name, category_id, inside|partial}].
## 8. Touch
- One pointer pans, two pinch, zoom 1-6, wheel, keyboard (catalogue/useFraming.ts:46-148; framing.ts:20);
`touch-action: none` while a tool or drag is active (useCanvasGestures.ts:76-84).
- No touch-sized handles (AnnotationOverlay.tsx:116). Move gesture has no pointerId check (useMoveGesture.ts:82-105).
- LRN-108 Chromium tap tolerance, observation only. `MIN_EDIT_WIDTH` 1024 (editor/mode.ts:21; useViewport.ts:9-13).
## 9-10. References, Général
- Only finding categories and nodes cite references (schema.rs:551,579); PDF snapshot drops them
(snapshot_rules.rs:115,133,159).
- Général: Fiche (name, description, scope disclaimer FR/EN), Attribution, Catégories (GeneralTab.tsx:22-24).
No template text anywhere; contract §7.4 « No template of scientific content is shipped »; publication needs a
non-blank disclaimer FR and EN, `publish.disclaimer.missing` (migration 20261028110000:206-214).
## 11. Reusable states
Modes edit, narrow, rights, frozen, historical, inactive (mode.ts:12-18; ModeNotice.tsx); DraftHeader statuses;
RecoveryNotice; CopyIssueNotice; ConflictDialog; BlockKind refusals (editorTypes.ts:13-23); frame refusal and repair
dialog (i18n/fr.ts:1420-1434); canvas failure (AnnotationCanvas.tsx:164-188); delete dialog.
## Constraints in force
BDR-043 (rules in Rust, no TS path parser), BDR-086, BDR-091, BDR-092, BDR-068, BDR-019, LRN-103, LRN-108; contract
§8.3 level-2 deferrals and §8.4 O14 A; `crates/**` outside V1-2.6 scope without owner approval.