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.
@@ -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
# 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
// 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 = `<svgclass="drawing"width="${w}"height="${h}"viewBox="${vb.join(' ')}"preserveAspectRatio="xMidYMid meet"><imagehref="${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 (!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 = '') => `<svgclass="icon ${c}"><usehref="#i-${n}"/></svg>`
const side = () => `<asideclass="side"><divclass="logo"><imgsrc="${LOGO}"alt="Faunosteo"></div><navclass="nav">${NAV.map(([i, l, on]) => i === 'HR' ? '<hr>' : `<aclass="${on || ''}">${ico(i)}${l}</a>`).join('')}</nav><divclass="foot muted">Se déconnecter</div></aside>`
saved: `<spanclass="s13"style="display:flex;gap:6px;align-items:center;color:#3f5e3f">${ico('check', 'sm')}Enregistré à 14:32 · révision 11</span><spanclass="btn primary sm"disabled>Enregistrer</span>`,
})[state]
}
function header(o = {}) {
return `<divclass="ehead"style="flex-wrap:wrap"><h1class="page">${o.title || 'Brouillon, version 4'}</h1><spanclass="badge">Brouillon</span><spanclass="badge">Copie de travail</span>${o.badges || ''}
// U1 save line: « Abandonner les modifications » beside « Enregistrer » in edit mode (U1 contract clarification).
function save() {
return `<spanclass="s13 muted"style="white-space:nowrap">3 modifications non enregistrées</span><spanclass="btn secondary sm">Abandonner les modifications</span><spanclass="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 `<divclass="ehead"><h1class="page">${o.title || 'Brouillon, version 4'}</h1><spanclass="badge">Brouillon</span><spanclass="badge">Copie de travail</span>${o.badges || ''}
+ `<divstyle="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 -->
<divclass="field"><label>Placer sous</label><spanclass="inp">${first.fr}<spanclass="caret">${ico('down', 'sm')}</span></span><spanclass="small muted">Première option de la liste : « Directement dans la famille »</span></div>
<divclass="grid2"><divclass="field"><label>Nom (FR)</label><spanclass="inp focus">Restriction en abduction</span></div><divclass="field"><label>Nom (EN)</label><spanclass="inp">Abduction restriction</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 = `<divclass="vign"><divclass="lbl">B. Modifier un constat existant</div>${vframe(420, 740, `<divclass="pcard">${selHead(STIFLE)}</div>
<divclass="pcard"><divclass="lrow small"><aclass="lnk"><spanstyle="display:inline-block;transform:rotate(180deg)">${ico('chevron', 'sm')}</span>Retour aux constats du ${short(Z_STIFLE.fr).toLowerCase()}</a></div>
<divclass="field"><label>Références citées</label><divclass="lrow"><spanclass="muted">${pl(leaf.refs, 'référence', 'références')}</span><spanclass="r"><aclass="lnk">Ajouter une référence</a></span></div></div>
<divstyle="display:flex;gap:8px;flex-wrap:wrap"><spanclass="btn secondary sm">Marquer comme relu</span><spanclass="btn secondary sm">Ouvrir dans Constats</span><spanclass="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>`
<pclass="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>
const change = `<divclass="vign"><divclass="lbl">A. Changer la zone de constats</div>${vframe(560, 560, `<divclass="pcard"style="position:relative">${selHead(STIFLE)}
<divclass="field"><label>Zone de constats</label><spanclass="inp focus">${ico('search', 'sm')}<spanclass="muted">Rechercher une zone (${DOC.zones.length})</span></span></div>
<divclass="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 = `<divclass="vign"><divclass="lbl">B. Annotation sans zone de constats (zone retirée du point)</div>${vframe(560, 560, `<divclass="pcard"><divclass="phead">${ico('point', 'sm')}Point · ${short(nameOf(HOCK))}</div><divclass="seg"><span>Propriétés</span><spanclass="on">Constats</span></div>
<divclass="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>
<divclass="field"><label>Relier à une zone existante</label><spanclass="inp">${ico('search', 'sm')}<spanclass="muted">Rechercher une zone</span><spanclass="caret">${ico('down', 'sm')}</span></span></div>
<divclass="lrow"><spanclass="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 access = `<divclass="vign"><divclass="lbl">C. Accès à une vue détaillée</div>${vframe(560, 300, `<divclass="pcard"><divclass="phead">${ico('crop', 'sm')}${nameOf(trig)}</div><divclass="seg"><spanclass="on">Propriétés</span><spanstyle="opacity:.45">Constats</span></div>
<divclass="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 = `<divclass="vign"><divclass="lbl">D. Zone montrée par deux annotations (cas illustratif)</div>${vframe(560, 360, `<divclass="pcard">${selHead(STIFLE)}${zoneLine(STIFLE, { also: 'Aussi sur le schéma : Grasset, vue « Membre postérieur » (<aclass="lnk">la sélectionner</a>)' })}</div>
<divclass="lrow s13"style="gap:14px"><svgwidth="70"height="34"viewBox="0 0 70 34"><circlecx="17"cy="17"r="11"fill="none"stroke="#b85a3f"stroke-width="3"/><circlecx="27"cy="7"r="6"fill="#b85a3f"/><circlecx="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>`
<pclass="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>
<divid="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))
s += `<divclass="lrow"style="padding-left:22px;font-weight:600">${ico('down', 'sm')}${f.fr}<spanclass="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 += `<divclass="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') : '<spanstyle="width:15px"></span>'}<spanclass="${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 = `<divclass="lrow small muted">⋮</div>` + shown.map((id) => {
const z = zoneById[id], n = matches(Q, [id]).length, open = id === STIFLE.zone
+ `<divstyle="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 -->
<divclass="lrow"><spanclass="count">${pl(ms.length, 'constat', 'constats')} dans ${pl(zs.length, 'zone', 'zones')}</span><spanclass="r"><aclass="lnk small">Réinitialiser les filtres</a></span></div>
<divclass="phead"style="font:400 19px var(--font-serif)">${ico('layers')}Filtrer sur le schéma<spanclass="r">${ico('close')}</span></div>
<divclass="field"><label>Vues</label><divstyle="display:flex;gap:6px;flex-wrap:wrap">${views}</div><spanclass="small muted">Plusieurs vues possibles. Tant que rien n'est coché, le filtre retient toutes les zones des vues choisies.</span></div>
<divclass="canvas"style="flex:none;height:350px">${drawing({ w: 566, h: 348, faint: true, extra: (u) => picked(pick, u) })}<divclass="hint">Clic : ajouter au filtre ou en retirer</div>${zoom('Ajusté')}</div>
<divclass="lrow"><bclass="s13">Sélection</b><spanclass="muted s13">${pl(pick.length, 'annotation', 'annotations')} · ${pl(ids.length, 'zone', 'zones')}</span><spanclass="r"style="display:flex;gap:8px"><aclass="lnk small">Choisir dans une liste</a><aclass="lnk small">Effacer la sélection</a></span></div>
+ `<divstyle="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 -->
<divclass="row"><divdata-board="22-etats">
<pclass="sheet-title">22. États : aucun résultat, choix au clavier, lecture seule, écran étroit (lecture seule sous 1 024 px)</p>
<divclass="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.<divstyle="display:flex;gap:8px;margin-top:8px"><spanclass="btn secondary sm">Retirer le filtre du schéma</span><spanclass="btn ghost sm">Réinitialiser les filtres</span></div></div></div>`)}</div>`
const groups = ['art', 'charn', 'vert', 'os'].map((k) => {
const kb = `<divclass="vign"><divclass="lbl">B. Choisir dans une liste (clavier, lecteur d'écran)</div>${vframe(600, 560, `<divclass="phead">${ico('layers', 'sm')}Filtrer sur le schéma · ${viewName('main')}<spanclass="r"><aclass="lnk small">Revenir au dessin</a></span></div>
<divclass="small muted">Par catégorie d'annotation (couleur), pas par famille de constats</div><divclass="tree">${groups}</div>
<divclass="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 = `<divclass="vign"><divclass="lbl">C. Lecture seule (droits, brouillon en revue, version historique)</div>${vframe(600, 560, `<divstyle="display:flex;gap:12px;flex:1;min-height:0">${constatsPanel(STIFLE, { ro: true, w: 300, closed: true, badge: `<spanclass="r badge">${ico('lock', 'sm')}Lecture seule</span>` })}
<divstyle="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 = `<divclass="vign"><divclass="lbl">D. Moins de 1 024 px : consultation, filtre par liste</div><divstyle="display:flex;gap:16px">
<divclass="frame phone"style="height:780px"><divclass="ph-top">${ico('menu')}<bstyle="font-weight:600">Brouillon, version 4</b><spanclass="badge"style="margin-left:auto">${ico('lock', 'sm')}Lecture seule</span></div>
<divclass="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><spanclass="inp"style="height:44px">${ico('search', 'sm')}<spanclass="muted">Rechercher un constat</span></span><divclass="lrow"><spanclass="count">${pl(ALL_FINDINGS, 'constat', 'constats')}</span><spanclass="r"><spanclass="btn secondary"style="height:44px">${ico('layers', 'sm')}Filtrer</span></span></div>
<divclass="sheet"style="height:360px"><divclass="grab"></div><divclass="phead">Filtrer sur le schéma<spanclass="r"style="display:flex;gap:4px;align-items:center"><spanclass="btn ghost sm"style="height:44px">Réinitialiser</span><spanstyle="width:44px;height:44px;display:grid;place-items:center">${ico('close')}</span></span></div>
<divstyle="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>`
`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`)
- 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
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).
`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.
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.