docs(docs): V1-2.6 annotations-findings complement, boards 17-22, study

Owner brief: bidirectional navigation between annotations and findings.
Relations audit (one finding_zone_id link, no new association), six
boards from the equine draft data, placement U2b, risks, tests, owner
decisions F1-F16. Design only; U1 plan untouched.
This commit is contained in:
bchanot committed 2026-11-06 13:15:15 +01:00
1 parent 2e46c14697
commit 212126c6ce
15 files changed
+1002

No files matched your search

+1
View File
@@ -681,6 +681,7 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
- [x] static audits (core model, rendering/PDF/N-1, geometry/wasm, SQL/worker, editor/tests) · [x] docs/development V1-2-6_UX_{PLAN,COMPATIBILITY,TESTS,RISKS,DECISIONS}.md (sub-steps U0-U9, decisions T1-T19) · [x] independent review (3 lenses: CONCERNS 5/9/6, no BLOCKER) + fixes integrated (plan §6) · [x] commit + push branch · [x] owner answers 2026-11-05 (brief « V1-2.6 UX — Ratification des décisions techniques », BDR-100): T11 approved, T16 conditional deferral (curves lot), T2/T3 conditional on proofs, T4 no residual gap, T5 history preserved, T9 three actions, T10 navigation type, T12 principle · [x] five docs updated (decisions, compatibility §0/§7/§8, tests, risks + blocking criteria, plan §7) · [x] LRN-118 (wasm measuring rule) · [x] independent reviews: correctness challenger CONCERNS(5 MAJOR, 7 MINOR) integrated; verifier ECARTS(2) fixed; targeted re-check ECARTS(2) (one U6 test assumed permissive save, deploy order said all rounds) fixed · [x] third independent check before commit (2026-11-05): ECARTS(2) on K10/K11 (R-3 mitigation, U6 objective on older T4 scope, write-lock test assumed stripping save, T16 count scope in two forms) fixed · [x] fresh targeted re-check: CONFORME 12/12 (G1-G4 closed; 7 observations kept for U0) · [x] commit + push · [x] owner answers 2026-11-05 (brief « Autorisation U0 uniquement », BDR-101): T4 both SQL checks approved (O22 amended), T5 defaults, T10 option B, T15, T16 count before activation, « Remplacer par un polygone » explicit · [x] T17 answered 2026-11-06 (BDR-102) · [ ] still open: T12 text (before U7), T6 (V1-2.8), T14 follow-up; T1 only if a measure exceeds · [x] owner authorisation to start U0 (2026-11-05)
- [ ] V1-2.6 UX U0, contract and decisions, docs only (contract `.claude/tasks/contracts/2026-11-05-v1-2-6-ux-u0.md`; no code, no SQL, no DEV, no U1): [x] V1-2 contract §6.2, §6.4, §6.7, §7.4, §8.2-§8.4, §12.2 + §17.1 (O22), §16.7, §16.12, §17.12 · [x] level-1 contract C3, C4, C5, C6, C7, C8, C11, C13, C16, C18, C20, C25, C28, C32, C33, C40, with the precedence rule of its header · [x] docs/design/README.md · [x] rules sheet-model.md, schemas.md · [x] five UX docs · [x] BDR-101 · [x] preconditions (r5:import-equine --check clean, seed 22/6/0 paths, wasm 592 143 B) · [x] independent verification: ECARTS x6 fixed, then CONFORME 12/12 (2026-11-06); open points for U2/U6 not in docs: point edge-size handle (boards 02/03), default laterality of the automatic access (U6), §15 replay text vs the category.fixed.* filter · [x] commit + push · [x] owner U0 checkpoint (approved for good in the brief « Autorisation de U1 uniquement », 2026-11-06)
- [ ] V1-2.6 UX U1, editor shell (brief « Autorisation de U1 uniquement » + « U1 — Validation de la conception interne », approach A; contract `.claude/tasks/contracts/2026-11-06-v1-2-6-ux-u1-1123.md`; plan `.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md`, lots A, B1, B2, C-I; no Rust/SQL/worker/scripts, no DEV, no merge, no U2): [x] design approach A validated by the owner with 10 precisions · [x] owner choices 2026-11-06 (server save time, non-modal references panel, citation button in the finding's detail, board 01 annotation card) · [x] plan written + three-lens challenge (correctness CONCERNS 6, robustness CONCERNS 5, simplicity CONCERNS 2, no BLOCKER) integrated · [ ] owner plan checkpoint · [ ] lots A-I · [ ] gates, verifier, security · [ ] owner U1 checkpoint
- [ ] V1-2.6 UX complement « annotations ↔ constats » (owner brief 2026-11-06 « Nouvelle exigence UX : navigation bidirectionnelle »; contract `.claude/tasks/contracts/2026-11-06-v1-2-6-findings-nav-design.md`; design only, U1 plan untouched, no code, no DEV): [x] relations audit (one link `finding_zone_id`, no new association, equine draft 1:1) · [x] boards 17-22 `docs/design/v1-2-6-constats/` · [x] study `docs/development/V1-2-6_UX_FINDINGS_NAV.md` (no U1 integration point needed, sub-step U2b proposed, risks, tests, decisions F1-F16) · [x] fresh design review APPROVE WITH FIXES (3 MUST-FIX, 16 SHOULD), fixes applied · [ ] fresh verifier (ECARTS(4) round 1 fixed) · [ ] owner validation of the complement (then F1-F12)
- [ ] follow-up candidates (owner T14): multi-tab notice; RR item for the rollback limit of the category model (new id, reconcile with develop)
- [ ] curves lot (ex-U9, owner T16 2026-11-05): curve handle editing, curved zone move, path remap, path point correction; spec `V1-2-6_UX_PLAN.md` §2 D, tests `V1-2-6_UX_TESTS.md` « Curves lot ». Rule: no feature that lets a path enter a document (package import, zones from the drawing's shapes, a curve drawing tool) ships before or without it. Before the new model is activated on an environment, and before U6 or U8 reaches any environment beyond the throwaway sandbox: read-only count of path geometries in its drafts and published versions (sandbox by U6 itself; DEV and shared environments by the owner or under explicit authorisation; non-zero reopens T16)
- [ ] MANDATORY before merging V1-2 into develop (owner 2026-11-03): registry id reconciliation. LRN-095 collides: develop 09655b2 « Port a safe runner verbatim… » (2026-11-02) vs V1-2 « pgTAP across PGlite and the real Supabase image… » (2026-10-28, cited by BDR-084 and the V1-2.1 TODO lines). BLK-013 exists on develop only (« e2e:avatar on develop reached DEV »): `memory.sh` on V1-2 would hand out BLK-013 again, so a V1-2 blocker needs its id checked against develop first. Same for the TODO release-readiness ids: RR-11 is develop's (« sandbox-only e2e follow-ups »), V1-2 uses RR-12. No renumbering during V1-2.6 unless needed; renumber one side and patch its citers at the merge
@@ -0,0 +1,125 @@
# CONTRACT — v1-2-6-findings-nav-design
- date: 2026-11-06 | flow: design complement (docs and mockups only) | branch: feature/v1-2-anatomical-sheets
- status: active
- worktree: /home/bchanot/Documents/faunosteo-v1-2 (every command from this absolute path; never DEV: the
`supabase_*_faunosteo` containers are DEV; no sandbox needed for this track)
- base: 2e46c14 (U1 contract and challenged plan, awaiting the owner's plan checkpoint). Commit in place, push; no
merge, no `gitflow.sh finish`.
- context: the U1 plan `.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md` stays as committed; this track may only
PROPOSE a named amendment to it, applied after the owner's approval.
## REQUEST (verbatim — IMMUTABLE)
avant, demande de modification ou detail a apporter :
# FAUNOSTEO — Nouvelle exigence UX : navigation bidirectionnelle entre annotations et constats
Le propriétaire ajoute une exigence fonctionnelle aux maquettes validées.
Cette demande ne doit PAS interrompre le plan U1 actuellement en cours, ni provoquer une implémentation prématurée.
## Fonctionnement souhaité
### A. Depuis le schéma anatomique
Lorsqu'un utilisateur sélectionne un point ou une zone du SVG :
- Afficher les constats associés à cette annotation anatomique.
- Permettre d'ajouter un constat depuis cette sélection.
- Permettre de modifier les constats existants.
- Permettre de gérer leur association anatomique.
- Conserver les familles de constats du modèle existant.
Exemple : sélectionner le grasset affiche les constats associés au grasset.
### B. Depuis l'onglet Constats
Ajouter :
- Une barre de recherche avec filtrage instantané.
- Un compteur de résultats.
- Un bouton « Filtrer sur le schéma ».
- Un volet permettant de choisir une ou plusieurs vues anatomiques.
- La sélection graphique de points ou de zones pour filtrer les constats.
- La combinaison du filtre visuel et de la recherche textuelle.
- Une action pour réinitialiser les filtres.
Les filtres sont des états d'interface : ils ne doivent pas modifier ni sauvegarder le document.
### C. Correspondance anatomique
Auditer les relations existantes entre annotations, vues, zones de constats et constats.
Éviter les doublons lorsque plusieurs annotations représentent une même région anatomique.
Ne pas inventer de nouvelles associations dans le modèle sans démontrer qu'elles sont nécessaires.
### D. Contraintes
- Respecter les autorisations existantes.
- Préserver le mode lecture seule sur téléphone en V1-2.
- Préserver le fonctionnement du cœur Rust et la compatibilité historique.
- Rendre les sélections et filtres accessibles au clavier.
- Ne pas modifier la structure documentaire sans validation spécifique.
## Travail demandé
Après finalisation du plan U1 actuel :
1. Examiner si l'architecture U1 doit prévoir des points d'intégration pour cette fonctionnalité.
2. Identifier dans quelle sous-étape UX elle doit être implémentée, ou proposer une sous-étape dédiée.
3. Produire un complément de maquettes ciblé sur ces interactions.
4. Documenter les risques techniques et les tests nécessaires.
5. S'arrêter à la validation de cette conception complémentaire.
Aucun code ne doit être modifié pour cette nouvelle fonctionnalité avant approbation.
Ne pas toucher à DEV, ne pas fusionner et ne pas commencer V1-2.7.
## CLARIFICATIONS
(none yet; owner questions are listed in the study's « Décisions à prendre » section, never answered by the
implementer)
## ACCEPTANCE CRITERIA
1. Audit (request C): the study `docs/development/V1-2-6_UX_FINDINGS_NAV.md` states, with file:line references, every
existing link between annotations, views, finding zones, finding categories (families), findings, vertebral
regions and references, which side holds it and its cardinality, the core rules that check it, and counts from
the equine draft document (annotations per zone, zones without annotation, annotations without zone, zones shown
by several annotations); a new association in the model is proposed only with a demonstrated need, and flagged as
requiring the owner's specific validation.
2. Duplicates (request C): the study and the boards say how findings are shown once when several annotations name the
same finding zone (both directions: from the drawing and in the schematic filter).
3. U1 integration (work item 1): the study says whether U1 needs integration points; any needed one is a named
amendment proposal for `.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md`, not applied; the U1 plan and contract
are unchanged by this track.
4. Placement (work item 2): the study names the sub-step that implements the feature (or a dedicated one), with its
dependencies on U1-U6, the files it would touch, whether it needs a Rust core operation (BDR-043, « Rust computes,
TypeScript reads ») and the wasm budget effect.
5. Boards (work item 3): a targeted complement in `docs/design/v1-2-6-constats/` (HTML source + one PNG per board,
rendered with the project's pinned Chromium through the v1-2-6 `render.cjs` pattern), in the validated v1-2-6
visual language, covering: A — an annotation selected on the drawing shows its findings by family, add from the
selection, edit, manage the association; B — Constats tab with instant search, result count, « Filtrer sur le
schéma », a panel choosing one or more views, graphical selection of points or zones, combined text and visual
filter, reset; and the states: read-only (rights, frozen) and narrow read-only below 1 024 px, keyboard
alternative to the graphical selection, no result, an annotation without finding zone, a zone shown by several
annotations. Names and counts come from the equine draft document, computed in the source, never typed.
6. Risks and tests (work item 4): the study lists the technical risks (with probability and mitigation) and the tests
per kind (unit, core if any, e2e, accessibility, regression) for the feature.
7. Constraints: no change under `apps/`, `crates/`, `supabase/`, `packages/`, `scripts/`, `docs/design/v1-2-6/`;
filters described as interface state only (no document change, no save); permissions, phone read-only (O14 A),
the core and the historical documents unchanged by the design; no V1-2.7 control; the untracked
`faunosteo-v1-2-6-revue-ux-chatgpt.md` never staged.
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet 2e46c14..HEAD -- apps crates supabase packages scripts docs/design/v1-2-6 && git diff --quiet -- apps crates supabase packages scripts docs/design/v1-2-6 && ! git ls-files --error-unmatch faunosteo-v1-2-6-revue-ux-chatgpt.md >/dev/null 2>&1 && echo FN_SCOPE_OK
EXPECT: FN_SCOPE_OK
EVIDENCE: MET exit=0 marker-found :: FN_SCOPE_OK
8. Every visible choice the design makes beyond the request is listed in the study for the owner (« Décisions à
prendre »), with a recommendation; none is presented as decided.
9. A fresh independent review of the boards (design) and a fresh verifier against this contract; justified gaps
fixed; exact verdicts reported. STOP at the validation of this complementary design.
## FILE SCOPE
- docs/design/v1-2-6-constats/** (new: maquettes.html, PNG boards, contact sheet, REVUE.md)
- docs/development/V1-2-6_UX_FINDINGS_NAV.md (new study)
- docs/design/README.md (one pointer line to the complement, marked « proposition, non validée »)
- .claude/tasks/TODO.md, this contract, .claude/memory (through memory.sh)
- NOT in scope: apps/**, crates/**, supabase/**, packages/**, scripts/**, docs/design/v1-2-6/**, the U1 plan and
contract, the V1-1 checkout
+2
View File
@@ -133,3 +133,5 @@ review (contract `.claude/tasks/contracts/2026-11-05-v1-2-6-ux-corrections.md`):
(`04`), undo / redo as global header commands on every tab (owner-confirmed), board `07` split into one state per
interaction, counters computed from the draft data; boards `12` and `15` unchanged. `ARBITRAGES.md` separates the
owner-confirmed choices from the open ones; `ETUDE-TECHNIQUE.md` lists the prerequisites before any development.
`v1-2-6-constats/` (proposition, non validée, 2026-11-06): boards 17-22, annotations ↔ findings complement; study `docs/development/V1-2-6_UX_FINDINGS_NAV.md`.
Binary file not shown.

After

Width:  |  Height:  |  Size: 319 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

+44
View File
@@ -0,0 +1,44 @@
# V1-2.6 complément : annotations et constats (proposition, non validée)
Brief propriétaire du 2026-11-06 « Nouvelle exigence UX : navigation bidirectionnelle entre annotations et constats ».
Contrat `.claude/tasks/contracts/2026-11-06-v1-2-6-findings-nav-design.md`. Étude, placement, risques, tests et
décisions F1 à F16 : `docs/development/V1-2-6_UX_FINDINGS_NAV.md`. Aucun code n'est écrit avant l'approbation.
| Fichier | Contenu |
|---|---|
| `17-dessin-constats-selection.png` | Point sélectionné (grasset) : volet « Constats · 29 », zone de constats, familles et comptes, ajout, ouverture dans Constats |
| `18-dessin-ajouter-modifier.png` | A : ajouter un constat dans la zone ; B : modifier un constat (mêmes champs que l'onglet Constats) |
| `19-association-anatomique.png` | A : changer de zone ; B : annotation sans zone ; C : accès à une vue détaillée ; D : zone montrée par deux annotations (cas illustratif) |
| `20-constats-recherche.png` | Recherche instantanée, compteur, « Filtrer sur le schéma », réinitialisation, renvoi au dessin |
| `21-constats-filtre-schema.png` | Volet « Filtrer sur le schéma » : vues, sélection sur le dessin, combinaison avec le texte |
| `22-etats.png` | Aucun résultat, liste au clavier, lecture seule, moins de 1 024 px |
| `planche-contact.png` | Les six planches |
| `maquettes.html`, `data.js`, `gen-data.cjs` | Source des planches ; données calculées depuis `document.json` du brouillon équin |
Conventions :
- Styles, icônes, coquille et dessin repris des planches v1-2-6 validées ; en-tête de l'éditeur tel que le plan U1 le
prévoit (pas de « Prévisualiser », « Abandonner les modifications » à côté d'« Enregistrer »).
- Noms et nombres calculés : 29 constats pour le grasset (16 = 3 groupes + 13 constats dans les dysfonctions), 108
constats sur 730 pour « restriction », 15 avec le filtre grasset + jarret + vertèbres lombaires (planche 21), 0 pour
« abduction » dans grasset et jarret et 2 ailleurs (planche 22 A). Les noms de catégories d'annotation de la
planche 22 B viennent du brouillon (« Segments vertébraux »).
- Données de la fiche : toutes calculées. Cas inventé : la vue « Membre postérieur » de la planche 19 D, signalée
comme illustrative (le brouillon équin n'a aucune zone montrée par deux annotations). Texte de mise en scène repris
des planches v1-2-6 validées, sans valeur de donnée : fil d'Ariane « Cheval, squelette et rachis », titre « Brouillon,
version 4 », nom de l'utilisateur, « 3 modifications non enregistrées », « 2 erreurs ». Le libellé « Restriction en abduction » de la planche 18 A est une
saisie d'exemple. « Accès : Tête (vue latérale gauche) » est un nom d'affichage proposé pour l'accès, qui n'a pas de nom
dans la fiche (décision F7).
- Les libellés sont des propositions pour la revue des libellés (C44).
- Rendu : `PW_MODULE=<…>/apps/app/node_modules/@playwright/test node ../v1-2-6/render.cjs maquettes.html .`, après
`node gen-data.cjs`.
## Contrôles indépendants (2026-11-06)
- Revue de conception neuve des planches 17 à 22 : APPROVE WITH FIXES (3 MUST-FIX, 16 SHOULD). Corrigé : familles
toutes visibles en lecture seule (22 C), deux vues choisies et une zone polygonale cochée (21), noms de catégories
repris du brouillon (22 B) ; la plupart des SHOULD appliqués (compteurs expliqués, en-tête sur une ligne, liste au
clavier en cases natives, téléphone avec avis 1 024 px, cibles 44 px et réinitialisation, doublon dessiné en 19 D).
- Vérificateur neuf, tour 1 : ECARTS(4). Corrigé : cardinalité des accès (plusieurs à un), sous-arbres « Anamnèse »
(trois variantes), preuve de l'oracle du critère 7 consignée, décisions F13 à F16 ajoutées ; verdict de la revue
consigné ici.
+2
View File
@@ -0,0 +1,2 @@
// generated by gen-data.cjs from document.json
window.DOC = {"views":[{"id":"main","fr":"Vue latérale gauche","vb":null},{"id":"head","fr":"Tête (vue latérale gauche)","parent":"main","vb":{"min_x":60,"min_y":100,"width":500,"height":380}}],"categories":[{"id":"articulations","fr":"Articulations","color":"#ff9500"},{"id":"os","fr":"Os","color":"#a41e65"},{"id":"charnieres-vertebrales","fr":"Charnières vertébrales","color":"#ff0000"},{"id":"zone-colonne","fr":"Segments vertébraux","color":"#e100ff"},{"id":"cadrans-du-crane","fr":"Os du crâne","color":"#1baa08"}],"annotations":[{"id":"hind-fetlock","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Boulet postérieur (métatarso-phalangien)","zone":"hind-fetlock","region":null,"g":["c",1523,1397,34]},{"id":"hock","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Jarret (tarso-crurale et intertarsiennes)","zone":"hock","region":null,"g":["c",1542,1159,34]},{"id":"stifle","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Grasset (fémoro-tibiale et fémoro-patellaire)","zone":"stifle","region":null,"g":["c",1464,918,34]},{"id":"hip","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Hanche (coxo-fémorale)","zone":"hip","region":null,"g":["c",1585,612,34]},{"id":"sacroiliac","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Articulation sacro-iliaque","zone":"sacroiliac","region":null,"g":["c",1450,578,34]},{"id":"shoulder","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Épaule (scapulo-humérale)","zone":"shoulder","region":null,"g":["c",784,907,34]},{"id":"elbow","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Coude (huméro-radio-ulnaire)","zone":"elbow","region":null,"g":["c",743.0451049804688,1193,34]},{"id":"carpus","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Carpe (antébrachio-carpienne, médio-carpienne)","zone":"carpus","region":null,"g":["c",745,1252,34]},{"id":"fore-fetlock","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Boulet antérieur (métacarpo-phalangien)","zone":"fore-fetlock","region":null,"g":["c",736,1379,34]},{"id":"fore-sesamoids","view":"main","kind":"point","cat":"os","lat":"bilateral","fr":"Sésamoïdes antérieurs (boulet)","zone":"fore-sesamoids","region":null,"g":["c",784,1371,34]},{"id":"l6-s1","view":"main","kind":"point","cat":"charnieres-vertebrales","lat":"unpaired","fr":"Charnière L6-S1 (lombo-sacrée)","zone":"l6-s1","region":null,"g":["c",1424,515,30]},{"id":"t18-l1","view":"main","kind":"point","cat":"charnieres-vertebrales","lat":"unpaired","fr":"Charnière T18-L1 (thoraco-lombaire)","zone":"t18-l1","region":null,"g":["c",1118,528,30]},{"id":"c7-t1","view":"main","kind":"point","cat":"charnieres-vertebrales","lat":"unpaired","fr":"Charnière C7-T1 (cervico-thoracique)","zone":"c7-t1","region":null,"g":["c",865,528,30]},{"id":"caudal","view":"main","kind":"zone","cat":"zone-colonne","lat":"unpaired","fr":"Vertèbres caudales","zone":"caudal","region":"Cd","g":["p",[[1655,545],[1662,513],[1742,565],[1780,618],[1763,628],[1724,590],[1682,569]]]},{"id":"sacral","view":"main","kind":"zone","cat":"zone-colonne","lat":"unpaired","fr":"Vertèbres sacrales","zone":"sacral","region":"S","g":["p",[[1438,461],[1418.5,556.2],[1510.8,539.5],[1595,538.2],[1641,552],[1641,510],[1606,485],[1515,468]]]},{"id":"lumbar","view":"main","kind":"zone","cat":"zone-colonne","lat":"unpaired","fr":"Vertèbres lombaires","zone":"lumbar","region":"L","g":["p",[[1401.3,457.1],[1386,562],[1232,562],[1130,552],[1131.4,503.2],[1260,475],[1361,454.4]]]},{"id":"thoracic","view":"main","kind":"zone","cat":"zone-colonne","lat":"unpaired","fr":"Vertèbres thoraciques","zone":"thoracic","region":"T","g":["p",[[1109.9,497.7],[1103,558.9],[1010.3,558.9],[915,552],[873.9,530.7],[826.8,509.5],[841,422],[960,482],[1068,496]]]},{"id":"cervical","view":"main","kind":"zone","cat":"zone-colonne","lat":"unpaired","fr":"Vertèbres cervicales","zone":"cervical","region":"C","g":["p",[[468,276],[489,216],[558,248],[586,339],[607,401],[625,447],[649,510],[695.1,528.4],[728.9,520.1],[765.3,472.8],[816.8,453],[796.5,543.7],[730,600],[646,604],[593,565],[552,461],[524,370]]]},{"id":"head-trigger","view":"main","kind":"detail_trigger","cat":"articulations","lat":"unpaired","fr":null,"g":["p",[[454,332],[429,202],[408,150],[349,154],[300,188],[269,216],[234,279],[192,318],[164,384],[175,457],[234,468],[265,450],[328,419],[405,394],[443,408]]]},{"id":"parietal","view":"head","kind":"point","cat":"cadrans-du-crane","lat":"unpaired","fr":"Pariétal","zone":"parietal","region":null,"g":["c",348,161,27]},{"id":"frontal","view":"head","kind":"point","cat":"cadrans-du-crane","lat":"unpaired","fr":"Frontal","zone":"frontal","region":null,"g":["c",277,214,27]},{"id":"sphenoid","view":"head","kind":"point","cat":"cadrans-du-crane","lat":"unpaired","fr":"Sphénoïde","zone":"sphenoid","region":Line truncated
+40
View File
@@ -0,0 +1,40 @@
// node gen-data.cjs: writes data.js (window.DOC) from the equine draft document, so every name and
// count of the boards comes from document.json and none is typed by hand.
const fs = require('fs')
const path = require('path')
const SRC = path.join(__dirname, '../../../supabase/seed/anatomical-sheets/equine/draft/document.json')
const doc = JSON.parse(fs.readFileSync(SRC, 'utf8'))
const node = (n) => ({
id: n.id,
fr: n.name.fr,
en: n.name.en,
// absent = the core's default `Inherited` (crates/core/src/domain/sheet/schema.rs:186-188)
status: n.review_status || 'inherited',
refs: (n.reference_ids || []).length,
children: (n.children || []).map(node),
})
const out = {
views: doc.views.map((v) => ({ id: v.id, fr: v.name.fr, parent: v.parent_view_id, vb: v.view_box })),
categories: doc.categories.map((c) => ({ id: c.id, fr: c.name.fr, color: c.color })),
annotations: doc.annotations.map((a) => ({
id: a.id,
view: a.view_id,
kind: a.kind,
cat: a.category_id,
lat: a.laterality,
fr: a.name ? a.name.fr : null,
zone: a.finding_zone_id,
region: a.vertebral_region_code,
g: a.geometry.type === 'circle'
? ['c', a.geometry.cx, a.geometry.cy, a.geometry.r]
: ['p', a.geometry.points],
})),
zones: doc.finding_zones.map((z) => ({
id: z.id,
fr: z.name.fr,
families: z.categories.map((c) => ({ id: c.id, kind: c.kind, fr: c.name.fr, children: c.children.map(node) })),
})),
}
const body = 'window.DOC = ' + JSON.stringify(out) + '\n'
fs.writeFileSync(path.join(__dirname, 'data.js'), '// generated by gen-data.cjs from document.json\n' + body)
console.log('annotations', out.annotations.length, 'zones', out.zones.length, 'bytes', body.length)
+592
View File
@@ -0,0 +1,592 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Faunosteo V1-2.6 annotations et constats (proposition)</title>
<!--
V1-2.6 complement « navigation bidirectionnelle entre annotations et constats » (owner brief 2026-11-06,
contract .claude/tasks/contracts/2026-11-06-v1-2-6-findings-nav-design.md): static functional mockups, never
shipped, NOT validated. Styles, icons, shell and drawing helpers are copied from the validated
docs/design/v1-2-6/maquettes.html so the language stays the same. Every name and count comes from
data.js, generated by gen-data.cjs from the equine draft document.json. Rendered to PNG by render.cjs.
-->
<style>
:root {
--color-bg: #fbf9f5; --color-surface: #ffffff; --color-surface-strong: #f4efe6;
--color-ink: #1f1b16; --color-ink-muted: #6b6359; --color-border: #e7e0d2;
--color-accent: #b85a3f; --color-accent-strong: #9c4831;
--color-danger: #c0392b; --color-danger-strong: #962c21;
--severity-mild: #6b8e6b; --severity-moderate: #b88a3f; --severity-severe: #c0392b;
--font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
--font-serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: #ece6da; font-family: var(--font-sans); color: var(--color-ink); -webkit-font-smoothing: antialiased; }
.sheet-title { font: 600 15px var(--font-sans); margin: 0 0 10px; }
.row { display: flex; gap: 28px; align-items: flex-start; padding: 24px 28px; flex-wrap: wrap; }
[data-board] { background: #ece6da; padding: 16px; }
.frame { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(31,27,22,.06); position: relative; }
.desk { width: 1280px; height: 800px; display: flex; }
.tab-frame { width: 1180px; height: 820px; display: flex; flex-direction: column; border-radius: 22px; border: 10px solid #2a2520; }
.phone { width: 375px; height: 780px; display: flex; flex-direction: column; border-radius: 28px; border: 8px solid #2a2520; position: relative; }
.side { width: 216px; flex: none; background: var(--color-surface); border-right: 1px solid var(--color-border); display: flex; flex-direction: column; }
.side .logo { padding: 20px; } .side .logo img { height: 32px; }
.nav { padding: 0 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--color-ink-muted); }
.nav a.on { background: var(--color-surface-strong); color: var(--color-ink); font-weight: 500; }
.nav a.on::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--color-accent); }
.nav hr { border: 0; border-top: 1px solid var(--color-border); margin: 8px 4px; width: 100%; }
.side .foot { border-top: 1px solid var(--color-border); padding: 16px; font-size: 14px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.top { height: 52px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--color-border); background: rgba(255,255,255,.95); }
.top .crumb { font-size: 13px; color: var(--color-ink-muted); white-space: nowrap; overflow: hidden; }
.top .crumb b { color: var(--color-ink); font-weight: 500; }
.top .me { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--color-accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.ehead { padding: 12px 24px 0; display: flex; align-items: center; gap: 10px; }
h1.page { font: 400 22px/1.2 var(--font-serif); margin: 0; white-space: nowrap; }
h2.sec { font: 400 18px/1.3 var(--font-serif); margin: 0 0 10px; }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; box-shadow: 0 1px 2px rgba(31,27,22,.05); }
.muted { color: var(--color-ink-muted); }
.small { font-size: 12px; } .s13 { font-size: 13px; } .s14 { font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--color-surface-strong); white-space: nowrap; }
.badge.warn { background: #fffbeb; color: #b45309; }
.badge.danger { background: #fef2f2; color: #b91c1c; }
.badge.ok { background: color-mix(in srgb, var(--severity-mild) 14%, white); color: #3f5e3f; }
.badge.accent { background: rgba(184,90,63,.1); color: var(--color-accent-strong); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
.btn.sm { height: 34px; padding: 0 11px; border-radius: 6px; font-size: 13px; }
.btn.lg { height: 46px; padding: 0 16px; font-size: 15px; }
.btn.primary { background: var(--color-accent); color: #fff; }
.btn.secondary { background: var(--color-surface); border-color: var(--color-border); }
.btn.ghost { background: transparent; }
.btn.dangertxt { background: transparent; color: var(--color-danger-strong); }
.btn.on { background: var(--color-ink); color: var(--color-bg); border-color: var(--color-ink); }
.btn[disabled] { opacity: .45; }
.notice { display: flex; gap: 8px; align-items: flex-start; border: 1px solid; border-radius: 8px; padding: 9px 12px; font-size: 13px; line-height: 1.4; }
.notice.info { border-color: var(--color-border); background: var(--color-surface-strong); }
.notice.error { border-color: rgba(192,57,43,.4); background: color-mix(in srgb, var(--color-danger) 8%, white); color: var(--color-danger-strong); }
.notice.success { border-color: rgba(107,142,107,.4); background: color-mix(in srgb, var(--severity-mild) 10%, white); }
.notice.warn { border-color: rgba(184,138,63,.45); background: color-mix(in srgb, var(--severity-moderate) 10%, white); }
.notice svg { flex: none; margin-top: 1px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; min-width: 0; }
.field label { font-weight: 500; }
.inp { height: 36px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); padding: 0 10px; display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; overflow: hidden; }
.inp.area { height: auto; min-height: 72px; align-items: flex-start; padding: 8px 10px; white-space: normal; line-height: 1.45; font-size: 13px; }
.inp.focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(184,90,63,.18); }
.inp .caret { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip { height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-surface); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.chip.on { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-bg); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--color-border); padding: 0 16px; margin-top: 8px; }
.tabs a { padding: 10px 14px; font-size: 14px; color: var(--color-ink-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a.on { color: var(--color-accent-strong); border-color: var(--color-accent); font-weight: 500; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.sm { width: 15px; height: 15px; } .icon.lg { width: 22px; height: 22px; }
.mono { font-family: ui-monospace, 'DejaVu Sans Mono', monospace; font-size: 12px; }
.annot { background: #fff8e6; border: 1px dashed #c9a35a; color: #6b5323; border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.45; }
.annot b { color: #4a3916; }
/* editor */
.work { flex: 1; display: flex; gap: 12px; padding: 10px 16px 12px; min-height: 0; }
.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.toolbar { display: flex; align-items: center; gap: 6px; }
.toolbar .sep { width: 1px; height: 24px; background: var(--color-border); margin: 0 4px; }
.tbtn { height: 36px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--color-border); background: var(--color-surface); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.tbtn.on { background: var(--color-ink); color: var(--color-bg); border-color: var(--color-ink); }
.tbtn.ico { width: 36px; padding: 0; justify-content: center; }
.tbtn[disabled] { opacity: .4; }
.canvas { position: relative; flex: 1; min-height: 0; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.canvas svg.drawing { display: block; }
.hint { position: absolute; left: 12px; top: 12px; background: rgba(31,27,22,.88); color: #fbf9f5; border-radius: 8px; padding: 7px 11px; font-size: 13px; line-height: 1.35; max-width: 70%; }
.hint kbd, .kbd { font: 500 11px var(--font-sans); border: 1px solid rgba(255,255,255,.35); border-radius: 4px; padding: 0 4px; }
.zoombox { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 4px; align-items: center; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 8px; padding: 3px; font-size: 12px; }
.zoombox span.z { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; }
.toast { position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; background: var(--color-ink); color: var(--color-bg); border-radius: 10px; padding: 9px 12px; font-size: 13px; display: flex; gap: 12px; align-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.18); white-space: nowrap; }
.toast a { color: #f2c1ae; font-weight: 600; }
.toast.err { background: #7a2318; }
.panel { width: 320px; flex: none; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.pcard { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.phead { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.phead .r { margin-left: auto; font-weight: 400; }
.lrow { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 30px; }
.lrow .r { margin-left: auto; }
.sw { width: 18px; height: 18px; border-radius: 5px; flex: none; border: 1px solid rgba(0,0,0,.12); background-image: linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%),linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%); background-size: 8px 8px; background-position: 0 0,4px 4px; position: relative; overflow: hidden; }
.sw i { position: absolute; inset: 0; }
.sw.lg { width: 26px; height: 26px; border-radius: 7px; }
.slider { position: relative; height: 22px; display: flex; align-items: center; }
.slider .track { height: 6px; border-radius: 3px; background: var(--color-surface-strong); border: 1px solid var(--color-border); width: 100%; position: relative; }
.slider .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--color-accent); }
.slider .knob { position: absolute; top: 50%; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--color-accent); transform: translate(-50%,-50%); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.slider .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--color-danger); }
.seg { display: flex; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; font-size: 12px; }
.seg span { flex: 1; text-align: center; padding: 7px 4px; border-left: 1px solid var(--color-border); white-space: nowrap; }
.seg span:first-child { border-left: 0; }
.seg span.on { background: var(--color-ink); color: var(--color-bg); }
.thumb { width: 54px; height: 40px; border-radius: 6px; border: 1px solid var(--color-border); overflow: hidden; flex: none; background: #fff; }
.menu { position: absolute; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; box-shadow: 0 10px 28px rgba(31,27,22,.16); padding: 6px; font-size: 13px; z-index: 5; }
.menu div { padding: 8px 10px; border-radius: 6px; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.menu div.on { background: var(--color-surface-strong); }
.menu hr { border: 0; border-top: 1px solid var(--color-border); margin: 4px 0; }
.pop { position: absolute; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; box-shadow: 0 14px 34px rgba(31,27,22,.2); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; z-index: 6; }
.dialog-wrap { position: absolute; inset: 0; background: rgba(31,27,22,.42); display: grid; place-items: center; z-index: 8; }
.dialog { background: var(--color-surface); border-radius: 16px; padding: 20px 22px; box-shadow: 0 10px 30px rgba(0,0,0,.2); display: flex; flex-direction: column; gap: 12px; }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
table.t th, table.t td { border-bottom: 1px solid var(--color-border); padding: 6px 6px; text-align: left; vertical-align: middle; }
table.t th { font-size: 12px; font-weight: 600; color: var(--color-ink-muted); }
table.t .inp { height: 32px; font-size: 13px; }
.palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.palette span { height: 26px; border-radius: 6px; border: 1px solid rgba(0,0,0,.12); }
.palette span.on { outline: 2px solid var(--color-ink); outline-offset: 2px; }
.ph-top { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--color-border); background: var(--color-surface); flex: none; font-size: 14px; }
.ph-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--color-surface); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 24px rgba(31,27,22,.14); padding: 8px 14px 14px; display: flex; flex-direction: column; gap: 10px; z-index: 4; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--color-border); align-self: center; }
.ptools { display: flex; justify-content: space-around; border-top: 1px solid var(--color-border); background: var(--color-surface); padding: 6px 4px 10px; flex: none; }
.ptools span { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; min-width: 80px; padding: 0 6px; white-space: nowrap; min-height: 48px; justify-content: center; border-radius: 10px; color: var(--color-ink-muted); }
.ptools span.on { background: var(--color-ink); color: var(--color-bg); }
.callout { position: absolute; z-index: 7; }
.lead { position: absolute; border-top: 1.5px dashed #c9a35a; transform-origin: 0 0; z-index: 7; }
.vign { display: flex; flex-direction: column; gap: 8px; }
.vign > .lbl { font-size: 13px; font-weight: 600; }
/* complement */
mark { background: #fde7c7; color: inherit; border-radius: 3px; padding: 0 1px; }
.cb { width: 16px; height: 16px; border: 1.5px solid var(--color-ink-muted); border-radius: 4px; display: inline-grid; place-items: center; flex: none; background: #fff; }
.cb.on { background: var(--color-accent); border-color: var(--color-accent); }
.cb.on::after { content: ''; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.ring { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 6px; }
.tree .lrow { min-height: 26px; }
.count { font-size: 13px; color: var(--color-ink-muted); white-space: nowrap; }
.sbar { display: flex; align-items: center; gap: 8px; }
.fpanel { position: absolute; right: 0; top: 0; bottom: 0; background: var(--color-surface); border-left: 1px solid var(--color-border); box-shadow: -10px 0 30px rgba(31,27,22,.12); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
a.lnk { color: var(--color-accent-strong); text-decoration: underline; }
.tree .lrow { padding: 2px 0; }
</style>
</head>
<body>
<svg width="0" height="0" style="position:absolute">
<symbol id="i-dashboard" viewBox="0 0 24 24"><path d="M4 4h7v7H4zM13 4h7v4h-7zM13 11h7v9h-7zM4 14h7v6H4z"/></symbol>
<symbol id="i-users" viewBox="0 0 24 24"><path d="M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 21a7 7 0 0 1 14 0M16 3.5a4 4 0 0 1 0 7M22 21a7 7 0 0 0-4.5-6.5"/></symbol>
<symbol id="i-paw" viewBox="0 0 24 24"><path d="M5.5 12a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6zM9 8.4a1.9 1.9 0 1 0 0-3.8 1.9 1.9 0 0 0 0 3.8zM15 8.4a1.9 1.9 0 1 0 0-3.8 1.9 1.9 0 0 0 0 3.8zM18.5 12a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6zM12 11c-3 0-5.5 4.5-5.5 6.5 0 2 2 2.5 3 2.2 1-.3 1.6-.7 2.5-.7s1.5.4 2.5.7c1 .3 3-.2 3-2.2 0-2-2.5-6.5-5.5-6.5z"/></symbol>
<symbol id="i-user" viewBox="0 0 24 24"><path d="M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0"/></symbol>
<symbol id="i-tool" viewBox="0 0 24 24"><path d="M14 3l7 7-4 4-7-7zM10 10l-6 6 4 4 6-6M3 21l3-3"/></symbol>
<symbol id="i-check" viewBox="0 0 24 24"><path d="M5 12l5 5L20 7"/></symbol>
<symbol id="i-alert" viewBox="0 0 24 24"><path d="M12 9v4M12 17h.01M10.3 3.9L2.8 17a2 2 0 0 0 1.7 3h15a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/></symbol>
<symbol id="i-info" viewBox="0 0 24 24"><path d="M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 11v5M12 8h.01"/></symbol>
<symbol id="i-menu" viewBox="0 0 24 24"><path d="M4 7h16M4 12h16M4 17h16"/></symbol>
<symbol id="i-close" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6L6 18"/></symbol>
<symbol id="i-book" viewBox="0 0 24 24"><path d="M4 5a2 2 0 0 1 2-2h13v16H6a2 2 0 0 0-2 2zM4 21V5M8 7h7M8 11h5"/></symbol>
<symbol id="i-shield" viewBox="0 0 24 24"><path d="M12 3l8 3v6c0 4.5-3.4 8-8 9-4.6-1-8-4.5-8-9V6zM9 12l2 2 4-4"/></symbol>
<symbol id="i-search" viewBox="0 0 24 24"><path d="M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM20 20l-4-4"/></symbol>
<symbol id="i-cursor" viewBox="0 0 24 24"><path d="M5 3l14 7-6 2-2 6z"/></symbol>
<symbol id="i-point" viewBox="0 0 24 24"><path d="M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 2v3M12 19v3M2 12h3M19 12h3"/></symbol>
<symbol id="i-zone" viewBox="0 0 24 24"><path d="M5 7l7-4 7 5-2 10-9 2-3-6z"/></symbol>
<symbol id="i-crop" viewBox="0 0 24 24"><path d="M6 2v14a2 2 0 0 0 2 2h14M2 6h14a2 2 0 0 1 2 2v14"/></symbol>
<symbol id="i-hand" viewBox="0 0 24 24"><path d="M8 13V5.5a1.5 1.5 0 0 1 3 0V12M11 11V4a1.5 1.5 0 0 1 3 0v7M14 11V5.5a1.5 1.5 0 0 1 3 0V13M17 9.5a1.5 1.5 0 0 1 3 0V15a7 7 0 0 1-7 7h-1a7 7 0 0 1-5.5-2.7L3.6 15.5a1.6 1.6 0 0 1 2.5-2L8 15.5"/></symbol>
<symbol id="i-undo" viewBox="0 0 24 24"><path d="M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3"/></symbol>
<symbol id="i-redo" viewBox="0 0 24 24"><path d="M15 14l5-5-5-5M20 9H10a6 6 0 0 0 0 12h3"/></symbol>
<symbol id="i-plus" viewBox="0 0 24 24"><path d="M12 5v14M5 12h14"/></symbol>
<symbol id="i-minus" viewBox="0 0 24 24"><path d="M5 12h14"/></symbol>
<symbol id="i-trash" viewBox="0 0 24 24"><path d="M4 7h16M10 11v6M14 11v6M5 7l1 13h12l1-13M9 7V4h6v3"/></symbol>
<symbol id="i-lock" viewBox="0 0 24 24"><path d="M6 11h12v10H6zM8 11V7a4 4 0 0 1 8 0v4"/></symbol>
<symbol id="i-eye" viewBox="0 0 24 24"><path d="M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/></symbol>
<symbol id="i-chevron" viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></symbol>
<symbol id="i-down" viewBox="0 0 24 24"><path d="M6 9l6 6 6-6"/></symbol>
<symbol id="i-up" viewBox="0 0 24 24"><path d="M6 15l6-6 6 6"/></symbol>
<symbol id="i-move" viewBox="0 0 24 24"><path d="M12 2v20M2 12h20M12 2l-3 3M12 2l3 3M12 22l-3-3M12 22l3-3M2 12l3-3M2 12l3 3M22 12l-3-3M22 12l-3 3"/></symbol>
<symbol id="i-pen" viewBox="0 0 24 24"><path d="M4 20l4-1 11-11-3-3L5 16zM14 6l3 3"/></symbol>
<symbol id="i-image" viewBox="0 0 24 24"><path d="M4 4h16v16H4zM4 16l5-5 4 4 3-3 4 4M15 9h.01"/></symbol>
<symbol id="i-gear" viewBox="0 0 24 24"><path d="M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-2.9 1.2V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-2.9-1.2l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1A1.7 1.7 0 0 0 3 15H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.2-2.9l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1A1.7 1.7 0 0 0 9 4.6V4a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 2.9 1.2l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1A1.7 1.7 0 0 0 20.9 11H21a2 2 0 1 1 0 4z"/></symbol>
<symbol id="i-dots" viewBox="0 0 24 24"><path d="M12 6h.01M12 12h.01M12 18h.01"/></symbol>
<symbol id="i-grip" viewBox="0 0 24 24"><path d="M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01"/></symbol>
<symbol id="i-clock" viewBox="0 0 24 24"><path d="M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2"/></symbol>
<symbol id="i-spin" viewBox="0 0 24 24"><path d="M12 3a9 9 0 1 0 9 9"/></symbol>
<symbol id="i-cloud-off" viewBox="0 0 24 24"><path d="M3 3l18 18M8 8a5 5 0 0 0-3 9h11M18 17a4 4 0 0 0-1.5-7.7A6 6 0 0 0 10.6 5"/></symbol>
<symbol id="i-layers" viewBox="0 0 24 24"><path d="M12 3l9 5-9 5-9-5zM3 13l9 5 9-5"/></symbol>
<symbol id="i-fit" viewBox="0 0 24 24"><path d="M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5"/></symbol>
<symbol id="i-spine" viewBox="0 0 24 24"><path d="M6 5h12M7 9h10M6 13h12M7 17h10M12 3v18"/></symbol>
<symbol id="i-file" viewBox="0 0 24 24"><path d="M6 3h8l4 4v14H6zM14 3v4h4"/></symbol>
<symbol id="i-copy" viewBox="0 0 24 24"><path d="M9 9h11v11H9zM5 15H4V4h11v1"/></symbol>
</svg>
<script src="data.js"></script>
<script>
/* ---------- data: window.DOC (data.js, generated by gen-data.cjs from the equine draft document.json) ---------- */
const HORSE = '../../../supabase/seed/anatomical-sheets/equine/draft/assets/horse.svg'
const LOGO = '../../../apps/app/public/logo-horizontal.svg'
const W = 2073.4, H = 1629.4
// Categories as the validated v1-2-6 boards draw them (U6 model); colours from the draft.
const CATS = {
os: { fr: 'Os', en: 'Bones', c: '#a41e65', o: .35, fixed: true },
art: { fr: 'Articulations', en: 'Joints', c: '#ff9500', o: .35, fixed: true },
vert: { fr: 'Vertèbres', en: 'Vertebrae', c: '#e100ff', o: .30, fixed: true },
charn: { fr: 'Charnières vertébrales', en: 'Vertebral junctions', c: '#ff0000', o: .35 },
crane: { fr: 'Os du crâne', en: 'Cranial bones', c: '#1baa08', o: .35 },
}
const CAT_KEY = { articulations: 'art', os: 'os', 'charnieres-vertebrales': 'charn', 'zone-colonne': 'vert', 'cadrans-du-crane': 'crane' }
const DOC = window.DOC
const viewName = (id) => DOC.views.find((v) => v.id === id).fr
const DETAIL = DOC.views.find((v) => v.parent).id
const ANN = DOC.annotations
const nameOf = (a) => a.fr || `Accès : ${viewName(DETAIL)}`
const A = ANN.map((a) => [a.view, a.kind === 'detail_trigger' ? 'link' : CAT_KEY[a.cat], nameOf(a), a.g])
const catOf = (a) => a[1] === 'link' ? 'art' : a[1]
const pts = (p) => p.map((q) => q.join(',')).join(' ')
const annById = Object.fromEntries(ANN.map((a) => [a.id, a]))
const zoneById = Object.fromEntries(DOC.zones.map((z) => [z.id, z]))
const annOfZone = (zid) => ANN.filter((a) => a.zone === zid)
const walk = (ns, acc = []) => { for (const n of ns) { acc.push(n); walk(n.children, acc) } return acc }
const famCount = (f) => walk(f.children).length
const zoneCount = (z) => z.families.reduce((s, f) => s + famCount(f), 0)
const ALL_FINDINGS = DOC.zones.reduce((s, z) => s + zoneCount(z), 0)
const fold = (s) => s.normalize('NFD').replace(/\p{Diacritic}/gu, '').toLowerCase()
// French plural as the editor's mechanism (C36): 0 and 1 take the singular.
const pl = (n, one, many) => `${n.toLocaleString('fr-FR')} ${n <= 1 ? one : many}`
const ST = { to_confirm: ['warn', 'À confirmer'], reviewed: ['ok', 'Relu'], inherited: ['', 'Hérité, non relu'] }
const status = (s) => `<span class="badge ${ST[s][0]}">${ST[s][1]}</span>`
const hl = (text, q) => {
if (!q) return text
const i = fold(text).indexOf(fold(q))
return i < 0 ? text : `<span>${text.slice(0, i)}<mark>${text.slice(i, i + q.length)}</mark>${text.slice(i + q.length)}</span>`
}
// Findings whose name contains q (folded), restricted to zoneIds when given; each with its ancestors.
function matches(q, zoneIds) {
const out = []
for (const z of DOC.zones) {
if (zoneIds && !zoneIds.includes(z.id)) continue
for (const f of z.families) {
const rec = (ns, path) => { for (const n of ns) { if (!q || fold(n.fr).includes(fold(q))) out.push({ z, f, path, n }); rec(n.children, [...path, n]) } }
rec(f.children, [])
}
}
return out
}
const zonesOf = (ms) => [...new Set(ms.map((m) => m.z.id))]
const STIFLE = annById.stifle, HOCK = annById.hock
const Z_STIFLE = zoneById[STIFLE.zone]
const short = (s) => s.replace(/\s*\(.*\)$/, '')
</script>
<script>
/* ---------- drawing ---------- */
// opts: vb [x,y,w,h], w px, view, sel (name), hide [names], extra(u) markup, cats override, dim
function drawing(o) {
const vb = o.vb || [0, 0, W, H]
const w = o.w, h = o.h || Math.round(w * vb[3] / vb[2])
const u = vb[2] / w * (o.fitH ? (w * vb[3] / vb[2]) / h : 1)
const uu = Math.max(vb[2] / w, vb[3] / h)
const cats = o.cats || CATS
let s = `<svg class="drawing" width="${w}" height="${h}" viewBox="${vb.join(' ')}" preserveAspectRatio="xMidYMid meet"><image href="${HORSE}" x="0" y="0" width="${W}" height="${H}"${o.dim ? ' opacity=".45"' : ''}/>`
if (!o.noAnn) for (const [view, cat, name, g] of A) {
if (view !== (o.view || 'main') || (o.hide || []).includes(name)) continue
if (cat === 'link') {
if (o.links === false) continue
s += `<polygon points="${pts(g[1])}" fill="rgba(31,27,22,.05)" stroke="#1f1b16" stroke-width="${2 * uu}" stroke-dasharray="${8 * uu} ${5 * uu}"/>`
continue
}
const k = cats[cat], fo = o.faint ? k.o * .45 : k.o, so = o.faint ? .5 : 1
const st = `fill="${k.c}" fill-opacity="${fo}" stroke="${k.c}" stroke-opacity="${so}" stroke-width="${2 * uu}"`
s += g[0] === 'c' ? `<circle cx="${g[1]}" cy="${g[2]}" r="${g[3]}" ${st}/>` : `<polygon points="${pts(g[1])}" ${st}/>`
}
if (o.extra) s += o.extra(uu)
return s + '</svg>'
}
// vertex handle, midpoint plus, minus bubble, selection outline; u = user units per screen px
const V = (x, y, u, on, big) => `<circle cx="${x}" cy="${y}" r="${(big ? 9 : 6) * u}" fill="${on ? '#b85a3f' : '#fff'}" stroke="#1f1b16" stroke-width="${2 * u}"/>`
const HIT = (x, y, u) => `<circle cx="${x}" cy="${y}" r="${22 * u}" fill="rgba(184,90,63,.10)" stroke="#b85a3f" stroke-width="${1 * u}" stroke-dasharray="${3 * u} ${3 * u}"/>`
const PLUS = (x, y, u, big) => { const r = (big ? 12 : 8) * u, l = r * .55; return `<g><circle cx="${x}" cy="${y}" r="${r}" fill="#fff" stroke="#b85a3f" stroke-width="${1.6 * u}"/><path d="M${x - l} ${y}h${2 * l}M${x} ${y - l}v${2 * l}" stroke="#b85a3f" stroke-width="${2 * u}" stroke-linecap="round"/></g>` }
const MINUS = (x, y, u, big, off) => { const bw = (big ? 44 : 30) * u, bh = (big ? 36 : 26) * u, yy = y - (big ? 30 : 22) * u - bh; const c = off ? '#b9b0a3' : '#c0392b'; return `<g><rect x="${x - bw / 2}" y="${yy}" width="${bw}" height="${bh}" rx="${8 * u}" fill="${c}"/><path d="M${x - 5 * u} ${yy + bh}l${5 * u} ${6 * u}l${5 * u} ${-6 * u}z" fill="${c}"/><path d="M${x - bw * .22} ${yy + bh / 2}h${bw * .44}" stroke="#fff" stroke-width="${2.6 * u}" stroke-linecap="round"/></g>` }
const SEL = (p, u) => `<polygon points="${pts(p)}" fill="none" stroke="#1f1b16" stroke-width="${2 * u}"/>`
const mids = (p) => p.map((q, i) => { const n = p[(i + 1) % p.length]; return [(q[0] + n[0]) / 2, (q[1] + n[1]) / 2] })
function polyEdit(p, u, o = {}) {
let s = SEL(p, u)
if (!o.noPlus) s += mids(p).filter((m, i) => { const n = p[(i + 1) % p.length]; return !o.minSeg || Math.hypot(n[0] - p[i][0], n[1] - p[i][1]) / u >= o.minSeg }).map(m => PLUS(m[0], m[1], u, o.big)).join('')
s += p.map((q, i) => V(q[0], q[1], u, i === o.on, o.big)).join('')
if (o.on != null && o.minus !== false) s += MINUS(p[o.on][0], p[o.on][1], u, o.big, o.minusOff)
return s
}
/* ---------- shell ---------- */
const NAV = [['dashboard','Tableau de bord'],['users','Clients'],['paw','Animaux'],['book','Fiches anatomiques'],['HR'],['shield','Administration','on'],['HR'],['user','Mon compte'],['tool','Outil de bilan']]
const ico = (n, c = '') => `<svg class="icon ${c}"><use href="#i-${n}"/></svg>`
const side = () => `<aside class="side"><div class="logo"><img src="${LOGO}" alt="Faunosteo"></div><nav class="nav">${NAV.map(([i, l, on]) => i === 'HR' ? '<hr>' : `<a class="${on || ''}">${ico(i)}${l}</a>`).join('')}</nav><div class="foot muted">Se déconnecter</div></aside>`
const TABS = ['Général', 'Annotations', 'Constats', 'Vérification']
// Undo / redo: global commands of the editor header, at the right of the tab bar, the same on every tab.
const hist = (o = {}) => { const h = o.big ? 'height:44px;' : ''; const c = o.big ? 'btn secondary' : 'btn secondary sm'
return `<span style="margin-left:auto;align-self:center;display:flex;gap:6px;padding-bottom:4px"><span class="${c}" style="${h}" title="Annuler (Ctrl+Z)">${ico('undo', 'sm')}Annuler</span><span class="${c}" style="${h}" title="Rétablir (Ctrl+Maj+Z)"${o.redo ? '' : ' disabled'}>${ico('redo', 'sm')}Rétablir</span></span>` }
function tabs(on, errs = '2 erreurs', o = {}) {
return '<div class="tabs">' + TABS.map(t => `<a class="${t === on ? 'on' : ''}">${t}${t === 'Vérification' && errs ? ` <span class="badge danger">${errs}</span>` : ''}</a>`).join('') + hist(o) + '</div>'
}
function save(state) {
return ({
dirty: `<span class="s13 muted" style="white-space:nowrap">3 modifications non enregistrées</span><span class="btn primary sm">Enregistrer</span>`,
saving: `<span class="s13 muted" style="display:flex;gap:6px;align-items:center">${ico('spin', 'sm')}Enregistrement…</span><span class="btn primary sm" disabled>Enregistrer</span>`,
saved: `<span class="s13" style="display:flex;gap:6px;align-items:center;color:#3f5e3f">${ico('check', 'sm')}Enregistré à 14:32 · révision 11</span><span class="btn primary sm" disabled>Enregistrer</span>`,
})[state]
}
function header(o = {}) {
return `<div class="ehead" style="flex-wrap:wrap"><h1 class="page">${o.title || 'Brouillon, version 4'}</h1><span class="badge">Brouillon</span><span class="badge">Copie de travail</span>${o.badges || ''}
<span style="margin-left:auto;display:flex;gap:8px;align-items:center"><span class="btn secondary sm">${ico('book', 'sm')}Références</span><span class="btn secondary sm">${ico('eye', 'sm')}Prévisualiser</span><span style="width:1px;height:24px;background:var(--color-border)"></span>${o.right || save(o.save || 'dirty')}</span></div>`
}
function editor(o) {
return `<div class="frame desk">${side()}<div class="main">
<div class="top"><span class="crumb">Administration › Fiches officielles › Cheval, squelette et rachis › <b>Brouillon, version 4</b></span><span class="me"><span class="avatar">BC</span>Bastien Chanot</span></div>
${header(o)}${tabs(o.tab || 'Annotations', o.errs)}
<div class="work">${o.body}</div>${o.overlay || ''}</div></div>`
}
function toolbar(on, o = {}) {
const t = (k, i, l, key) => `<span class="tbtn ${on === k ? 'on' : ''}" title="${key}">${ico(i, 'sm')}${l}</span>`
return `<div class="toolbar">${t('sel', 'cursor', 'Sélectionner', 'V')}${t('point', 'point', 'Ajouter un point', 'P')}${t('zone', 'zone', 'Ajouter une zone', 'Z')}${t('crop', 'crop', 'Créer une vue détaillée', 'D')}
</div>`
}
const bigPills = (z) => `${vchip()}<div class="zoombox" style="padding:4px"><span class="z" style="width:44px;height:44px">${ico('minus')}</span><span style="min-width:48px;text-align:center">${z}</span><span class="z" style="width:44px;height:44px">${ico('plus')}</span><span class="z" style="width:44px;height:44px">${ico('fit')}</span></div>`
const vchip = (v = 'Vue latérale gauche') => `<span class="chip" style="position:absolute;right:10px;top:10px;background:rgba(255,255,255,.95)">${ico('layers', 'sm')}${v}</span>`
const zoom = (z = '100 %') => `${vchip()}<div class="zoombox"><span class="z">${ico('minus', 'sm')}</span><span style="min-width:42px;text-align:center">${z}</span><span class="z">${ico('plus', 'sm')}</span><span class="z" title="Ajuster">${ico('fit', 'sm')}</span></div>`
const sw = (c, o, cls = '') => `<span class="sw ${cls}"><i style="background:${c};opacity:${o}"></i></span>`
const catSel = (k) => `<span class="inp">${sw(CATS[k].c, CATS[k].o)}${CATS[k].fr}<span class="caret">${ico('down', 'sm')}</span></span>`
function slider(pct, o = {}) {
return `<div class="slider"><div class="track"><div class="fill" style="width:${pct}%"></div>${o.mark != null ? `<div class="mark" style="left:${o.mark}%" title="minimum"></div>` : ''}<div class="knob" style="left:${pct}%"></div></div></div>`
}
const keys = `<div class="s13 muted">Clavier : Tab = sommet ou poignée suivante · flèches = déplacer (Maj : par 10) · Inser = sommet après · Suppr = retirer · Entrée = valider · Échap = annuler · Ctrl+Z / Ctrl+Maj+Z</div>`
function catList(o = {}) {
return Object.entries(CATS).map(([k, c]) => `<div class="lrow">${sw(c.c, c.o)}<span>${c.fr}</span>${c.fixed ? `<span class="badge" title="Catégorie fixe">${ico('lock', 'sm')}Fixe</span>` : ''}<span class="r muted">${countCat(k)}</span></div>`).join('')
}
/* ---------- complement helpers ---------- */
// U1 save line: « Abandonner les modifications » beside « Enregistrer » in edit mode (U1 contract clarification).
function save() {
return `<span class="s13 muted" style="white-space:nowrap">3 modifications non enregistrées</span><span class="btn secondary sm">Abandonner les modifications</span><span class="btn primary sm">Enregistrer</span>`
}
// U1 header (plan 2026-11-06): no « Prévisualiser » (V1-2.7), « Abandonner les modifications » beside the save line.
function header(o = {}) {
return `<div class="ehead"><h1 class="page">${o.title || 'Brouillon, version 4'}</h1><span class="badge">Brouillon</span><span class="badge">Copie de travail</span>${o.badges || ''}
<span style="margin-left:auto;display:flex;gap:8px;align-items:center"><span class="btn secondary sm">${ico('book', 'sm')}Références</span><span style="width:1px;height:24px;background:var(--color-border)"></span>${o.right || save(o.save || 'dirty')}</span></div>`
}
// Selection outline (drawing selection) and filter mark (accent outline + check disc).
function ring(a, u, o = {}) {
const g = a.g, c = o.color || '#1f1b16', sw = (o.w || 2) * u, d = o.dash ? ` stroke-dasharray="${6 * u} ${4 * u}"` : ''
return g[0] === 'c'
? `<circle cx="${g[1]}" cy="${g[2]}" r="${g[3] + 6 * u}" fill="none" stroke="${c}" stroke-width="${sw}"${d}/>`
: `<polygon points="${pts(g[1])}" fill="none" stroke="${c}" stroke-width="${sw}"${d}/>`
}
function topRight(a) {
if (a.g[0] === 'c') return [a.g[1] + a.g[3] * .75, a.g[2] - a.g[3] * .75]
const p = a.g[1]
return [Math.max(...p.map((q) => q[0])), Math.min(...p.map((q) => q[1]))]
}
function check(a, u) {
const [x, y] = topRight(a)
return `<g><circle cx="${x}" cy="${y}" r="${11 * u}" fill="#b85a3f" stroke="#fff" stroke-width="${2 * u}"/><path d="M${x - 5 * u} ${y}l${3.5 * u} ${3.5 * u}l${6 * u} ${-7 * u}" stroke="#fff" stroke-width="${2.4 * u}" fill="none" stroke-linecap="round" stroke-linejoin="round"/></g>`
}
const picked = (list, u) => list.map((a) => ring(a, u, { color: '#b85a3f', w: 3 }) + check(a, u)).join('')
// One family of a zone: header with its count, first-level findings, the first one opened.
function familyRows(f, o = {}) {
const head = `<div class="lrow" style="font-weight:600">${ico(o.open ? 'down' : 'chevron', 'sm')}${f.fr}<span class="r muted" style="font-weight:400">${famCount(f)}</span></div>`
if (!o.open) return head
return head + f.children.map((n, i) => {
const top = `<div class="lrow" style="padding-left:22px${o.sel === n.id ? ';background:var(--color-surface-strong);border-radius:8px' : ''}">${n.children.length ? ico(i === 0 && o.deep ? 'down' : 'chevron', 'sm') : '<span style="width:15px"></span>'}${n.fr}<span class="r muted">${n.children.length || ''}</span></div>`
if (!(i === 0 && o.deep)) return top
return top + n.children.slice(0, o.deep).map((c) => `<div class="lrow" style="padding-left:46px">${c.fr}<span class="r">${status(c.status)}</span></div>`).join('')
+ (n.children.length > o.deep ? `<div class="lrow small muted" style="padding-left:46px;min-height:20px">${pl(n.children.length - o.deep, 'autre constat', 'autres constats')}</div>` : '')
}).join('')
}
function zoneLine(a, o = {}) {
const z = zoneById[a.zone]
const others = annOfZone(a.zone).filter((x) => x.id !== a.id)
const also = o.also || (others.length ? `Aussi sur le schéma : ${others.map(nameOf).join(', ')}` : 'Seule annotation du schéma reliée à cette zone.')
return `<div class="field"><label>Zone de constats</label><div class="lrow" style="align-items:flex-start;gap:6px"><b style="font-weight:500">${z.fr}</b>${o.ro ? '' : '<span class="r"><a class="lnk">Changer</a></span>'}</div><div class="small muted">${also}</div></div>`
}
function selHead(a, o = {}) {
const z = zoneById[a.zone]
return `<div class="phead">${ico(a.kind === 'zone' ? 'zone' : 'point', 'sm')}${a.kind === 'zone' ? 'Zone' : 'Point'} · ${short(nameOf(a))}${o.badge || ''}</div>
<div class="seg"><span>Propriétés</span><span class="on">Constats · ${zoneCount(z)}</span></div>`
}
// Side column « Constats » of a selected annotation.
function constatsPanel(a, o = {}) {
const z = zoneById[a.zone]
const actions = o.ro
? `<span class="btn secondary sm">Ouvrir dans Constats</span>`
: `<span class="btn secondary sm">${ico('plus', 'sm')}Ajouter un constat</span><span class="btn secondary sm">Ouvrir dans Constats</span>`
return `<div class="panel" style="width:${o.w || 340}px">
<div class="pcard">${selHead(a, o)}${zoneLine(a, o)}</div>
<div class="pcard tree" style="flex:1;min-height:0;overflow:hidden">
${z.families.map((f, i) => familyRows(f, { open: i === 0 && !o.closed, deep: o.deep || 2, sel: o.sel })).join('')}</div>
<div class="pcard" style="flex-direction:row;gap:8px;flex-wrap:wrap">${actions}</div></div>`
}
const stage = (extra, o = {}) => `<div class="stage">${toolbar('sel')}
<div class="canvas">${drawing({ w: o.w || 660, h: o.h || 540, extra })}${zoom('Ajusté')}</div></div>`
const note = (html, style = '') => `<div class="annot" style="${style}">${html}</div>`
const vframe = (w, h, inner) => `<div class="frame" style="width:${w}px;height:${h}px;display:flex;flex-direction:column;gap:8px;padding:12px">${inner}</div>`
</script>
<!-- ================================================================== 17 drawing → findings -->
<div class="row"><div data-board="17-dessin-constats-selection">
<p class="sheet-title">17. Depuis le dessin : le point sélectionné montre les constats de sa zone, par famille (onglet Annotations, 1 280 px)</p>
<div id="b17"></div></div></div>
<script>
document.getElementById('b17').innerHTML = editor({ body: stage((u) => ring(STIFLE, u)) + constatsPanel(STIFLE) })
+ `<div style="display:flex;gap:12px;margin-top:10px;width:1280px">${note(`<b>Règle :</b> les constats appartiennent à la zone de constats « ${short(Z_STIFLE.fr)} » ; le point y renvoie par son champ « Zone de constats » (déjà dans la fiche). Le volet ne crée aucune association nouvelle. Les ${Z_STIFLE.families.length} familles du modèle (${Z_STIFLE.families.map((f) => f.fr).join(', ')}) gardent leur ordre. Le compteur « Constats · ${zoneCount(Z_STIFLE)} » compte chaque constat une fois, à toute profondeur ; les ${Z_STIFLE.families.length} familles ne comptent pas, les groupes oui (« ${Z_STIFLE.families[0].fr} ${famCount(Z_STIFLE.families[0])} » = ${Z_STIFLE.families[0].children.length} groupes + ${famCount(Z_STIFLE.families[0]) - Z_STIFLE.families[0].children.length} constats ; décision F2 de l'étude).`, 'flex:1')}${note(`<b>Latéralité :</b> le point est « bilatéral » ; le côté se choisit dans le bilan, pas dans la fiche : les constats ne portent pas de côté.<br><b>Propriétés</b> reste le volet de la planche 03 ; « Constats » s'ajoute à côté.`, 'flex:1')}</div>`
</script>
<!-- ================================================================== 18 add and edit from the selection -->
<div class="row"><div data-board="18-dessin-ajouter-modifier">
<p class="sheet-title">18. Depuis la sélection : ajouter un constat dans la zone, modifier un constat existant (mêmes champs que l'onglet Constats)</p>
<div id="b18" style="display:flex;gap:20px"></div></div></div>
<script>
{
const dys = Z_STIFLE.families[0], first = dys.children[0], leaf = first.children[0]
const add = `<div class="vign"><div class="lbl">A. Ajouter un constat</div>${vframe(420, 740, `<div class="pcard">${selHead(STIFLE)}</div>
<div class="pcard"><div class="phead">${ico('plus', 'sm')}Nouveau constat · ${short(Z_STIFLE.fr)}</div>
<div class="field"><label>Famille</label><span class="inp">${dys.fr}<span class="caret">${ico('down', 'sm')}</span></span></div>
<div class="field"><label>Placer sous</label><span class="inp">${first.fr}<span class="caret">${ico('down', 'sm')}</span></span><span class="small muted">Première option de la liste : « Directement dans la famille »</span></div>
<div class="grid2"><div class="field"><label>Nom (FR)</label><span class="inp focus">Restriction en abduction</span></div><div class="field"><label>Nom (EN)</label><span class="inp">Abduction restriction</span></div></div>
<div style="display:flex;gap:8px"><span class="btn primary sm">Ajouter</span><span class="btn secondary sm">Abandonner</span></div></div>
${note('Zone : celle du point, sans choix possible ici. Famille : une des familles de la zone. « Ajouter » crée le constat en une modification ; « Annuler la dernière modification » la retire. « Abandonner » referme le formulaire sans rien créer (T15). Le nom saisi ici est un exemple de saisie.')}`)}</div>`
const edit = `<div class="vign"><div class="lbl">B. Modifier un constat existant</div>${vframe(420, 740, `<div class="pcard">${selHead(STIFLE)}</div>
<div class="pcard"><div class="lrow small"><a class="lnk"><span style="display:inline-block;transform:rotate(180deg)">${ico('chevron', 'sm')}</span>Retour aux constats du ${short(Z_STIFLE.fr).toLowerCase()}</a></div>
<div class="small muted">${dys.fr} › ${first.fr}</div>
<div class="phead" style="font-size:15px">${leaf.fr}<span class="r">${status(leaf.status)}</span></div>
<div class="grid2"><div class="field"><label>Nom (FR)</label><span class="inp">${leaf.fr}</span></div><div class="field"><label>Nom (EN)</label><span class="inp">${leaf.en}</span></div></div>
<div class="field"><label>Description (FR)</label><span class="inp area muted">Aucune description</span></div>
<div class="field"><label>Orientation vétérinaire</label><div class="seg" style="width:160px"><span class="on">Non</span><span>Oui</span></div></div>
<div class="field"><label>Références citées</label><div class="lrow"><span class="muted">${pl(leaf.refs, 'référence', 'références')}</span><span class="r"><a class="lnk">Ajouter une référence</a></span></div></div>
<div style="display:flex;gap:8px;flex-wrap:wrap"><span class="btn secondary sm">Marquer comme relu</span><span class="btn secondary sm">Ouvrir dans Constats</span><span class="btn dangertxt sm">${ico('trash', 'sm')}Supprimer</span></div></div>
${note('Mêmes champs, mêmes contrôles et même enregistrement que le détail de l\'onglet Constats (C9) : un composant partagé, pas une seconde règle. « Ouvrir dans Constats » montre le constat dans son arbre.')}`)}</div>`
document.getElementById('b18').innerHTML = add + edit
}
</script>
<!-- ================================================================== 19 association -->
<div class="row"><div data-board="19-association-anatomique">
<p class="sheet-title">19. Gérer l'association anatomique : changer de zone, annotation sans zone, accès à une vue détaillée, zone montrée par deux annotations</p>
<div id="b19" style="display:grid;grid-template-columns:repeat(2,560px);gap:20px"></div></div></div>
<script>
{
const options = [Z_STIFLE, ...DOC.zones.filter((z) => z.id !== STIFLE.zone).slice(0, 5)].map((z) => `<div class="${z.id === STIFLE.zone ? 'on' : ''}">${z.id === STIFLE.zone ? ico('check', 'sm') : '<span style="width:15px"></span>'}<span>${z.fr}${z.id === STIFLE.zone ? '<br><span class="badge">zone actuelle</span>' : ''}</span><span class="r muted" style="margin-left:auto;padding-left:10px">${pl(annOfZone(z.id).length, 'annotation', 'annotations')}</span></div>`).join('')
const change = `<div class="vign"><div class="lbl">A. Changer la zone de constats</div>${vframe(560, 560, `<div class="pcard" style="position:relative">${selHead(STIFLE)}
<div class="field"><label>Zone de constats</label><span class="inp focus">${ico('search', 'sm')}<span class="muted">Rechercher une zone (${DOC.zones.length})</span></span></div>
<div class="menu" style="position:static;box-shadow:none">${options}<hr><div class="muted">${pl(DOC.zones.length - 6, 'autre zone', 'autres zones')}…</div></div></div>
<div class="notice info">${ico('info', 'sm')}<div>Changer la zone ne déplace aucun constat : le point montre ensuite ceux de la nouvelle zone. Une modification, annulable. Si la zone choisie est déjà montrée par une autre annotation, le volet le dit avant de valider.</div></div>`)}</div>`
const none = `<div class="vign"><div class="lbl">B. Annotation sans zone de constats (zone retirée du point)</div>${vframe(560, 560, `<div class="pcard"><div class="phead">${ico('point', 'sm')}Point · ${short(nameOf(HOCK))}</div><div class="seg"><span>Propriétés</span><span class="on">Constats</span></div>
<div class="notice info">${ico('info', 'sm')}<div>Ce point n'est relié à aucune zone de constats (champ vidé) : il n'en montre aucun. La vérification le signale par un avertissement.</div></div>
<div class="field"><label>Relier à une zone existante</label><span class="inp">${ico('search', 'sm')}<span class="muted">Rechercher une zone</span><span class="caret">${ico('down', 'sm')}</span></span></div>
<div class="lrow"><span class="btn secondary sm">${ico('plus', 'sm')}Créer une zone pour ce point</span></div></div>
${note('Le cœur l\'autorise : le champ est facultatif, la vérification affiche l\'avertissement « annotation.no_findings » (validate.rs:367-386). Le brouillon équin n\'en a aucune. « Créer une zone pour ce point » crée la zone (nom du point proposé, modifiable) et la relie au point en un seul lot : une entrée d\'historique, tout ou rien (décision F8 de l\'étude).')}`)}</div>`
const trig = ANN.find((a) => a.kind === 'detail_trigger')
const access = `<div class="vign"><div class="lbl">C. Accès à une vue détaillée</div>${vframe(560, 300, `<div class="pcard"><div class="phead">${ico('crop', 'sm')}${nameOf(trig)}</div><div class="seg"><span class="on">Propriétés</span><span style="opacity:.45">Constats</span></div>
<div class="small muted">Un accès ouvre la vue « ${viewName(DETAIL)} » : il ne représente pas une région, il n'a pas de zone de constats (champ vide dans la fiche). L'onglet « Constats » du volet est grisé avec cette raison.</div></div>`)}</div>`
const dup = `<div class="vign"><div class="lbl">D. Zone montrée par deux annotations (cas illustratif)</div>${vframe(560, 360, `<div class="pcard">${selHead(STIFLE)}${zoneLine(STIFLE, { also: 'Aussi sur le schéma : Grasset, vue « Membre postérieur » (<a class="lnk">la sélectionner</a>)' })}</div>
<div class="lrow s13" style="gap:14px"><svg width="70" height="34" viewBox="0 0 70 34"><circle cx="17" cy="17" r="11" fill="none" stroke="#b85a3f" stroke-width="3"/><circle cx="27" cy="7" r="6" fill="#b85a3f"/><circle cx="55" cy="17" r="11" fill="none" stroke="#b85a3f" stroke-width="2" stroke-dasharray="4 3"/></svg><span>Dans « Filtrer sur le schéma » : l'annotation cliquée est cochée, l'autre annotation de la même zone est cernée en pointillé ; la zone compte une fois.</span></div>
${note(`Le brouillon équin n'a aucune zone montrée par deux annotations (${DOC.zones.filter((z) => annOfZone(z.id).length > 1).length} sur ${DOC.zones.length}) ; la vue « Membre postérieur » est inventée pour l'exemple. Règle : les constats sont ceux de la zone, comptés et listés une fois (dédoublonnage par zone ; le bilan, lui, sépare aussi par côté) ; dans « Filtrer sur le schéma », sélectionner l'une des deux annotations retient la zone une fois et marque l'autre en pointillé.`)}`)}</div>`
document.getElementById('b19').innerHTML = change + none + access + dup
}
</script>
<!-- ================================================================== 20 findings tab: search -->
<div class="row"><div data-board="20-constats-recherche">
<p class="sheet-title">20. Onglet Constats : recherche instantanée, compteur de résultats, « Filtrer sur le schéma », réinitialisation ; chaque zone renvoie au dessin</p>
<div id="b20"></div></div></div>
<script>
{
const Q = 'restriction'
const ms = matches(Q), zs = zonesOf(ms)
const sel = Z_STIFLE.families[0].children[0].children[0]
function zoneTree(z, q) {
const own = matches(q, [z.id])
const keep = new Set(), hit = new Set(own.map((m) => m.n.id))
own.forEach((m) => { m.path.forEach((p) => keep.add(p.id)); keep.add(m.n.id) })
let s = ''
for (const f of z.families) {
const inF = own.filter((m) => m.f === f)
if (!inF.length) continue
s += `<div class="lrow" style="padding-left:22px;font-weight:600">${ico('down', 'sm')}${f.fr}<span class="r muted" style="font-weight:400">${inF.length}</span></div>`
const rec = (ns, d) => { for (const n of ns) { if (!keep.has(n.id)) continue; s += `<div class="lrow" style="padding-left:${22 + d * 22}px${n.id === sel.id ? ';background:var(--color-surface-strong);border-radius:8px' : ''}">${n.children.some((c) => keep.has(c.id)) ? ico('down', 'sm') : '<span style="width:15px"></span>'}<span class="${hit.has(n.id) ? '' : 'muted'}">${hit.has(n.id) ? hl(n.fr, q) : n.fr}</span></div>`; rec(n.children, d + 1) } }
rec(f.children, 1)
}
return s
}
const at = Math.max(0, zs.indexOf(STIFLE.zone) - 2), shown = zs.slice(at, at + 5)
const rows = `<div class="lrow small muted">⋮</div>` + shown.map((id) => {
const z = zoneById[id], n = matches(Q, [id]).length, open = id === STIFLE.zone
return `<div class="lrow" style="font-weight:600">${ico(open ? 'down' : 'chevron', 'sm')}${z.fr}<span class="muted" style="font-weight:400">${pl(n, 'résultat', 'résultats')}</span><span class="r small" style="font-weight:400"><a class="lnk">${ico('layers', 'sm')}Sur le schéma</a></span></div>${open ? zoneTree(z, Q) : ''}`
}).join('') + `<div class="lrow small muted">⋮</div>`
const bar = `<div class="sbar"><span class="inp focus" style="width:320px">${ico('search', 'sm')}${Q}<span style="margin-left:auto">${ico('close', 'sm')}</span></span>
<span class="count">${pl(ms.length, 'constat', 'constats')} sur ${ALL_FINDINGS.toLocaleString('fr-FR')}, dans ${pl(zs.length, 'zone', 'zones')}</span>
<span style="margin-left:auto;display:flex;gap:8px"><span class="btn secondary sm">${ico('layers', 'sm')}Filtrer sur le schéma</span><span class="btn ghost sm">${ico('undo', 'sm')}Réinitialiser les filtres</span><span class="btn secondary sm">${ico('plus', 'sm')}Ajouter…${ico('down', 'sm')}</span></span></div>`
const detail = `<div class="pcard" style="width:360px;flex:none"><div class="small muted">${Z_STIFLE.families[0].fr} › ${Z_STIFLE.families[0].children[0].fr}</div>
<div class="phead" style="font-size:15px">${hl(sel.fr, Q)}<span class="r">${status(sel.status)}</span></div>
<div class="grid2"><div class="field"><label>Nom (FR)</label><span class="inp">${sel.fr}</span></div><div class="field"><label>Nom (EN)</label><span class="inp">${sel.en}</span></div></div>
<div class="field"><label>Description (FR)</label><span class="inp area muted">Aucune description</span></div>
</div>`
document.getElementById('b20').innerHTML = editor({ tab: 'Constats', body: `<div style="flex:1;min-width:0;display:flex;flex-direction:column;gap:10px">${bar}
<div style="display:flex;gap:12px;flex:1;min-height:0"><div class="pcard tree" style="flex:1;min-width:0;overflow:hidden">${rows}</div>${detail}</div></div>` })
+ `<div style="display:flex;gap:12px;margin-top:10px;width:1280px">${note(`<b>Recherche :</b> sur le nom des constats en français et en anglais, sans tenir compte des accents ni de la casse, dès la frappe. Les branches sans résultat se replient ; les ancêtres d'un résultat restent visibles en gris. La liste est montrée défilée jusqu'au grasset (${pl(Math.max(0, zonesOf(matches('restriction')).indexOf(STIFLE.zone) - 2), 'zone', 'zones')} au-dessus). « Ajouter… » ouvre le choix zone, famille ou constat, comme aujourd'hui. Le compteur est annoncé poliment aux lecteurs d'écran après une courte pause de frappe.`, 'flex:1')}${note(`<b>« Sur le schéma » :</b> passe à l'onglet Annotations, sélectionne l'annotation de la zone et ouvre son volet « Constats » (navigation inverse de la planche 17). Plusieurs annotations : la première, les autres listées dans le volet.<br><b>Filtres :</b> états d'interface, gardés en changeant d'onglet, jamais enregistrés ni écrits dans la fiche.`, 'flex:1')}</div>`
}
</script>
<!-- ================================================================== 21 filter on the drawing -->
<div class="row"><div data-board="21-constats-filtre-schema">
<p class="sheet-title">21. « Filtrer sur le schéma » : choix des vues, sélection de points et de zones sur le dessin, combinée à la recherche</p>
<div id="b21"></div></div></div>
<script>
{
const Q = 'restriction', pick = [STIFLE, HOCK, annById.lumbar], ids = pick.map((a) => a.zone)
const ms = matches(Q, ids), zs = zonesOf(ms)
const rows = zs.map((id) => {
const z = zoneById[id], own = matches(Q, [id])
return `<div class="lrow" style="font-weight:600">${ico('down', 'sm')}${short(z.fr)}<span class="muted" style="font-weight:400">${pl(own.length, 'résultat', 'résultats')}</span></div>`
+ own.slice(0, 6).map((m) => `<div class="lrow" style="padding-left:22px"><span class="small muted" style="min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:160px">${m.f.fr.split(' ')[0]} ›</span>${hl(m.n.fr, Q)}</div>`).join('')
+ (own.length > 6 ? `<div class="lrow small muted" style="padding-left:22px;min-height:20px">${pl(own.length - 6, 'autre', 'autres')}</div>` : '')
}).join('')
const left = `<div style="width:420px;flex:none;display:flex;flex-direction:column;gap:8px">
<span class="inp" style="width:100%">${ico('search', 'sm')}${Q}<span style="margin-left:auto">${ico('close', 'sm')}</span></span>
<div style="display:flex;gap:6px;flex-wrap:wrap"><span class="chip">Texte : ${Q} ${ico('close', 'sm')}</span><span class="chip on">${ico('layers', 'sm')}Schéma : ${pl(ids.length, 'zone', 'zones')} ${ico('close', 'sm')}</span></div>
<div class="lrow"><span class="count">${pl(ms.length, 'constat', 'constats')} dans ${pl(zs.length, 'zone', 'zones')}</span><span class="r"><a class="lnk small">Réinitialiser les filtres</a></span></div>
<div class="pcard tree" style="flex:1;min-height:0;overflow:hidden">${rows}</div></div>`
const views = DOC.views.map((v) => `<span class="chip on">${ico('check', 'sm')}${v.fr}</span>`).join('')
const panel = `<div class="fpanel" style="top:162px;width:600px">
<div class="phead" style="font:400 19px var(--font-serif)">${ico('layers')}Filtrer sur le schéma<span class="r">${ico('close')}</span></div>
<div class="field"><label>Vues</label><div style="display:flex;gap:6px;flex-wrap:wrap">${views}</div><span class="small muted">Plusieurs vues possibles. Tant que rien n'est coché, le filtre retient toutes les zones des vues choisies.</span></div>
<div class="lrow"><span class="s13 muted">Dessin affiché :</span>${DOC.views.map((v, i) => `<span class="btn ${i === 0 ? 'on' : 'secondary'} sm">${v.fr} · ${pl(pick.filter((a) => a.view === v.id).length, 'choisie', 'choisies')}</span>`).join('')}</div>
<div class="canvas" style="flex:none;height:350px">${drawing({ w: 566, h: 348, faint: true, extra: (u) => picked(pick, u) })}<div class="hint">Clic : ajouter au filtre ou en retirer</div>${zoom('Ajusté')}</div>
<div class="lrow"><b class="s13">Sélection</b><span class="muted s13">${pl(pick.length, 'annotation', 'annotations')} · ${pl(ids.length, 'zone', 'zones')}</span><span class="r" style="display:flex;gap:8px"><a class="lnk small">Choisir dans une liste</a><a class="lnk small">Effacer la sélection</a></span></div>
<div style="display:flex;gap:6px;flex-wrap:wrap">${pick.map((a) => `<span class="chip">${short(nameOf(a))} ${ico('close', 'sm')}</span>`).join('')}</div></div>`
document.getElementById('b21').innerHTML = editor({ tab: 'Constats', body: left, overlay: panel })
+ `<div style="display:flex;gap:12px;margin-top:10px;width:1280px">${note(`<b>Combinaison :</b> un constat reste affiché s'il appartient à une zone retenue par le schéma ET contient le texte cherché. Dès qu'une annotation est cochée, seules les zones cochées comptent ; les vues choisies donnent les dessins où cocher, et toutes leurs zones tant que rien n'est coché. Ici « ${Q} » seul donne ${pl(matches(Q).length, 'constat', 'constats')} ; avec ${pick.map((a) => short(nameOf(a))).join(' et ')}, ${ms.length}. Le filtre s'applique à chaque clic, sans bouton « Appliquer ».`, 'flex:1')}${note(`<b>Volet :</b> non modal, sans voile : l'arbre à gauche se met à jour pendant la sélection ; le détail du constat se masque tant que le volet est ouvert. Un seul volet secondaire à la fois : ouvrir « Références » ferme celui-ci, le filtre reste actif (puce « Schéma »). Le dessin du volet est en consultation : aucun outil d'édition.`, 'flex:1')}</div>`
}
</script>
<!-- ================================================================== 22 states -->
<div class="row"><div data-board="22-etats">
<p class="sheet-title">22. États : aucun résultat, choix au clavier, lecture seule, écran étroit (lecture seule sous 1 024 px)</p>
<div id="b22" style="display:grid;grid-template-columns:repeat(2,600px);gap:20px"></div></div></div>
<script>
{
const pick = [STIFLE, HOCK], ids = pick.map((a) => a.zone), Q = 'abduction'
const none = `<div class="vign"><div class="lbl">A. Aucun résultat</div>${vframe(600, 330, `<span class="inp">${ico('search', 'sm')}${Q}<span style="margin-left:auto">${ico('close', 'sm')}</span></span>
<div style="display:flex;gap:6px"><span class="chip">Texte : ${Q} ${ico('close', 'sm')}</span><span class="chip on">${ico('layers', 'sm')}Schéma : ${pl(ids.length, 'zone', 'zones')} ${ico('close', 'sm')}</span></div>
<div class="count">${pl(matches(Q, ids).length, 'constat', 'constats')}</div>
<div class="notice info">${ico('info', 'sm')}<div><b>Aucun constat ne contient « ${Q} » dans ${pick.map((a) => short(nameOf(a))).join(' et ')}.</b><br>${pl(matches(Q).length, 'constat le contient', 'constats le contiennent')} hors du filtre du schéma.<div style="display:flex;gap:8px;margin-top:8px"><span class="btn secondary sm">Retirer le filtre du schéma</span><span class="btn ghost sm">Réinitialiser les filtres</span></div></div></div>`)}</div>`
const groups = ['art', 'charn', 'vert', 'os'].map((k) => {
const list = ANN.filter((a) => a.view === 'main' && a.kind !== 'detail_trigger' && CAT_KEY[a.cat] === k)
return `<div class="lrow" style="font-weight:600">${sw(CATS[k].c, CATS[k].o)}${DOC.categories.find((c) => CAT_KEY[c.id] === k).fr}<span class="r muted" style="font-weight:400">${list.length}</span></div>`
+ list.slice(0, k === 'art' ? 5 : 2).map((a) => `<div class="lrow ${a.id === STIFLE.id ? 'ring' : ''}" style="padding-left:26px"><span class="cb ${ids.includes(a.zone) ? 'on' : ''}"></span>${short(nameOf(a))}</div>`).join('')
+ (list.length > (k === 'art' ? 5 : 2) ? `<div class="lrow small muted" style="padding-left:26px;min-height:20px">${pl(list.length - (k === 'art' ? 5 : 2), 'autre', 'autres')}</div>` : '')
}).join('')
const kb = `<div class="vign"><div class="lbl">B. Choisir dans une liste (clavier, lecteur d'écran)</div>${vframe(600, 560, `<div class="phead">${ico('layers', 'sm')}Filtrer sur le schéma · ${viewName('main')}<span class="r"><a class="lnk small">Revenir au dessin</a></span></div>
<div class="small muted">Par catégorie d'annotation (couleur), pas par famille de constats</div><div class="tree">${groups}</div>
<div class="small muted">Cases à cocher natives : Tab passe d'une case à l'autre, Espace coche ou décoche. Chaque case porte le nom de l'annotation et sa zone ; la liste et le dessin montrent la même sélection.</div>`)}</div>`
const ro = `<div class="vign"><div class="lbl">C. Lecture seule (droits, brouillon en revue, version historique)</div>${vframe(600, 560, `<div style="display:flex;gap:12px;flex:1;min-height:0">${constatsPanel(STIFLE, { ro: true, w: 300, closed: true, badge: `<span class="r badge">${ico('lock', 'sm')}Lecture seule</span>` })}
<div style="flex:1;display:flex;flex-direction:column;gap:8px">${note('Les constats se consultent, se cherchent et se filtrent ; aucun ajout, aucune modification, aucun changement de zone. Les filtres restent disponibles : ils ne modifient pas la fiche.')}</div></div>`)}</div>`
const phone = `<div class="vign"><div class="lbl">D. Moins de 1 024 px : consultation, filtre par liste</div><div style="display:flex;gap:16px">
<div class="frame phone" style="height:780px"><div class="ph-top">${ico('menu')}<b style="font-weight:600">Brouillon, version 4</b><span class="badge" style="margin-left:auto">${ico('lock', 'sm')}Lecture seule</span></div>
<div class="ph-body" style="padding:12px;gap:8px"><div class="tabs" style="padding:0;margin:0"><a>Annotations</a><a>Vérification</a><a class="on">Plus ▾</a><span class="small muted" style="align-self:center">Constats</span></div>
<div class="notice info" style="font-size:12px">${ico('info', 'sm')}<div>L'édition demande un écran d'au moins 1 024 px de large.</div></div><span class="inp" style="height:44px">${ico('search', 'sm')}<span class="muted">Rechercher un constat</span></span><div class="lrow"><span class="count">${pl(ALL_FINDINGS, 'constat', 'constats')}</span><span class="r"><span class="btn secondary" style="height:44px">${ico('layers', 'sm')}Filtrer</span></span></div>
<div class="sheet" style="height:360px"><div class="grab"></div><div class="phead">Filtrer sur le schéma<span class="r" style="display:flex;gap:4px;align-items:center"><span class="btn ghost sm" style="height:44px">Réinitialiser</span><span style="width:44px;height:44px;display:grid;place-items:center">${ico('close')}</span></span></div>
<div style="display:flex;gap:6px;flex-wrap:wrap">${DOC.views.map((v, i) => `<span class="chip ${i === 0 ? 'on' : ''}" style="height:44px">${v.fr}</span>`).join('')}</div>
<div class="tree">${ANN.filter((a) => a.view === 'main' && a.kind !== 'detail_trigger').slice(0, 4).map((a) => `<div class="lrow" style="min-height:44px"><span class="cb ${ids.includes(a.zone) ? 'on' : ''}"></span>${short(nameOf(a))}</div>`).join('')}</div></div></div></div>
<div style="width:180px">${note('Sous 1 024 px (O14 A), l\'éditeur est en consultation : recherche et filtre disponibles, choix des zones dans une liste à cibles de 44 px, sans sélection sur le dessin. Le dessin reste consultable dans l\'onglet Annotations.')}</div></div></div>`
document.getElementById('b22').innerHTML = none + kb + ro + phone
}
</script>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

+196
View File
@@ -0,0 +1,196 @@
# V1-2.6 UX complement: navigation between annotations and findings
Status: PROPOSAL for the owner, 2026-11-06 (brief « Nouvelle exigence UX : navigation bidirectionnelle entre
annotations et constats »). Design only: no application, Rust, SQL or worker change; nothing here authorises code.
The U1 plan (`.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md`, commit 2e46c14) is unchanged by this track.
Contract: `.claude/tasks/contracts/2026-11-06-v1-2-6-findings-nav-design.md`. Boards:
`docs/design/v1-2-6-constats/` (17 to 22, after the 16 validated v1-2-6 boards).
Paths: `core/` stands for `crates/core/src/`, `app/` for `apps/app/src/`.
## 1. Audit of the existing relations (request C)
### 1.1 Links and who holds them
| Link | Held by | Cardinality | Core rule |
|---|---|---|---|
| annotation → view | `view_id` on every annotation (`core/domain/sheet/schema.rs:421`, `:447`) | many to one | error `annotation.view.missing` (`validate.rs:266-280`) |
| detail view → parent view | `parent_view_id` (`schema.rs:270-271`) | many to one | errors `view.parent.missing`, `view.parent.cycle`, `view.unreachable` (`validate.rs:146-223`) |
| detail trigger → view it opens | `opens_view_id` (`schema.rs:460-461`) | many to one: a trigger opens exactly one view, a detail view is opened by 1 to N triggers | error `annotation.opens_view.invalid` (`validate.rs:298-328`, the target is a direct child of the trigger's view); `view.unreachable` asks for at least one trigger per detail view (`validate.rs:200-223`); no uniqueness rule; a trigger has no finding zone and no region by type (`schema.rs:439-462`) |
| annotation → annotation category | `category_id` (`schema.rs:423`, `:449`) | many to one | error `annotation.category.missing` (`validate.rs:282-296`); the category has no link to findings |
| observable annotation → finding zone | `finding_zone_id: Option` (`schema.rs:432-433`) | an annotation names 0 or 1 zone; a zone is named by 0 to N annotations | error `annotation.finding_zone.missing` when it dangles (`validate.rs:330-346`); warning `annotation.no_findings` when null (`:367-386`); warning `finding_zone.unreferenced` when no annotation names a zone (`:437-457`); no uniqueness rule, and `docs/development/ANATOMICAL_SHEET_MODEL.md:102-103` says several annotations may share a zone |
| observable annotation → vertebral region | `vertebral_region_code` (`schema.rs:434-435`) | many to one | error `annotation.region.missing` (`validate.rs:348-365`); a region has no link to findings, it opens the practitioner's vertebra picker (`core/domain/editor/zone.rs:101-103`) |
| finding zone → families → findings | `categories` (`schema.rs:592`), `FindingCategory` with `kind` (`:568-583`), recursive `FindingNode` (`:538-556`) | tree, depth ≤ 8 (`edit.rs:397-420`) | ids unique among siblings (`finding.id.duplicate`, `validate.rs:410-435`); a finding is addressed by (zone, path) (`keys.rs:42-46`) |
| family kind | `FindingCategoryKind = dysfunction / consultation_reason / anamnesis / custom` (`schema.rs:558-566`) | on the category, never on nodes | no rule per zone (no « one of each ») |
| findings → references | `reference_ids` on categories and nodes (`schema.rs:578-579`, `:550-551`) | many to many | error `finding.reference.missing` (`validate.rs:466-499`) |
| laterality | annotation only (`unpaired / bilateral / left / right`, `schema.rs:393-402`) | none on zones or findings | the side exists only in reports, for bilateral annotations (`zone.rs:104-112`) |
There is no reverse link (zone → annotations) in the document, in the core index (`core/domain/sheet/index.rs:25-33`,
`index_data.rs:19-45`, `preview.rs:330-342`) or in the editor. The only core computation that returns the annotations
of a zone is `sheet.dependents` (`edit.rs:894-977`, relation `links_zone`), a free op over the whole document text,
used for delete confirmations. BDR-031 already rejected an `annotation_finding_map` array.
### 1.2 Equine draft data (`supabase/seed/anatomical-sheets/equine/draft/document.json`)
- 2 views (main, head detail), 28 annotations (22 points, 5 zones, 1 detail trigger), 27 finding zones, 811 families
and findings (81 families, 730 findings, every zone with exactly one family of each of the three kinds, no custom
family), depth 3, 48 references.
- Every finding zone is named by exactly one annotation; no observable annotation lacks a zone; zone ids equal
annotation ids; no left/right pair, no main + detail duplicate, no point + polygon on one zone. The duplicate cases
of the request do not exist in this sheet; they exist only in synthetic core fixtures (`crates/core/tests/oracles/r3/highlight.json`, hip ×5;
`crates/core/tests/conformance/annotation-id-duplicate.json`, atm ×2).
- Labels repeat: 283 distinct French labels over 811 elements; the family name « Anamnèse / facteurs rapportés » is shared by all 27 zones, with three distinct subtrees (8 cranial zones, 9 spinal zones, 10 limb and pelvic zones), and
« Restriction en flexion » appears 15 times. A search result without its zone would be ambiguous.
- Grasset: annotation `stifle` (point, main view, bilateral) names zone `stifle`: 3 families, 29 findings (16, 7, 6),
3 with a veterinary referral flag, one reference cited.
### 1.3 What the editor and the core already offer
- Editor: one `selectedId` on the canvas (`app/editor/annotations/uiState.ts:14-67`), one marked annotation
(`useCanvasBuild.ts:70-83`); « Zone de constats » select in the annotation properties (`AnnotationFields.tsx:162-187`)
and at creation (`CreationFields.tsx:141-161`); the Constats tab as an ARIA tree over `buildItems`
(`app/editor/findings/tree.ts:161-196`), creation of zones, families and findings (`FindingCreateForm.tsx`); no search,
no filter, no link between the two tabs; the Annotations tab cannot create a finding zone.
- Read-only precedents: the catalogue's `ZonePanel` (`app/components/catalogue/ZonePanel.tsx:62-133`) shows the
findings of the selected annotation's zone by family; the report editor de-duplicates by zone and side
(`app/components/observation/ObservationCard.tsx:78-93`) and marks several annotations at once
(`app/components/canvas/AnatomyCanvas.tsx:79-85`).
- Core: no search op, no reverse map; the composed canvas tags every annotation with `data-anno-zone`
(`core/anatomy/layer.rs:176-208`, contract `docs/ANNOTATION-RENDERING.md:50-66`).
### 1.4 Conclusion of the audit
The request needs no new association: an annotation already names its finding zone, the findings belong to the zone,
and « the findings of an annotation » are the findings of that zone. « Gérer l'association anatomique » is the existing
`finding_zone_id` field. Duplicates are handled by grouping on the zone id: findings are listed and counted once per
zone, whatever the number of annotations naming it. No document structure change is proposed.
## 2. Design (boards 17 to 22)
| Board | Content |
|---|---|
| 17 | Annotations tab, an annotation selected: the side column gains a « Constats · n » segment beside « Propriétés »: the zone (with « Changer » and the other annotations that show it), the families of the zone in document order with their counts, « Ajouter un constat », « Ouvrir dans Constats » |
| 18 | From the selection: A, add a finding in the zone (family, parent, FR/EN names; « Ajouter » / « Abandonner »); B, edit a finding with the same fields and component as the Constats tab detail (C9) |
| 19 | Association: A, change the finding zone (searchable list, current zone first, « n annotations » per zone, the rule « no finding moves »); B, an annotation without zone (link to an existing zone, or create one for it); C, a detail trigger has no findings (segment disabled with its reason); D, a zone shown by two annotations (illustrative, absent from the equine draft) |
| 20 | Constats tab: instant search, result count over the total, « Filtrer sur le schéma », « Réinitialiser les filtres »; results shown in their tree (zone, family, ancestors in grey); each zone row links to the drawing (« Sur le schéma ») |
| 21 | « Filtrer sur le schéma »: non-modal right panel; views chosen as chips (one or more); click on points or zones to add or remove them; selection chips; the tree on the left updates at each click and combines with the text |
| 22 | States: no result (with the count outside the drawing filter and « Retirer le filtre du schéma »); keyboard list of the annotations with checkboxes; read-only (rights, frozen, historical); below 1 024 px, consultation with the list only |
Bidirectional path: drawing → « Ouvrir dans Constats » (focus request on the zone or finding key); Constats →
« Sur le schéma » (focus request on the annotation key, Constats segment open). Filters are interface state: kept while
the page lives (U1 keeps the Constats tab mounted), never written to the document, never saved, never arming the leave
guard.
## 3. U1 integration points (work item 1)
No integration point has to be added to U1, and no amendment of the U1 plan is proposed. The seams the feature needs
are already in the plan:
- `navigate(target)` with `zone`, `finding` and `annotation` keys (`targetOfKey`, U1 plan §1) gives both directions of
the jump; `PropertiesPanel` receives `navigate` from Lot B1 (its unmeasured-view link is retargeted there).
- The Constats tab stays mounted (U1 plan §2), so search and drawing filters survive tab changes without any store.
- `usePlaceVisible()` and the « one composed copy of a view » rule (U1 plan §2) cover the filter panel's drawing: it
detaches while its place is hidden, and the Annotations drawing is hidden while Constats is shown.
- `folded` exported in Lot C (case- and accent-insensitive match) serves the findings search.
- The secondary panel slot of the references panel (U1 plan §5) is where the filter panel goes; the reducer gains a
second panel kind when this feature lands, a local change (owner precision 10: no global navigation rebuilt). Watch
item for the U2b executors: the filter panel is a variant, not a copy: no scrim and no `inert` on the tab panels
(F5: the tree stays live), unlike the references panel.
One watch item for the U1 executors, with no plan change: keep the Constats tab's selection, expansion and future
filter state local to the kept-mounted `FindingsTab` (as the plan already does), not in the navigation reducer.
## 4. Placement (work item 2)
Recommended: a dedicated sub-step **U2b · Annotations et constats**, after U2 and before U3, on its own owner
authorisation.
- Why after U2: U2 rewrites the selection, pointer and keyboard model of the same canvas and the same
`PropertiesPanel`; the Constats segment sits in that panel and the drawing filter reuses the pointer rules
(§2 G of the UX plan: a second pointer cancels, arrows pan only on the canvas box).
- Why before U3-U6: none of them changes the zone link or the findings tree; U3 and U6 touch `AnnotationFields`
(colour, roles, region picker), not the zone field nor the Constats tab; U4 and U5 add views, which the view chips
list by construction; U6's internal `cat-access` and the detail triggers never carry findings, so they never appear
as filter choices.
- Alternative: after U6 (less rework risk in `AnnotationFields`, later delivery).
- Files: `app/components/editor/annotations/{PropertiesPanel,EditableAnnotations,ConstatsSegment (new),
ZoneLink (new)}.tsx`, `app/components/editor/tabs/FindingsTab.tsx`, `app/components/editor/findings/{FindingTree,
FindingDetail,FindingContent,FindingCreateForm,FindingsSearch (new),SchemaFilterPanel (new)}.tsx`,
`app/editor/findings/{tree,filter (new)}.ts`, `app/editor/annotations/zoneIndex.ts` (new), the canvas marking state,
`docs/ANNOTATION-RENDERING.md` (new page state for filter marks, updated first), i18n.
- Rust ops: none. Wasm budget: unchanged (margin 7 857 B kept for U2, U5, U6, LRN-118).
- Boundary (BDR-043, EVAL-034): the zone → annotations map is a group-by on a field the document already holds, and
the search filters what the page displays; neither decides validity, accepts a change or computes a rule. Same kind
of read as `citationCounts` (U1) and the catalogue's sheet-name search (`filterCatalog`, BDR-095). Every change made
from the new surfaces goes through the existing `sheet.edit` commands (finding insert and update, annotation update),
so the core keeps the last word. A core op would be justified only if a measure on a large sheet showed the page-side
derivation over the 500 ms budget.
- Acceptance (proposal): boards 17-22 built; A and B work with mouse, touch from 1 024 px and keyboard; every finding
change undoable as one entry; filters never change the document; read-only modes show no edit control; axe clean.
- Owner demo: select the grasset, read its 29 findings, add one, undo it; search « restriction »; filter on grasset and
jarret; reset; jump both ways.
- Rollback: revert of the sub-step's commits (no data, no schema).
## 5. Technical risks (work item 4)
| Risk | Probability | Mitigation |
|---|---|---|
| Editing findings from annotation A changes them for every annotation naming the zone | medium | the segment names the zone and lists the other annotations (board 17, 19 D); edits go to the zone, never copied |
| Changing an annotation's zone changes what practitioners are offered and turns the annotation `to_confirm` (`edit.rs:495-509`) | medium | the change goes through the existing field and its review rule; old reports keep their zone id and path (`core/domain/report/rebase.rs:148-157`, BDR-010) |
| Search results ambiguous (repeated labels across 27 zones) | high | results always shown under their zone and family; the count names zones too |
| Count unit undefined (zones, families, findings, leaves) | high | decision F2 (recommendation: findings at any depth) |
| Multi-annotation marking needs a new page state on the composed canvas | medium | page-side restyle only (BDR-053), `ANNOTATION-RENDERING.md` updated before the code |
| A third composition of a view in the page (filter panel) | medium | U1's detach-while-hidden rule; one visible composition per view at a time |
| Kept-mounted Constats tab recomputing filters on each commit | low | memoised on the parsed document and the filter state; measured with the U1 commit-to-paint check (500 ms budget) |
| Duplicates never exercised by the equine data | high | unit and e2e fixtures with two annotations on one zone (main + detail, left + right), modelled on the core's synthetic fixtures |
| Terminology: « zone » is an annotation kind and a finding zone; « catégorie » is an annotation category and a family | high | labels « Zone de constats » and « Famille » proposed (decision F7), kept apart from « Zone » (shape) and « Catégorie » (colour category) |
| Creating a zone from an annotation is two changes (zone, link) | medium | one batch commit, all or nothing, one undo entry (decision F8) |
| Rework if U2, U3 or U6 change the panel structure afterwards | medium | placement after U2 (section 4) |
| Laterality: a left and a right annotation on one zone show the same findings | low | expected (findings carry no side; the report adds it); stated in the segment's help |
| Wasm budget | low | no core op (section 4) |
## 6. Tests (work item 4)
- Unit: zone index (zone → annotations, annotation → zone, triggers and null zones excluded); findings filter (text in
FR and EN, accents and case, zone names, ancestors kept, counts per unit, combination with the drawing filter, empty
result, reset); de-duplication with two annotations on one zone (main + detail, left + right); the Constats segment
(families in order, counts, add and edit through the existing commands, one undo entry each, change of zone, null
zone, detail trigger disabled with its reason, read-only in every read-only mode); « Ouvrir dans Constats » and
« Sur le schéma » focus requests (found, kept, none); filters absent from the document text and from the leave
guard; filter state kept across tab changes and pruned when an undo removes a filtered zone or annotation.
- E2E (sandbox): grasset journey (select, read, add, undo, edit, change zone and back); search with count; drawing
filter with mouse and touch at 1 024 and 1 180 px; keyboard-only filter through the list; reset; both jumps; narrow
read-only at 375 px (search and list filter, no edit control); no horizontal scroll at 1 024, 1 180, 1 280, 375 px.
- Accessibility: axe on the segment, the search, the filter panel open, the narrow mode; count in a polite live region
after a typing pause; checkboxes named with annotation and zone; focus after each jump on its target, never `body`.
- Regression: C9 (findings detail), C13 (recovery), C14 (history bound), C16 (narrow read-only), the U1 suites; the
core suites unchanged (no core change); `pnpm r5:import-equine --check` unchanged.
## 7. Decisions to take (owner)
None is decided by this proposal; each has a recommendation (F1 to F16).
| Id | Question | Recommendation |
|---|---|---|
| F1 | Sub-step | dedicated U2b after U2 (alternative: after U6) |
| F2 | What the counters count | findings at any depth; families and zones are not counted as findings; the result line also names the zones (« 108 constats sur 730, dans 26 zones ») |
| F3 | Search scope | finding names in French and English, accents and case ignored; a zone whose name matches shows all its findings; descriptions and references not searched |
| F4 | Drawing filter semantics | the chosen views give the drawings to pick on, and all their zones while nothing is picked; once one annotation is picked, only the picked zones count; text and drawing combine with AND; applied at each click, no « Appliquer » |
| F5 | Filter panel | non-modal right panel without scrim (the tree stays live); one secondary panel at a time (opening « Références » closes it, the filter stays active as a chip) |
| F6 | Below 1 024 px | consultation: search and filter available, zones chosen in a list (44 px targets), no selection on the drawing |
| F7 | Labels | « Accès : <vue> » as the name shown for a detail trigger (it has no name in the document), « Constats » for the segment, « Zone de constats » for the link, « Famille » for a finding category (today the Constats tab says « Catégorie », to align at the label review), « Filtrer sur le schéma », « Réinitialiser les filtres » |
| F8 | Creating a zone from an annotation without one | allowed, one batch (zone with the annotation's name, editable, then the link), one undo entry |
| F9 | Editing a finding from the drawing | in the side column, with the shared detail component; « Ouvrir dans Constats » for the tree context |
| F10 | Filter lifetime | kept while the page lives (tab changes included), cleared by « Réinitialiser les filtres » and on reload; a filtered zone or annotation removed by an undo leaves the filter silently narrower with its chip updated |
| F11 | « Sur le schéma » from a zone named by several annotations | selects the first in document order and lists the others in the segment |
| F12 | Multi-annotation marking in the filter panel | accent outline and check disc (board 21), a new page state recorded in `docs/ANNOTATION-RENDERING.md` before any code |
| F13 | Finding detail while the filter panel is open | hidden, the tree takes the width; it comes back when the panel closes (board 21) |
| F14 | Grouping of the keyboard list of annotations | by annotation category (colour), as the drawing shows them, with a caption saying so; not by finding family (board 22 B) |
| F15 | Choosing a zone already shown by another annotation | allowed, with a notice naming the other annotation before the change is applied (board 19 A) |
| F16 | « Constats » segment of a detail trigger | shown disabled with its reason rather than hidden, so the panel keeps the same layout (board 19 C) |
## 8. Out of scope
Findings attached to several zones, moving findings between zones, drag and drop in the tree, bulk import (all level 2,
contract §8.3 and §16.12); practitioner-side search (V1-3 reports); the catalogue (BDR-095 keeps its search to sheet
names); any core op, schema change or V1-2.7 control.