docs(docs): R0 boards, U1 corrections plan and trial stack plan

Owner brief of 2026-11-09 after the first U1 trial. Boards 23-30 (proposal), lots R0-R4 with arbitrations A1-A15, persistent trial stack plan. No code.
This commit is contained in:
bchanot committed 2026-11-09 16:13:04 +01:00
1 parent 8cb681e2fa
commit 3d64146164
17 files changed
+1403

No files matched your search

+7
View File
@@ -135,3 +135,10 @@ interaction, counters computed from the draft data; boards `12` and `15` unchang
owner-confirmed choices from the open ones; `ETUDE-TECHNIQUE.md` lists the prerequisites before any development.
`v1-2-6-constats/` (proposition de conception U2b, 2026-11-06; principe approuvé par le propriétaire le 2026-11-06, planches non validées graphiquement): boards 17-22, annotations ↔ findings complement; study and decisions F1-F22 `docs/development/V1-2-6_UX_FINDINGS_NAV.md`, boards shown with their decisions in its section 7.4.
`v1-2-6-r0/` (lot R0, proposal of 2026-11-09, NOT validated): boards 23-30 after the owner's first U1 trial (brief
« V1-2.6 UX — Arbitrages du premier essai propriétaire », BDR-107): fifth tab « Références » with tiles, search and
view-only sort; contextual references panel opened from a finding only (34 rem, slide); « Défaire » / « Refaire »;
« Désélectionner » and the Escape priority; phone « Plus »; generic admin sheet list and home card; catalogue card in
integrity failure. Once validated they replace board 11 of `v1-2-6/` as the references reference. Plan and open
arbitrations: `docs/development/V1-2-6_U1_CORRECTIONS.md`; review, labels and points: `v1-2-6-r0/REVUE.md`.
Binary file not shown.

After

Width:  |  Height:  |  Size: 294 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

+148
View File
@@ -0,0 +1,148 @@
# V1-2.6 R0 : arbitrages du premier essai propriétaire (proposition de conception, non validée)
Brief propriétaire du 2026-11-09 « Arbitrages du premier essai propriétaire », contrat
`.claude/tasks/contracts/2026-11-09-v1-2-6-trial-arbitrations.md` (critères 1 à 3). Ces planches remplacent la
direction de la planche 11 (`docs/design/v1-2-6/11-constats-references-desktop.png`) et complètent la coquille U1
telle qu'elle est construite. Aucun code d'interface n'est modifié avant leur validation.
| Fichier | Contenu |
|---|---|
| `23-references-onglet-desktop.png` | Éditeur à cinq onglets, onglet Références actif : recherche, « Trier par » (liste native, fermée, focus clavier), compteur, « Ajouter une référence », tuiles fermées et deux tuiles ouvertes (l'une citée par une famille seulement) avec « Modifier », « Supprimer », « Monter », « Descendre » ; en-tête sans bouton « Références », « Défaire » / « Refaire » |
| `24-references-recherche-tri.png` | A : recherche « ostéopathie », tri A → Z, ligne d'aide à la place de la réorganisation ; B : aucun résultat ; C : lecture seule ; D : tuile en modification (vue recadrée), ligne « 2 modifications non enregistrées » ; E : ajout d'une référence, nouvelle tuile en fin de fiche |
| `25-volet-references-constat.png` | Onglet Constats, volet contextuel du constat sélectionné (544 px = 34 rem), « Tout afficher dans l'onglet Références », voile ; déclencheur ; bande de mouvement (0, 90, 180 ms) et variante prefers-reduced-motion ; cas 1 024 px en note ; actions « Modifier » et « Retirer de ce constat » |
| `26-historique-deselection.png` | Onglet Annotations, point sélectionné, info-bulle de « Défaire » au focus clavier, « Désélectionner » à côté de « Supprimer » (info-bulle native au survol) ; A : dialogue de confirmation et son « Annuler » ; B : priorité de la touche Échap ; C : volet en lecture seule |
| `27-telephone-references.png` | 375 px : A menu « Plus » ouvert (Général, Constats, Références) ; B onglet Références ; C une tuile ouverte en consultation |
| `28-liste-fiches-desktop.png` | Administration › Fiches officielles : recherche par nom, tri, quatre filtres, « 12 fiches », date de dernière modification ; encarts recherche « cheval » (« 3 fiches sur 12 ») et recherche sans résultat |
| `29-liste-fiches-telephone-accueil.png` | A : la liste à 375 px, recherche active ; B : accueil Administration, carte « Fiches officielles » avec les cinq dernières modifications |
| `30-catalogue-carte-integrite.png` | Catalogue : une carte en échec d'intégrité, avertie dans la carte, et une carte en échec de chargement (réseau) avec « Réessayer » ; la même carte aujourd'hui ; la page de la fiche avec son message actuel (inchangée) |
| `planche-contact.png`, `planche-contact.html` | Les huit planches sur une page |
| `maquettes.html`, `gen-data.cjs`, `data.js` | Source des planches ; données calculées depuis `document.json` du brouillon équin |
Rendu : `node gen-data.cjs && PW_MODULE=<…>/apps/app/node_modules/@playwright/test node ../v1-2-6/render.cjs maquettes.html .`
puis la même commande sur `planche-contact.html` ; le fichier `all.png` produit est supprimé.
## Conventions
- Styles, icônes, coquille et dessin copiés de `v1-2-6-constats/maquettes.html` (eux-mêmes repris des planches
v1-2-6 validées) : mêmes jetons, aucune nouvelle couleur (la bordure des tuiles ouvertes reprend `--color-border`).
Aucun surlignage du texte trouvé par une recherche. Les lignes « ⋮ … » des listes défilées sont des annotations
de planche (style jaune), pas du texte d'interface. Trois icônes ajoutées dans le même trait : lien externe,
tri, désélection. L'éditeur suit U1 tel que construit : ligne d'enregistrement, « Abandonner les modifications »,
« Enregistrer », boutons d'historique sans bordure à droite de la barre d'onglets, « Plus » sous 640 px
(`tabs.ts`, `SHOWN.small`), volet de propriétés dans l'ordre de `PropertiesPanel.tsx`. Comme les planches
précédentes, la barre latérale est dessinée à 216 px (256 px dans l'application).
- Données calculées (aucune saisie à la main) : 48 références, leurs types, citations, DOI et URL ; les comptes
« Citée N fois » suivent `apps/app/src/editor/references/citations.ts` (familles et constats à toute
profondeur) : 178 citations portées par 83 éléments (2 familles, 81 constats), 15 références non citées sur 48
(dont « Catalogue historique Faunosteo… » et deux articles du Code rural, visibles en 24 A et 27 B). « Jäkel… »
(planche 23) n'est citée que par la famille « Dysfonctions ostéopathiques » de la synchondrose sphéno-occipitale. Seuls les
familles et les constats portent `reference_ids` dans le brouillon. Les listes « Citée par » avec leurs chemins,
le constat du volet (« Restrictions de mobilité articulaire », Articulation sacro-iliaque, 7 références, le plus
cité du brouillon), le point « Grasset » de la planche 26 (noms FR/EN, catégorie, latéralité, zone, centre et
rayon), les 2 vues et 27 zones de la carte du catalogue viennent tous de `data.js`. Recherche « ostéopathie » :
7 résultats (citation, DOI, URL, sans accents ni casse, comme `filter.ts`) ; « radiographie » : 0.
- Mise en scène (aucune donnée de document n'existe) : le fil d'Ariane et le nom « Cheval, squelette et rachis »,
« Brouillon, version 4 », « Révision 11 », les comptes « 3 » et « 2 modifications non enregistrées », « 2 erreurs »,
les noms d'utilisateurs (Bastien Chanot, Camille Laurent), les recherches « mulet » et « cheval » de la liste, toutes les lignes de la liste des fiches (noms,
versions, revues, états, dates), « Cheval (fiche historique) » (repris de la planche 10 v1-2-4), les cartes
« Chien » et « Chat, squelette et rachis » en échec et la version 3 publiée le 28/10/2026 de la carte Cheval (planche 01
v1-2-4). Les espèces des lignes illustratives viennent des lignes `species` des migrations (Cheval, Âne, Chien,
Chat, Bovin, Chèvre, Mouton, Porc, Lapin) ; aucune ligne n'utilise de nom ou de slug de données de test.
## Nouveaux libellés (FR / EN proposé)
| Où | FR | EN |
|---|---|---|
| Onglet (`editor.tab.references`) | Références | References |
| Historique, bouton | Défaire / Refaire | Undo / Redo (inchangés) |
| Historique, nom accessible | Défaire la dernière modification / Refaire la dernière modification défaite | Undo the last change / Redo the last undone change (inchangés) |
| Historique, info-bulle (title, survol) | … (Ctrl+Z ou ⌘Z) / … (Ctrl+Maj+Z ou ⇧⌘Z) | … (Ctrl+Z or ⌘Z) / … (Ctrl+Shift+Z or ⇧⌘Z) |
| Volet de propriétés | Désélectionner | Deselect |
| Recherche, bouton | Effacer la recherche | Clear the search |
| Tri, étiquette (externe, liste native) | Trier par | Sort by |
| Tri, options | Ordre de la fiche · Citation (A → Z) · Nombre de citations · Type | Sheet order · Citation (A → Z) · Number of citations · Type |
| Compteur | {n} références · {n} références sur {total} | {n} references · {n} references of {total} |
| Tuile | Citée {n} fois (texte existant `editor.references.cited_*`, majuscule initiale) · Non citée | Cited {n} times · Not cited |
| Tuile ouverte | Citée {n} fois, par : · Aller à · Aucun (DOI) · Aucune (URL) | Cited {n} times, by: · Go to · None · None |
| Tuile ouverte, marques | famille · ce constat | family · this finding |
| Tuile, actions | Modifier · Terminer | Edit · Done |
| Tuile en modification, titre | Modifier la référence | Edit the reference |
| Volet, action | Retirer de ce constat | Remove from this finding |
| Ajout, aide | Type et citation obligatoires. | Type and citation required. |
| Tuile, vide | Aucun constat ni aucune famille ne cite cette référence. | No finding or family cites this reference. |
| Onglet, bouton | Ajouter une référence | Add a reference |
| Ligne d'aide | Pour réorganiser, affichez l'ordre de la fiche sans recherche. | To reorder, show the sheet order without a search. |
| Aucun résultat | Aucune référence ne contient « {q} ». La recherche porte sur la citation, le DOI et l'URL. | No reference contains “{q}”. The search covers the citation, the DOI and the URL. |
| Volet, titre | Références citées | Cited references |
| Volet, compteur | {n} références citées par ce constat | {n} references cited by this finding |
| Volet, lien | Tout afficher dans l'onglet Références | Show all in the References tab |
| Liste des fiches | Rechercher une fiche par son nom · Dernière modification · Nom · {n} fiches · {n} fiches sur {total} · Modifiée le {date} | Search a sheet by name · Last modified · Name · {n} sheets · {n} sheets of {total} · Modified on {date} |
| Liste, recherche sans résultat | Aucune fiche ne contient « {q} » dans son nom. · Effacer la recherche | No sheet name contains “{q}”. · Clear the search |
| Repli A7 (date de la fiche) | Fiche modifiée le {date} · Fiches modifiées récemment | Sheet modified on {date} · Recently modified sheets |
| Accueil Administration | Dernières modifications · Voir les {n} fiches | Latest changes · See the {n} sheets |
| Carte du catalogue | Contrôle d'intégrité échoué : cette version ne peut pas être affichée. | Integrity check failed: this version cannot be displayed. |
Libellés repris du code sans changement : « Nouvelle référence », « Ajouter la référence », « Choisir… »,
« Connexion au serveur impossible. Vérifiez votre réseau. » (carte en échec réseau), « Plus », « Lecture seule », « Toutes les annotations », « Supprimer »,
« Monter », « Descendre », « Marquer comme relu », les types de référence, les messages de mode, de suppression
(`editor.delete.*`) et d'échec du catalogue, « Réessayer ».
## Ce qui change par rapport aux planches validées
- Planche 11 et en-tête U1 : le bouton « Références » de l'en-tête disparaît ; la bibliothèque devient le cinquième
onglet, entre Constats et Vérification (la structure à quatre onglets des planches 01 à 16 et de U1 passe à cinq).
Le volet secondaire reste, réservé au constat : plus large (34 rem au lieu de 27), filtré, sans réorganisation, ajout ni
suppression (« Retirer de ce constat » à la place), et sans la puce « Citées par … (n) » ni « Tout afficher (48) » de la planche 11, remplacés par le chemin du
constat et « Tout afficher dans l'onglet Références ».
- Les références passent de cartes à champs toujours éditables à des tuiles repliables ; la modification s'ouvre
par « Modifier » dans la tuile (mêmes champs, même application champ par champ ; « Citée … par » et « Aller à »
restent, « Supprimer », « Monter », « Descendre » sont masqués jusqu'à « Terminer »). L'ajout ouvre une tuile vide
en fin de liste, recherche et tri remis à zéro, focus sur « Citation » (24 E).
- Historique : « Annuler » / « Rétablir » deviennent « Défaire » / « Refaire » ; le raccourci (Ctrl ou ⌘) passe dans
l'info-bulle native (survol) ; au clavier et pour les lecteurs d'écran il passe par aria-keyshortcuts, auquel
s'ajoutent Meta+Z / Meta+Shift+Z. Pas de nouveau composant d'info-bulle.
- Volet de propriétés : ajout de « Désélectionner » ; Échap suit une priorité écrite.
- Liste des fiches : recherche, tri et date ajoutés ; filtres, badges et lignes inchangés. Carte d'accueil : cinq
dernières modifications au lieu des cinq premières fiches de la liste, mêmes badges et même ligne de détail que la liste (aucun
nouveau badge), date, lien « Voir les N fiches ». Recherche sans résultat : phrase propre à la recherche et
« Effacer la recherche ».
- Catalogue : un échec d'intégrité est dit dans la carte au lieu de réduire la carte en silence ; un échec d'une
autre nature (réseau) a sa propre ligne, ton d'avertissement, et « Réessayer ». Le badge « Publiée » reste.
## Points soumis au propriétaire
1. Réorganisation : « Monter » / « Descendre » seulement en ordre de la fiche et sans recherche ; ailleurs ils sont
masqués (pas grisés) et une ligne d'aide l'explique (24 A).
2. Tuiles : plusieurs ouvertes à la fois ; l'état ouvert, la recherche et le tri sont gardés tant que l'éditeur reste
ouvert (changement d'onglet compris, 24 D) et remis à zéro à sa réouverture.
3. Volet d'un constat : actions « Modifier », « Retirer de ce constat » (retire la citation, modification ordinaire
annulable) et les lignes « Aller à » ; ni réorganisation, ni ajout, ni « Supprimer » (chaque référence du volet
étant citée par le constat, le cœur le refuserait toujours). « Tout afficher » ferme le volet, ouvre l'onglet
avec recherche et tri remis à zéro et met le focus sur son titre.
4. Touche Échap : dialogue ouvert, puis menu ouvert, puis volet contextuel, puis tracé en cours, puis sélection ; un
champ de saisie garde Échap pour lui (recherche non vide : l'effacer). « Plus » est le seul menu ; « Trier par » est
une liste native, dont le navigateur gère Échap.
5. « Désélectionner » reste disponible en lecture seule (état d'interface), « Supprimer » n'y est pas. Focus après
« Désélectionner » : la ligne de l'annotation dans la liste, par le même chemin que « Toutes les annotations »
(`focusRow`, PropertiesPanel.tsx). À trancher aussi : « Toutes les annotations », en haut du volet, désélectionne déjà ; garder les deux, ou un seul.
6. Source de la date de la liste : la liste lit `anatomical_sheets.updated_at`, que l'enregistrement d'un brouillon
ne touche pas (28 fiches sur 219 de la sandbox ont une version plus récente). Soit une lecture SQL modifiée
(checkpoint dédié), soit une approximation documentée ; dans ce cas la ligne dit « Fiche modifiée le … » et la
carte d'accueil « Fiches modifiées récemment » (note de la planche 28).
7. Format de date : « Modifiée le 9 nov. 2026, 12:06 » (proposé) ou « Modifiée le 9 nov. 2026 à 12:06 ».
8. Carte d'accueil : cinq dernières modifications, badges et ligne de détail de la liste (aucun nouveau badge),
date, « Voir les N fiches ».
9. Carte du catalogue : libellé FR / EN ci-dessus, ton d'erreur, pour un échec d'intégrité (empreinte, illustration
manquante ou altérée, document illisible) ; un autre échec (réseau) a sa propre ligne, texte existant, ton
d'avertissement, avec « Réessayer ». Les échecs de taille (caps) et de vue (view) restent à classer.
## Contrôles
- Rendu avec le Chromium épinglé, aucune erreur de page ; chaque PNG relu, chevauchements et coupures corrigés.
- `impeccable` : aucune commande disponible (ni sur le PATH, ni par `npx --no-install`) ; non exécuté.
- Revue de conception indépendante (2026-11-09) : APPROVE WITH FIXES (3 MUST-FIX, 10 SHOULD, 9 NOTE). Appliqués :
les trois MUST (actions du volet, focus après « Désélectionner », carte en échec réseau), les dix SHOULD (liste
native « Trier par », info-bulle au survol avec ⌘, « Citée N fois » et marque « famille », état d'ajout, recherche
sans résultat de la liste, libellés de repli A7, plus de surlignage, carte d'accueil sans nouveau badge, lignes de
mise en scène en annotation, 24 D recadrée et actions en modification) et les notes 4 à 7. Non dessinés (notes
facultatives 1 et 2) : le dialogue de refus de suppression d'une référence citée, l'arrivée depuis Vérification.
+2
View File
@@ -0,0 +1,2 @@
// generated by gen-data.cjs from document.json
window.DOC = {"name":{"fr":"Cheval","en":"Horse"},"views":[{"id":"main","fr":"Vue latérale gauche"},{"id":"head","fr":"Tête (vue latérale gauche)","parent":"main"}],"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)","en":"Hind fetlock","zone":"hind-fetlock","status":"to_confirm","g":["c",1523,1397,34]},{"id":"hock","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Jarret (tarso-crurale et intertarsiennes)","en":"Hock (tarsal joints)","zone":"hock","status":"to_confirm","g":["c",1542,1159,34]},{"id":"stifle","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Grasset (fémoro-tibiale et fémoro-patellaire)","en":"Stifle joint","zone":"stifle","status":"to_confirm","g":["c",1464,918,34]},{"id":"hip","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Hanche (coxo-fémorale)","en":"Hip joint","zone":"hip","status":"to_confirm","g":["c",1585,612,34]},{"id":"sacroiliac","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Articulation sacro-iliaque","en":"Sacroiliac joint","zone":"sacroiliac","status":"to_confirm","g":["c",1450,578,34]},{"id":"shoulder","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Épaule (scapulo-humérale)","en":"Shoulder joint","zone":"shoulder","status":"inherited","g":["c",784,907,34]},{"id":"elbow","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Coude (huméro-radio-ulnaire)","en":"Elbow joint","zone":"elbow","status":"to_confirm","g":["c",743.0451049804688,1193,34]},{"id":"carpus","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Carpe (antébrachio-carpienne, médio-carpienne)","en":"Carpus (carpal joints)","zone":"carpus","status":"to_confirm","g":["c",745,1252,34]},{"id":"fore-fetlock","view":"main","kind":"point","cat":"articulations","lat":"bilateral","fr":"Boulet antérieur (métacarpo-phalangien)","en":"Fore fetlock","zone":"fore-fetlock","status":"to_confirm","g":["c",736,1379,34]},{"id":"fore-sesamoids","view":"main","kind":"point","cat":"os","lat":"bilateral","fr":"Sésamoïdes antérieurs (boulet)","en":"Forelimb sesamoids","zone":"fore-sesamoids","status":"to_confirm","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)","en":"L6-S1 junction (lumbosacral joint)","zone":"l6-s1","status":"to_confirm","g":["c",1424,515,30]},{"id":"t18-l1","view":"main","kind":"point","cat":"charnieres-vertebrales","lat":"unpaired","fr":"Charnière T18-L1 (thoraco-lombaire)","en":"T18-L1 junction (thoracolumbar)","zone":"t18-l1","status":"to_confirm","g":["c",1118,528,30]},{"id":"c7-t1","view":"main","kind":"point","cat":"charnieres-vertebrales","lat":"unpaired","fr":"Charnière C7-T1 (cervico-thoracique)","en":"C7-T1 junction (cervicothoracic)","zone":"c7-t1","status":"to_confirm","g":["c",865,528,30]},{"id":"caudal","view":"main","kind":"zone","cat":"zone-colonne","lat":"unpaired","fr":"Vertèbres caudales","en":"Caudal vertebrae","zone":"caudal","status":"inherited","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","en":"Sacral vertebrae","zone":"sacral","status":"inherited","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","en":"Lumbar vertebrae","zone":"lumbar","status":"inherited","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","en":"Thoracic vertebrae","zone":"thoracic","status":"inherited","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","en":"Cervical vertebrae","zone":"cervical","status":"inherited","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,"en":null,"status":"inheritLine truncated
+68
View File
@@ -0,0 +1,68 @@
// node gen-data.cjs: writes data.js (window.DOC) from the equine draft document, so every reference, citation
// count, finding name and type of the boards comes from document.json and none is typed by hand.
// Citations are counted as apps/app/src/editor/references/citations.ts does: every finding category and
// every finding node, at any depth, adds one per id of its `reference_ids` (zones cite nothing).
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'))
// Every citing element, in document order (zone, category, nodes depth first).
const citing = []
const walkNodes = (zone, cat, nodes, trail) => {
for (const n of nodes) {
citing.push({ zone: zone.id, zoneFr: zone.name.fr, trail: [cat.name.fr, ...trail], kind: 'node', id: n.id, fr: n.name.fr, refs: n.reference_ids || [] })
walkNodes(zone, cat, n.children || [], [...trail, n.name.fr])
}
}
for (const z of doc.finding_zones) {
for (const c of z.categories) {
citing.push({ zone: z.id, zoneFr: z.name.fr, trail: [], kind: 'category', id: c.id, fr: c.name.fr, refs: c.reference_ids || [] })
walkNodes(z, c, c.children || [], [])
}
}
const counts = new Map()
for (const e of citing) for (const id of e.refs) counts.set(id, (counts.get(id) || 0) + 1)
const references = doc.references.map((r, i) => ({
id: r.id,
index: i,
type: r.type,
citation: r.citation,
url: r.url,
doi: r.doi,
cited: counts.get(r.id) || 0,
citedBy: citing.filter((e) => e.refs.includes(r.id)).map((e) => ({ zone: e.zoneFr, trail: e.trail, fr: e.fr, kind: e.kind })),
}))
const findings = citing.filter((e) => e.refs.length > 0)
.map((e) => ({ zone: e.zone, zoneFr: e.zoneFr, trail: e.trail, fr: e.fr, kind: e.kind, refs: e.refs }))
const node = (n) => ({ id: n.id, fr: n.name.fr, children: (n.children || []).map(node) })
const out = {
name: doc.name,
views: doc.views.map((v) => ({ id: v.id, fr: v.name.fr, parent: v.parent_view_id })),
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,
en: a.name ? a.name.en : null,
zone: a.finding_zone_id,
status: a.review_status || 'inherited',
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, fr: c.name.fr, children: (c.children || []).map(node) })) })),
references,
findings,
citations: [...counts.values()].reduce((s, n) => s + n, 0),
}
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)
const zero = references.filter((r) => r.cited === 0).length
console.log('references', references.length, 'citations', out.citations, 'uncited', zero,
'citing elements', findings.length, 'zones', out.zones.length, 'bytes', body.length)
+807
View File
@@ -0,0 +1,807 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Faunosteo V1-2.6 R0 arbitrages du premier essai (proposition)</title>
<!--
V1-2.6 R0 boards (owner brief 2026-11-09 « Arbitrages du premier essai propriétaire », contract
.claude/tasks/contracts/2026-11-09-v1-2-6-trial-arbitrations.md): static functional mockups, never shipped,
NOT validated. Styles, icons, shell and drawing helpers are copied from docs/design/v1-2-6-constats/maquettes.html
(itself copied from the validated docs/design/v1-2-6/maquettes.html); the editor shell follows the U1 build
(apps/app/src/components/editor). Every reference, citation count, finding name and type comes from data.js,
generated by gen-data.cjs from the equine draft document.json. Staging text is listed in REVUE.md.
Rendered to PNG by ../v1-2-6/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; }
.annot.inline { padding: 4px 9px; font-size: 12px; align-self: flex-start; }
/* 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; }
/* ---------- R0 additions (same tokens, no new colour family) ---------- */
.hbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 9px; border-radius: 6px; font-size: 14px; color: var(--color-ink); white-space: nowrap; }
.hbtn[disabled] { opacity: .4; }
.focus { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.tip { position: absolute; z-index: 9; background: var(--color-ink); color: var(--color-bg); font-size: 12px; line-height: 1.35; padding: 6px 9px; border-radius: 6px; white-space: nowrap; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.clr { width: 28px; height: 28px; margin-left: auto; margin-right: -4px; display: grid; place-items: center; border-radius: 6px; color: var(--color-ink-muted); flex: none; }
.clr.big { width: 44px; height: 44px; margin-right: -10px; }
.sortsel { display: flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }
.sortsel .inp { min-width: 210px; }
.rlist { display: flex; flex-direction: column; gap: 8px; }
.rtile { border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); }
.rtile.open { border-color: var(--color-border); box-shadow: 0 2px 8px rgba(31,27,22,.06); }
.rhead { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; min-height: 44px; }
.rhead .chev { width: 24px; height: 24px; display: grid; place-items: center; flex: none; color: var(--color-ink-muted); margin-top: -1px; }
.rcit { flex: 1; min-width: 0; font-size: 14px; line-height: 1.45; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rmeta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; width: 168px; }
.rmeta .cnt { font-size: 12px; color: var(--color-ink-muted); white-space: nowrap; }
.rbody { border-top: 1px solid var(--color-border); padding: 12px 16px 14px 48px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.rdl { display: grid; grid-template-columns: 76px 1fr; gap: 6px 10px; margin: 0; }
.rdl dt { color: var(--color-ink-muted); }
.rdl dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcited .lrow { min-height: 32px; border-top: 1px solid var(--color-surface-strong); }
.rcited .path { color: var(--color-ink-muted); }
.ractions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ractions .sep { width: 1px; height: 22px; background: var(--color-border); margin: 0 2px; }
.rtile.ph .rhead { flex-wrap: wrap; padding: 10px 12px; }
.rtile.ph .rmeta { width: auto; flex-direction: row; align-items: center; gap: 8px; padding-left: 34px; flex-basis: 100%; }
.rtile.ph .rbody { padding: 12px 12px 14px 12px; }
.rtile.ph .rdl { grid-template-columns: 52px 1fr; }
.ph-body > * { flex-shrink: 0; }
.scrollbar { position: absolute; right: 2px; width: 5px; border-radius: 3px; background: rgba(31,27,22,.25); }
.pbody { flex: 1; min-height: 0; padding: 26px 32px; display: flex; flex-direction: column; gap: 16px; overflow: hidden; }
h1.big { font: 400 30px/1.2 var(--font-serif); margin: 0; }
.srow { display: flex; flex-direction: column; gap: 3px; padding: 11px 16px; border-top: 1px solid var(--color-border); }
.srow:first-child { border-top: 0; }
.srow .l1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.srow .l1 b { font-weight: 500; }
.srow .l2 { font-size: 13px; color: var(--color-ink-muted); }
.srow .date { margin-left: auto; font-size: 13px; color: var(--color-ink-muted); white-space: nowrap; }
.mini { position: relative; width: 250px; height: 170px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-bg); overflow: hidden; }
.mini .blk { position: absolute; background: var(--color-surface-strong); border-radius: 4px; }
.mini .scr { position: absolute; left: 0; right: 0; bottom: 0; top: 46px; background: rgba(31,27,22,.25); }
.mini .pan { position: absolute; top: 46px; bottom: 0; right: 0; width: 140px; background: var(--color-surface); border-left: 1px solid var(--color-border); box-shadow: -8px 0 18px rgba(31,27,22,.12); }
.mini .pan i { display: block; height: 8px; margin: 10px 12px 0; border-radius: 3px; background: var(--color-surface-strong); }
.ccard { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 16px; box-shadow: 0 1px 2px rgba(31,27,22,.05); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.ccard h2 { font: 400 20px/1.25 var(--font-serif); margin: 0; }
table.esc { border-collapse: collapse; width: 100%; font-size: 13px; }
table.esc th, table.esc td { border-bottom: 1px solid var(--color-border); padding: 7px 8px; text-align: left; vertical-align: top; }
table.esc th { font-size: 12px; color: var(--color-ink-muted); font-weight: 600; }
table.esc td.n { font-weight: 700; color: var(--color-accent-strong); width: 22px; }
</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>
<symbol id="i-external" viewBox="0 0 24 24"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></symbol>
<symbol id="i-sort" viewBox="0 0 24 24"><path d="M7 4v16M7 20l-3-3M7 20l3-3M17 20V4M17 4l-3 3M17 4l3 3"/></symbol>
<symbol id="i-deselect" viewBox="0 0 24 24"><path d="M4 8V5a1 1 0 0 1 1-1h3M16 4h3a1 1 0 0 1 1 1v3M20 16v3a1 1 0 0 1-1 1h-3M8 20H5a1 1 0 0 1-1-1v-3M9 9l6 6M15 9l-6 6"/></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
// A trigger without a name shows its view's name, as the core does (index_data.rs:39).
const nameOf = (a) => a.fr || 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
}
/* ---------- editor stage helpers, copied unchanged ---------- */
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 = DOC.views[0].fr) => `<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>`
/* ---------- R0 shell: U1 as built (DraftHeader, EditorTabs, HistoryButtons, SaveLine) + the R0 changes ---------- */
const NAV = [['dashboard','Tableau de bord'],['users','Clients'],['paw','Animaux'],['book','Fiches anatomiques'],['HR'],['shield','Administration'],['HR'],['user','Mon compte'],['tool','Outil de bilan']]
const ico = (n, c = '') => `<svg class="icon ${c}" aria-hidden="true"><use href="#i-${n}"/></svg>`
// noAdmin: an account without capability (board 01 v1-2-4) has no « Administration » entry.
const side = (on = 'Administration', noAdmin = false) => `<aside class="side"><div class="logo"><img src="${LOGO}" alt="Faunosteo"></div><nav class="nav">${NAV.filter(([, l], k) => !noAdmin || (l !== 'Administration' && k !== 4)).map(([i, l]) => i === 'HR' ? '<hr>' : `<a class="${l === on ? 'on' : ''}">${ico(i)}${l}</a>`).join('')}</nav><div class="foot muted">Se déconnecter</div></aside>`
const ME = `<span class="me"><span class="avatar">BC</span>Bastien Chanot</span>`
// R0: five tabs, Références between Constats and Vérification (owner brief §1).
const TABS = ['Général', 'Annotations', 'Constats', 'Références', 'Vérification']
// R0 §2: « Défaire » / « Refaire »; name = aria-label, title adds the real shortcut (useUndoShortcuts.ts: Ctrl+Z, Ctrl+Maj+Z, no Ctrl+Y).
const HIST = {
undo: ['undo', 'Défaire', 'Défaire la dernière modification', 'Ctrl+Z ou ⌘Z'],
redo: ['redo', 'Refaire', 'Refaire la dernière modification défaite', 'Ctrl+Maj+Z ou ⇧⌘Z'],
}
const hbtn = (k, o = {}) => { const [i, l, n, s] = HIST[k]; return `<span class="hbtn ${o.focus ? 'focus' : ''}" title="${n} (${s})"${o.off ? ' disabled' : ''}>${ico(i, 'sm')}${o.iconOnly ? '' : l}</span>` }
const hist = (o = {}) => `<span style="margin-left:auto;align-self:center;display:flex;gap:4px;padding-bottom:3px;position:relative">${hbtn('undo', { focus: o.focusUndo, off: o.ro })}${hbtn('redo', { off: true })}${o.tip ? `<span style="position:absolute;top:24px;left:58px;z-index:10">${ico('cursor', 'sm')}</span><span class="tip" style="top:44px;right:60px">${HIST.undo[2]} (${HIST.undo[3]})</span>` : ''}</span>`
function tabs(on, o = {}) {
return '<div class="tabs">' + TABS.map(t => `<a class="${t === on ? 'on' : ''}">${t}${t === 'Vérification' ? ' <span class="badge danger">2 erreurs</span>' : ''}</a>`).join('') + hist(o) + '</div>'
}
const UNSAVED = '3 modifications non enregistrées'
function saveLine(o = {}) {
if (o.ro) return `<span class="s13 muted" style="white-space:nowrap">Révision 11</span>`
return `<span class="s13 muted" style="white-space:nowrap">${o.unsaved || UNSAVED}</span><span class="btn secondary sm">Abandonner les modifications</span><span class="btn primary sm">Enregistrer</span>`
}
// R0: no « Références » button in the header any more (owner brief §1).
function header(o = {}) {
return `<div class="ehead"><h1 class="page">Brouillon, version 4</h1><span class="badge">Brouillon</span><span class="badge">Copie de travail</span>${o.ro ? `<span class="badge">${ico('lock', 'sm')}Lecture seule</span>` : ''}
<span style="margin-left:auto;display:flex;gap:8px;align-items:center">${saveLine(o)}</span></div>`
}
const CRUMB = 'Administration › Fiches officielles › Cheval, squelette et rachis › <b>Brouillon, version 4</b>'
function editor(o) {
return `<div class="frame desk" style="height:${o.h || 800}px">${side()}<div class="main">
<div class="top"><span class="crumb">${CRUMB}</span>${ME}</div>
${header(o)}${o.notice ? `<div style="padding:8px 24px 0">${o.notice}</div>` : ''}${tabs(o.tab, o)}
<div class="work">${o.body}</div>${o.overlay || ''}</div></div>`
}
function pageFrame(o) {
return `<div class="frame desk" style="height:${o.h || 800}px;${o.w ? `width:${o.w}px` : ''}">${o.noSide ? '' : side(o.nav, o.noAdmin)}<div class="main">
<div class="top"><span class="crumb" style="color:var(--color-ink)">${o.crumb}</span>${o.me || ME}</div>
<div class="pbody">${o.body}</div></div></div>`
}
const note = (html, style = '') => `<div class="annot" style="${style}">${html}</div>`
const vframe = (w, h, inner, style = '') => `<div class="frame" style="width:${w}px;height:${h}px;display:flex;flex-direction:column;gap:10px;padding:14px;${style}">${inner}</div>`
/* ---------- references (all from DOC.references, generated) ---------- */
const TYPE = { book: 'Livre', journal: 'Article de revue', standard: 'Norme', legal: 'Texte juridique', web: 'Site web', manual: 'Manuel' }
const REFS = DOC.references
const refById = Object.fromEntries(REFS.map((r) => [r.id, r]))
const coll = new Intl.Collator('fr', { sensitivity: 'base' })
const SORTS = {
doc: ['Ordre de la fiche', (a, b) => a.index - b.index],
az: ['Citation (A → Z)', (a, b) => coll.compare(a.citation, b.citation) || a.index - b.index],
count: ['Nombre de citations', (a, b) => b.cited - a.cited || a.index - b.index],
type: ['Type', (a, b) => coll.compare(TYPE[a.type], TYPE[b.type]) || a.index - b.index],
}
// Same match as editor/references/filter.ts: citation, DOI and URL, folded.
const refMatch = (r, q) => !q || [r.citation, r.doi || '', r.url || ''].some((f) => fold(f).includes(fold(q.trim())))
const shown = (q, sort) => REFS.filter((r) => refMatch(r, q)).sort(SORTS[sort][1])
// Existing wording editor.references.cited_* (« citée {count} fois »): the count includes families.
const citedTxt = (n) => n === 0 ? 'Non citée' : `Citée ${n} fois`
const UNCITED = REFS.filter((r) => r.cited === 0).length
const ellip = 'min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap'
function citedRows(r, o = {}) {
if (!r.cited) return `<div class="small muted">Aucun constat ni aucune famille ne cite cette référence.</div>`
const h = o.ph ? 'min-height:44px;' : ''
const cur = (c) => o.current && c.zone === o.current.zoneFr && c.fr === o.current.fr
return `<div class="rcited"><div style="font-weight:600;margin-bottom:2px">${citedTxt(r.cited)}, par :</div>${r.citedBy.map((c) =>
`<div class="lrow" style="${h}align-items:flex-start;padding:4px 0"><span style="min-width:0;flex:1"><span class="path">${[c.zone, ...c.trail].map(short).join(' › ')} › </span>${c.fr}${c.kind === 'category' ? ' <span class="badge">famille</span>' : ''}${cur(c) ? ' <span class="badge accent">ce constat</span>' : ''}</span><a class="lnk r" style="white-space:nowrap${o.ph ? ';min-height:44px;display:inline-flex;align-items:center' : ''}">Aller à</a></div>`).join('')}</div>`
}
// One reference tile. o: open, q (highlight), ro, move (show Monter / Descendre), panel, ph (phone), focus, edit.
function tile(r, o = {}) {
const cit = r.citation
const meta = `<div class="rmeta" style="${o.metaW ? `width:${o.metaW}px` : ''}"><span class="badge">${TYPE[r.type]}</span><span class="cnt">${citedTxt(r.cited)}</span></div>`
const head = `<div class="rhead ${o.focus ? 'focus' : ''}" style="${o.focus ? 'border-radius:11px' : ''}"><span class="chev">${ico(o.open ? 'down' : 'chevron', 'sm')}</span><div class="rcit ${o.open ? '' : 'clamp2'}">${cit}</div>${meta}</div>`
if (!o.open) return `<div class="rtile ${o.ph ? 'ph' : ''}">${head}</div>`
const ext = (t) => `<a class="lnk" style="display:inline-flex;gap:4px;align-items:center;max-width:100%"><span style="overflow:hidden;text-overflow:ellipsis">${t}</span>${ico('external', 'sm')}</a>`
const dl = `<dl class="rdl"><dt>Type</dt><dd>${TYPE[r.type]}</dd><dt>DOI</dt><dd>${r.doi ? ext(r.doi) : '<span class="muted">Aucun</span>'}</dd><dt>URL</dt><dd>${r.url ? ext(r.url) : '<span class="muted">Aucune</span>'}</dd></dl>`
let actions = ''
if (!o.ro) {
actions = `<div class="ractions"><span class="btn secondary sm">${ico('pen', 'sm')}Modifier</span>${o.panel ? `<span class="btn secondary sm">${ico('minus', 'sm')}Retirer de ce constat</span>` : `<span class="btn dangertxt sm">${ico('trash', 'sm')}Supprimer</span>`}`
if (o.move) actions += `<span class="sep"></span><span class="btn secondary sm"${r.index === 0 ? ' disabled' : ''}>${ico('up', 'sm')}Monter</span><span class="btn secondary sm"${r.index === REFS.length - 1 ? ' disabled' : ''}>${ico('down', 'sm')}Descendre</span>`
actions += '</div>'
}
return `<div class="rtile open ${o.ph ? 'ph' : ''}">${head}<div class="rbody">${dl}${citedRows(r, o)}${actions}</div></div>`
}
function searchBox(o = {}) {
const h = o.ph ? 'height:44px;' : ''
const inner = o.q
? `${ico('search', 'sm')}<span>${o.q}</span><span class="clr ${o.ph ? 'big' : ''} ${o.focusClear ? 'focus' : ''}" title="Effacer la recherche">${ico('close', 'sm')}</span>`
: `${ico('search', 'sm')}<span class="muted">Rechercher une référence</span>`
return `<span class="inp ${o.focusField ? 'focus' : ''}" style="${h}width:${o.w || 340}px;padding-right:${o.q ? 4 : 10}px">${inner}</span>`
}
// A native <select> with its external label « Trier par », drawn closed (same control as the admin filters).
function sortBox(sort, o = {}) {
if (o.ph) return `<div class="field" style="width:100%"><label>Trier par</label><span class="inp ${o.focus ? 'focus' : ''}" style="height:44px">${SORTS[sort][0]}<span class="caret">${ico('down', 'sm')}</span></span></div>`
return `<span class="sortsel"><span>Trier par</span><span class="inp ${o.focus ? 'focus' : ''}">${SORTS[sort][0]}<span class="caret">${ico('down', 'sm')}</span></span></span>`
}
const countTxt = (n, q) => q ? `${pl(n, 'référence', 'références')} sur ${REFS.length}` : pl(n, 'référence', 'références')
function refBar(o = {}) {
const list = shown(o.q, o.sort || 'doc')
return `<div class="sbar" style="flex-wrap:wrap">${searchBox(o)}${sortBox(o.sort || 'doc', { focus: o.focusSort })}<span class="count">${countTxt(list.length, o.q)}</span>
${o.ro ? '' : `<span style="margin-left:auto"><span class="btn secondary sm">${ico('plus', 'sm')}Ajouter une référence</span></span>`}</div>`
}
const HINT = `<div class="s13 muted" style="display:flex;gap:6px;align-items:center">${ico('info', 'sm')}Pour réorganiser, affichez l'ordre de la fiche sans recherche.</div>`
// Staging line (not interface text): yellow annotation style.
const ROW_MORE = (txt) => `<div class="annot inline">${txt}</div>`
</script>
<!-- ================================================================== 23 references tab -->
<div class="row"><div data-board="23-references-onglet-desktop">
<p class="sheet-title">23. Onglet « Références » (cinquième onglet, entre Constats et Vérification) : tuiles repliables, recherche, tri, ordre de la fiche par défaut (1 280 px, mode édition)</p>
<div id="b23"></div></div></div>
<script>
{
const list = shown('', 'doc'), OPEN = refById['white-2022'], at = list.indexOf(OPEN)
const part = list.slice(at - 2, at + 3)
const body = `<div style="flex:1;min-width:0;display:flex;flex-direction:column;gap:10px;position:relative">
<div class="lrow" style="min-height:0"><h2 class="sec" style="margin:0">Références</h2></div>
${refBar({ focusSort: true })}
<div style="position:relative;flex:1;min-height:0;overflow:hidden;padding-right:12px">
<div class="scrollbar" style="top:${Math.round(at / list.length * 100)}%;height:14%"></div>
<div class="rlist">${ROW_MORE(`⋮ ${pl(at - 2, 'référence', 'références')} au-dessus (liste défilée)`)}${part.map((r) => tile(r, { open: r === OPEN || r.id === 'jakel-2011', move: true })).join('')}${ROW_MORE(`⋮ ${pl(list.length - at - 3, 'référence', 'références')} en dessous`)}</div></div></div>`
document.getElementById('b23').innerHTML = editor({ tab: 'Références', h: 1090, body })
+ `<div style="display:flex;gap:12px;margin-top:10px;width:1280px">${note(`<b>Tuiles :</b> fermée = citation sur deux lignes au plus (coupée), type, « Citée N fois » (libellé actuel, familles comprises) ou « Non citée ». Ouverte = citation entière, type, DOI et URL (liens externes, nouvel onglet), constats et familles qui la citent (une famille porte la marque « famille ») avec « Aller à », actions. L'en-tête de tuile est un bouton (aria-expanded) de 44 px ; plusieurs tuiles peuvent rester ouvertes. Comptes calculés comme <span class="mono">citations.ts</span> (familles et constats à toute profondeur) : ${DOC.citations} citations, ${UNCITED} références non citées sur ${REFS.length}. Ici deux tuiles ouvertes : « Jäkel… », citée par une famille seulement, et « ${short(OPEN.citation.split('.')[0])} », ${OPEN.index + 1}e de la fiche (liste défilée).`, 'flex:1')}
${note(`<b>Tri :</b> « Ordre de la fiche » par défaut, puis « Citation (A → Z) », « Nombre de citations » (décroissant), « Type » ; à égalité, l'ordre de la fiche. Liste native (select) avec son étiquette « Trier par », focus clavier montré. Le tri ne modifie jamais le document. « Monter » / « Descendre » n'existent qu'en ordre de la fiche sans recherche (une modification chacun, annulable). « Supprimer » une référence citée reste refusé par le cœur (dialogue existant qui liste les constats). <b>En-tête :</b> plus de bouton « Références » ; « Défaire » / « Refaire ». La recherche est vide : le bouton « Effacer la recherche » apparaît dès la saisie (planche 24). « Ajouter une référence » : en mode édition sur toute vue de l'onglet (planche 24 E). Les lignes jaunes « ⋮ … » sont des annotations de la planche, pas du texte d'interface.`, 'flex:1')}</div>`
}
</script>
<!-- ================================================================== 24 search, sort, states -->
<div class="row"><div data-board="24-references-recherche-tri">
<p class="sheet-title">24. Onglet « Références » : recherche et tri A → Z, aucun résultat, lecture seule, modification en cours gardée entre onglets</p>
<div id="b24" style="display:grid;grid-template-columns:repeat(2,640px);gap:20px"></div></div></div>
<script>
{
const Q = 'ostéopathie', res = shown(Q, 'az')
const a = `<div class="vign"><div class="lbl">A. Recherche « ${Q} », tri « Citation (A → Z) » : pas de réorganisation</div>${vframe(640, 700, `
<div class="sbar" style="flex-wrap:wrap">${searchBox({ q: Q, w: 300, focusClear: true })}${sortBox('az')}</div>
<div class="lrow"><span class="count">${countTxt(res.length, Q)}</span><span class="r"><span class="btn secondary sm">${ico('plus', 'sm')}Ajouter une référence</span></span></div>
${HINT}
<div class="rlist">${res.map((r) => tile(r, { q: Q, metaW: 150 })).join('')}</div>`)}</div>`
const NQ = 'radiographie'
const b = `<div class="vign"><div class="lbl">B. Aucun résultat</div>${vframe(640, 250, `
<div class="sbar">${searchBox({ q: NQ, w: 300 })}${sortBox('doc')}</div>
<div class="lrow"><span class="count">${countTxt(shown(NQ, 'doc').length, NQ)}</span><span class="r"><span class="btn secondary sm">${ico('plus', 'sm')}Ajouter une référence</span></span></div>
<div class="notice info">${ico('info', 'sm')}<div><b>Aucune référence ne contient « ${NQ} ».</b> La recherche porte sur la citation, le DOI et l'URL.<div style="margin-top:8px"><span class="btn secondary sm">${ico('close', 'sm')}Effacer la recherche</span></div></div></div>`)}</div>`
const RO = refById['haussler-2021']
const c = `<div class="vign"><div class="lbl">C. Lecture seule (habilitations, revue en cours, fiche historique, moins de 1 024 px)</div>${vframe(640, 520, `
<div class="notice info">${ico('info', 'sm')}<div><b>Vos habilitations ne permettent pas de modifier ce brouillon. Il reste consultable.</b></div></div>
<div class="sbar">${searchBox({ w: 300 })}${sortBox('doc')}<span class="count">${countTxt(REFS.length)}</span></div>
<div class="rlist">${tile(shown('', 'doc')[RO.index - 1], {})}${tile(RO, { open: true, ro: true })}</div>`)}</div>`
const ED = refById['carmalt-2013']
const form = `<div class="rtile open"><div class="rhead"><span class="chev">${ico('down', 'sm')}</span><div class="rcit"><b style="font-weight:600">Modifier la référence</b></div><div class="rmeta" style="width:150px"><span class="cnt">${citedTxt(ED.cited)}</span></div></div>
<div class="rbody" style="padding-left:16px">
<div class="grid2"><div class="field"><label>Type</label><span class="inp">${TYPE[ED.type]}<span class="caret">${ico('down', 'sm')}</span></span></div><div class="field"><label>DOI</label><span class="inp muted">Aucun</span></div></div>
<div class="field"><label>Citation</label><span class="inp area focus">${ED.citation}</span></div>
<div class="field"><label>Adresse web (URL)</label><span class="inp">${ED.url}</span></div>
${citedRows(ED)}
<div class="ractions"><span class="btn secondary sm">Terminer</span><span class="small muted">Chaque champ s'applique au brouillon quand il perd le focus, comme aujourd'hui.</span></div></div></div>`
const d = `<div class="vign"><div class="lbl">D. Modification en cours : rien n'est perdu en changeant d'onglet (vue recadrée)</div>${vframe(640, 740, `
<div class="lrow" style="justify-content:flex-end;gap:8px">${saveLine({ unsaved: '2 modifications non enregistrées' })}</div>
<div class="tabs" style="padding:0;margin:0">${TABS.map((t) => `<a class="${t === 'Références' ? 'on' : ''}">${t}</a>`).join('')}</div>
${form}
${note(`Aller sur « Constats » puis revenir : la tuile est toujours ouverte en modification, au même endroit, avec la recherche et le tri choisis. Les champs déjà appliqués sont dans le brouillon (« 2 modifications non enregistrées ») ; rien n'est enregistré sur le serveur avant « Enregistrer ». « Défaire » retire la dernière modification, champ par champ. En modification, la tuile garde « Citée 2 fois, par » et ses « Aller à » ; « Supprimer », « Monter » et « Descendre » sont masqués jusqu'à « Terminer ». Vue recadrée : en-tête, « Défaire » / « Refaire » et « 2 erreurs » omis.`)}`)}</div>`
const last = shown('', 'doc')[REFS.length - 1]
const add = `<div class="rtile open"><div class="rhead"><span class="chev">${ico('down', 'sm')}</span><div class="rcit"><b style="font-weight:600">Nouvelle référence</b></div><div class="rmeta" style="width:150px"><span class="cnt">Non citée</span></div></div>
<div class="rbody" style="padding-left:16px">
<div class="grid2"><div class="field"><label>Type</label><span class="inp muted">Choisir…<span class="caret">${ico('down', 'sm')}</span></span></div><div class="field"><label>DOI</label><span class="inp"></span></div></div>
<div class="field"><label>Citation</label><span class="inp area focus"></span></div>
<div class="field"><label>Adresse web (URL)</label><span class="inp"></span></div>
<div class="ractions"><span class="btn primary sm">Ajouter la référence</span><span class="small muted">Type et citation obligatoires.</span></div></div></div>`
const e = `<div class="vign"><div class="lbl">E. « Ajouter une référence » : nouvelle tuile en fin de fiche</div>${vframe(640, 560, `
${refBar({ w: 230 })}
${ROW_MORE(`⋮ ${pl(REFS.length - 1, 'référence', 'références')} au-dessus (recherche et tri remis à zéro, liste défilée jusqu'à la fin)`)}
<div class="rlist">${tile(last, {})}${add}</div>`)}</div>`
document.getElementById('b24').innerHTML = a + `<div style="display:flex;flex-direction:column;gap:20px">${b}${c}</div>` + d
+ `<div style="display:flex;flex-direction:column;gap:20px">${e}<div class="vign" style="align-self:start">${note(`<b>A :</b> ${pl(res.length, 'référence contient', 'références contiennent')} « ${Q} » (citation, DOI ou URL, sans tenir compte des accents ni de la casse), dont ${pl(res.filter((r) => !r.cited).length, 'non citée', 'non citées')}. Tri A → Z selon l'ordre alphabétique français. Pas de « Monter » / « Descendre » : une ligne d'aide les remplace. Focus clavier sur « Effacer la recherche » : il vide le champ et rend le focus au champ.<br><b>B :</b> « Effacer la recherche » est aussi proposé dans le message. <b>C :</b> notice de mode existante (ModeNotice) ; DOI, URL et « Aller à » restent ; ni ajout, ni modification, ni suppression, ni réorganisation. <b>D :</b> « Terminer » (nouveau) referme le formulaire de la tuile ; les champs restent ceux d'aujourd'hui. <b>E :</b> le bouton vide la recherche, remet « Ordre de la fiche », ouvre une tuile vide à la fin de la liste (la place de la nouvelle référence dans la fiche), focus sur « Citation ». « Ajouter la référence » (libellé existant) la crée en une modification ; la tuile reste ouverte. Aucun surlignage des résultats : la recherche filtre seulement.`)}</div></div>`
}
</script>
<!-- ================================================================== 25 contextual panel from a finding -->
<div class="row"><div data-board="25-volet-references-constat">
<p class="sheet-title">25. Volet contextuel ouvert depuis un constat : ses seules citations, « Tout afficher dans l'onglet Références », largeur min(34 rem, place disponible), glissement 150 à 200 ms</p>
<div id="b25"></div></div></div>
<script>
{
const F = DOC.findings.slice().sort((a, b) => b.refs.length - a.refs.length)[0]
const zone = DOC.zones.find((z) => z.id === F.zone)
const refs = F.refs.map((id) => refById[id])
const OPEN = refs.find((r) => r.doi && !r.url) || refs[0]
// Background: the Constats tab as built (tree + detail), under the scrim.
const fam = zone.families.find((f) => f.fr === F.trail[0])
const tree = `<div class="pcard tree" style="flex:1;min-width:0;overflow:hidden">
<div class="lrow" style="font-weight:600">${ico('down', 'sm')}${zone.fr}</div>
<div class="lrow" style="padding-left:22px;font-weight:600">${ico('down', 'sm')}${fam.fr}</div>
${fam.children.map((n) => `<div class="lrow" style="padding-left:44px${n.fr === F.fr ? ';background:var(--color-surface-strong);border-radius:8px' : ''}">${ico('chevron', 'sm')}${n.fr}</div>`).join('')}
${zone.families.filter((f) => f !== fam).map((f) => `<div class="lrow" style="padding-left:22px;font-weight:600">${ico('chevron', 'sm')}${f.fr}</div>`).join('')}</div>`
const detail = `<div class="pcard" style="width:360px;flex:none"><div class="small muted">${zone.fr} › ${fam.fr}</div><div class="phead" style="font-size:15px">${F.fr}</div>
<div class="lrow"><b class="s13">Références citées</b><span class="r chip on">${ico('book', 'sm')}${pl(refs.length, 'référence', 'références')}</span></div>
${refs.slice(0, 4).map((r) => `<div class="small clamp2">${r.citation}</div>`).join('')}</div>`
const PW = 544
const panel = `<div class="fpanel" style="top:151px;width:${PW}px;gap:10px;overflow:hidden">
<div class="phead" style="font:400 19px var(--font-serif)">${ico('book')}Références citées<span class="r" style="width:44px;height:44px;display:grid;place-items:center;margin:-10px -8px -10px auto" title="Fermer les références">${ico('close')}</span></div>
<div class="s13"><span class="muted">${zone.fr} › ${F.trail.join(' › ')} › </span><b style="font-weight:600">${F.fr}</b></div>
<div class="lrow"><span class="count">${pl(refs.length, 'référence citée', 'références citées')} par ce constat</span><span class="r"><a class="lnk s13" style="display:inline-flex;gap:4px;align-items:center;min-height:44px">Tout afficher dans l'onglet Références${ico('chevron', 'sm')}</a></span></div>
<div class="rlist" style="position:relative;padding-right:10px"><div class="scrollbar" style="top:0;height:55%"></div>${refs.map((r) => tile(r, { open: r === OPEN, panel: true, metaW: 132, current: F })).join('')}</div></div>`
const scrim = `<div style="position:absolute;left:0;right:0;bottom:0;top:151px;background:rgba(31,27,22,.25)"></div>`
const main = editor({ tab: 'Constats', h: 940, body: `<div style="flex:1;display:flex;gap:12px;min-height:0">${tree}${detail}</div>`, overlay: scrim + panel })
// Motion strip.
const mini = (shift, scrim, label, o = {}) => `<div class="vign" style="width:250px"><div class="lbl" style="font-weight:500;min-height:36px">${label}</div><div class="mini">
<div class="blk" style="left:10px;top:10px;width:120px;height:12px"></div><div class="blk" style="left:10px;top:30px;width:200px;height:8px"></div>
<div class="blk" style="left:10px;top:58px;width:140px;height:100px"></div><div class="blk" style="left:160px;top:58px;width:80px;height:100px"></div>
<div class="scr" style="opacity:${scrim}"></div>
<div class="pan" style="transform:translateX(${shift}%);opacity:${o.op ?? 1}"><i style="width:60%"></i><i></i><i style="width:80%"></i><i></i><i style="width:70%"></i></div></div></div>`
const strip = `<div style="display:flex;gap:14px;align-items:flex-end">
${mini(100, 0, '0 ms : clic sur « 7 références »')}${mini(22, .7, '≈ 90 ms : le volet glisse depuis la droite')}${mini(0, 1, '180 ms : en place, focus sur son titre')}
<span style="width:1px;align-self:stretch;background:var(--color-border)"></span>${mini(0, 1, 'prefers-reduced-motion : apparition sans glissement', { op: 1 })}</div>`
const trigger = `<div class="vign"><div class="lbl">Déclencheur (détail du constat, sous le voile)</div><div class="pcard" style="width:360px">
<div class="lrow"><b class="s13">Références citées</b><span class="r"><span class="chip on focus" style="height:44px">${ico('book', 'sm')}${pl(refs.length, 'référence', 'références')}</span></span></div>
<div class="small muted">Bouton existant (« ${pl(refs.length, 'référence', 'références')} ») : aria-expanded vaut true tant que le volet est ouvert. À la fermeture (croix, Échap, voile), le focus y revient.</div></div></div>`
document.getElementById('b25').innerHTML = main
+ `<div style="display:flex;gap:20px;margin-top:14px;width:1580px;align-items:flex-start">${trigger}<div class="vign"><div class="lbl">Mouvement</div>${strip}
${note('<b>150 à 200 ms, sortie plus courte</b> (proposé : entrée 180 ms en décélération, sortie 140 ms en accélération), translation horizontale seule, voile en fondu sur la même durée. Avec prefers-reduced-motion : apparition sans glissement (volet et voile affichés d\'un coup), même chose à la fermeture.', 'width:1100px')}</div></div>`
+ `<div style="display:flex;gap:12px;margin-top:12px;width:1280px">${note(`<b>Contenu :</b> les ${pl(refs.length, 'référence citée', 'références citées')} par « ${F.fr} » (${zone.fr}), le constat du brouillon qui en cite le plus. Mêmes tuiles que l'onglet ; actions « Modifier » et « Retirer de ce constat » (retire la citation du constat : une modification ordinaire, annulable ; la référence reste dans la fiche), constats cités avec « Aller à », le constat courant marqué « ce constat » ; pas de « Supprimer » (toujours refusé ici : chaque référence du volet est citée par le constat) ; ni « Monter » / « Descendre », ni ajout (on cite une référence depuis le détail du constat). « Tout afficher dans l'onglet Références » ferme le volet et ouvre l'onglet, recherche et tri remis à zéro, focus sur son titre. Volet défilant ; la page derrière est inerte.`, 'flex:1')}
${note(`<b>Largeur :</b> min(34 rem, place disponible) = ${PW} px ici (27 rem aujourd'hui). À 1 024 px de fenêtre, l'éditeur n'a pas de barre latérale (elle n'apparaît qu'à 1 280 px, ShellChrome.tsx) : la zone de contenu fait 960 px, le volet garde ses 544 px et le voile couvre les 416 px restants. Sous 640 px (téléphone), il prend toute la largeur.`, 'flex:1')}</div>`
}
</script>
<!-- ================================================================== 26 history labels and deselect -->
<div class="row"><div data-board="26-historique-deselection">
<p class="sheet-title">26. Historique « Défaire » / « Refaire » et « Désélectionner » près de « Supprimer » ; touche Échap ; distinction avec le « Annuler » des dialogues</p>
<div id="b26"></div></div></div>
<script>
{
const STIFLE = ANN.find((a) => a.id === 'stifle')
const zone = DOC.zones.find((z) => z.id === STIFLE.zone)
const catName = DOC.categories.find((c) => c.id === STIFLE.cat).fr
const LAT = { bilateral: 'Bilatérale', left: 'Gauche', right: 'Droite', unpaired: 'Non latéralisée' }
const ST = { to_confirm: ['warn', 'À confirmer'], reviewed: ['ok', 'Relu'], inherited: ['', 'Hérité, non relu'] }
const ring = (a, u) => a.g[0] === 'c' ? `<circle cx="${a.g[1]}" cy="${a.g[2]}" r="${a.g[3] + 6 * u}" fill="none" stroke="#1f1b16" stroke-width="${2.5 * u}"/>` : ''
const props = (o = {}) => `<div class="pcard" style="gap:10px;${o.w ? `width:${o.w}px` : ''}">
<span class="btn secondary sm" style="align-self:flex-start">Toutes les annotations</span>
<div class="phead">${ico('point', 'sm')}Point<span class="r badge ${ST[STIFLE.status][0]}">${ST[STIFLE.status][1]}</span></div>
<div class="grid2"><div class="field"><label>Nom (FR)</label><span class="inp">${STIFLE.fr}</span></div><div class="field"><label>Nom (EN)</label><span class="inp">${STIFLE.en}</span></div></div>
<div class="grid2"><div class="field"><label>Catégorie</label><span class="inp">${sw(CATS.art.c, CATS.art.o)}${catName}${o.ro ? '' : `<span class="caret">${ico('down', 'sm')}</span>`}</span></div><div class="field"><label>Latéralité</label><span class="inp">${LAT[STIFLE.lat]}${o.ro ? '' : `<span class="caret">${ico('down', 'sm')}</span>`}</span></div></div>
<div class="field"><label>Zone de constats</label><span class="inp">${zone.fr}</span></div>
<div class="field"><label>Position et rayon</label><div style="display:grid;grid-template-columns:repeat(3,1fr);gap:8px">${[['Centre x', STIFLE.g[1]], ['Centre y', STIFLE.g[2]], ['Rayon', STIFLE.g[3]]].map(([l, v]) => `<div class="field"><span class="small muted">${l}</span><span class="inp">${v}</span></div>`).join('')}</div></div>
${o.ro ? '' : '<span class="btn secondary sm" style="align-self:flex-start">Marquer comme relu</span>'}
<div style="border-top:1px solid var(--color-border);padding-top:10px;display:flex;gap:8px;flex-wrap:wrap"><span class="btn secondary sm">${ico('deselect', 'sm')}Désélectionner</span>${o.ro ? '' : `<span class="btn dangertxt sm">${ico('trash', 'sm')}Supprimer</span>`}</div></div>`
const stage = `<div class="stage">${toolbar('sel')}<div class="canvas">${drawing({ w: 640, h: 560, extra: (u) => ring(STIFLE, u) })}${zoom('Ajusté')}</div></div>`
const main = editor({ tab: 'Annotations', tip: true, body: stage + `<div class="panel" style="width:360px">${props()}</div>` })
const dialog = `<div class="vign"><div class="lbl">A. Dialogue de confirmation : son « Annuler » ferme le dialogue sans rien faire</div>
<div class="frame" style="width:420px;height:240px;position:relative;background:rgba(31,27,22,.42);display:grid;place-items:center">
<div class="dialog" style="width:360px"><div style="font:400 19px var(--font-serif)">Supprimer « ${STIFLE.fr} » ?</div>
<div class="s14">Supprimer « ${STIFLE.fr} » du brouillon ?</div>
<div style="display:flex;gap:8px;justify-content:flex-end"><span class="btn secondary sm">Annuler</span><span class="btn sm" style="background:var(--color-danger);color:#fff">Supprimer</span></div></div></div>
<div class="small muted" style="width:420px">Libellés existants (editor.delete.*). « Défaire » agit sur le brouillon ; « Annuler » d'un dialogue n'agit que sur le dialogue : les deux mots ne se croisent plus.</div></div>`
const rows = [
['Dialogue ouvert', 'ferme le dialogue (comme « Annuler »)', 'Dialogue natif (D13)'],
['Menu ouvert', 'ferme le menu, focus sur son bouton', 'Menu « Plus » (moins de 640 px)'],
['Volet contextuel', 'ferme le volet, focus sur son déclencheur', 'Références d\'un constat, filtre du schéma'],
['Tracé en cours', 'abandonne le tracé (rien n\'est créé)', 'Ajouter une zone, redessiner'],
['Sélection', 'désélectionne', 'Annotation, sommet ou poignée choisie'],
]
const esc = `<div class="vign"><div class="lbl">B. Touche Échap : la première situation qui s'applique la consomme</div><div class="frame" style="width:560px;padding:12px 14px">
<table class="esc"><tr><th></th><th>Situation</th><th>Échap</th><th>Exemples</th></tr>${rows.map(([s, e, x], i) => `<tr><td class="n">${i + 1}</td><td><b style="font-weight:600">${s}</b></td><td>${e}</td><td class="muted">${x}</td></tr>`).join('')}</table>
<div class="small muted" style="margin-top:8px">Dans un champ de saisie, Échap reste au champ (ex. recherche non vide : l'effacer). Rien de tout cela ne consomme Échap : il ne fait rien. « Trier par » est une liste native : le navigateur gère Échap.</div></div></div>`
const ro = `<div class="vign"><div class="lbl">C. Lecture seule : « Désélectionner » reste, « Supprimer » disparaît</div><div style="display:flex;gap:10px">${props({ ro: true, w: 340 })}</div></div>`
document.getElementById('b26').innerHTML = main
+ `<div style="display:flex;gap:20px;margin-top:14px;width:1720px;align-items:flex-start">${dialog}${esc}${ro}</div>`
+ `<div style="display:flex;gap:12px;margin-top:12px;width:1280px">${note(`<b>Historique :</b> « Défaire » / « Refaire » (EN « Undo » / « Redo » inchangés), à droite de la barre d'onglets, sur tous les onglets. Nom accessible « ${HIST.undo[2]} » / « ${HIST.redo[2]} » ; info-bulle native (attribut title, au survol de la souris seulement, montré ici) avec le raccourci réel (${HIST.undo[3]}, ${HIST.redo[3]} ; pas de Ctrl+Y). Au clavier et pour les lecteurs d'écran, le raccourci passe par aria-keyshortcuts (aujourd'hui Control+Z / Control+Shift+Z ; ajouter Meta+Z / Meta+Shift+Z pour ⌘).`, 'flex:1')}
${note(`<b>Désélectionner :</b> bouton secondaire à gauche de « Supprimer », qui garde son style de danger. La désélection est un état d'interface : aucune modification du document, aucune entrée d'historique, « 3 modifications non enregistrées » ne bouge pas. Focus ensuite sur la ligne de l'annotation dans la liste, par le même chemin que « Toutes les annotations » (focusRow). <b>À noter :</b> « Toutes les annotations », en haut du volet, désélectionne déjà ; point soumis au propriétaire.`, 'flex:1')}</div>`
}
</script>
<!-- ================================================================== 27 phone references -->
<div class="row"><div data-board="27-telephone-references">
<p class="sheet-title">27. Téléphone (375 px) : éditeur en lecture seule, « Références » dans le menu « Plus », onglet Références en consultation</p>
<div id="b27" style="display:flex;gap:24px;align-items:flex-start"></div></div></div>
<script>
{
const top = `<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>`
const notice = `<div class="notice info" style="font-size:12px">${ico('info', 'sm')}<div>L'édition nécessite une largeur d'écran d'au moins 1 024 px.</div></div>`
// EditorTabs as built below 640 px: Annotations, Vérification, « Plus »; history wraps to its own row; the disclosure row comes last.
const tabRow = (o) => `<div class="tabs" style="padding:0;margin:0;flex-wrap:wrap;gap:0">
<a class="${o.on === 'Annotations' ? 'on' : ''}" style="padding:12px 10px">Annotations</a><a style="padding:12px 10px">Vérification <span class="badge danger">2 erreurs</span></a><a class="${o.more ? 'on' : ''} ${o.focusMore ? 'focus' : ''}" style="padding:12px 10px">Plus</a>
<span style="margin-left:auto;display:flex">${hbtn('undo', { iconOnly: true, off: true }).replace('class="hbtn', 'style="width:44px;height:44px;justify-content:center" class="hbtn')}${hbtn('redo', { iconOnly: true, off: true }).replace('class="hbtn', 'style="width:44px;height:44px;justify-content:center" class="hbtn')}</span>
${o.open ? `<div style="flex-basis:100%;display:flex;gap:4px;border-top:1px solid var(--color-border);padding:4px 0">${['Général', 'Constats', 'Références'].map((t) => `<a style="border:0;margin:0;padding:12px 10px;border-radius:6px" class="${t === 'Références' ? 'focus' : ''}">${t}</a>`).join('')}</div>` : ''}</div>`
const f1 = `<div class="vign"><div class="lbl">A. « Plus » ouvert</div><div class="frame phone">${top}<div class="ph-body" style="padding:12px;gap:10px">${notice}${tabRow({ on: 'Annotations', open: true })}
<div class="canvas" style="flex:1">${drawing({ w: 330, h: 300 })}</div></div></div></div>`
const list = shown('', 'doc')
const f2 = `<div class="vign"><div class="lbl">B. Onglet Références</div><div class="frame phone">${top}<div class="ph-body" style="padding:12px;gap:10px">${notice}${tabRow({ more: true })}
${searchBox({ ph: true, w: 335 })}<div style="display:flex;gap:8px;align-items:center">${sortBox('doc', { ph: true })}</div><span class="count">${countTxt(REFS.length)}</span>
<div class="rlist">${list.slice(0, 5).map((r) => tile(r, { ph: true })).join('')}</div></div></div></div>`
const OPEN = refById['white-2022'], at = list.indexOf(OPEN)
const f3 = `<div class="vign"><div class="lbl">C. Une tuile ouverte (consultation)</div><div class="frame phone">${top}<div class="ph-body" style="padding:12px;gap:10px">
${ROW_MORE(`⋮ liste défilée jusqu'à la ${at + 1}e référence`)}
<div class="rlist">${tile(list[at - 1], { ph: true })}${tile(OPEN, { ph: true, open: true, ro: true })}${tile(list[at + 1], { ph: true })}</div></div></div></div>`
document.getElementById('b27').innerHTML = f1 + f2 + f3
+ `<div style="width:300px;display:flex;flex-direction:column;gap:10px">${note('<b>« Plus » :</b> sous 640 px, les onglets visibles restent Annotations et Vérification (tabs.ts, SHOWN.small) ; « Plus » contient Général, Constats et désormais Références. Il porte le style actif quand l\'onglet affiché est dans son menu (B).')}
${note('<b>Lecture seule :</b> sous 1 024 px l\'éditeur ne modifie rien (notice existante) ; « Défaire » / « Refaire » restent visibles et indisponibles, sur une seconde ligne faute de place, comme aujourd\'hui.')}
${note('<b>Tuiles :</b> type et nombre de citations passent sous la citation ; cibles de 44 px (en-tête de tuile, « Aller à », effacement de la recherche, tri). « Trier par » : la même liste native qu\'au bureau, étiquette au-dessus. Ni ajout, ni modification, ni suppression, ni réorganisation. DOI, URL et « Aller à » restent.')}</div>`
}
</script>
<!-- ================================================================== 28 admin sheet list -->
<script>
// STAGING (no document data exists for these): sheet rows, versions, rounds and dates. Species names come from the
// species rows of the migrations (Cheval in 20261008110000, the others in 20261026100000); every row other than
// « Cheval, squelette et rachis » (validated boards) and « Cheval (fiche historique) » (board 10 v1-2-4) is illustrative.
const SHEETS = [
['Cheval, squelette et rachis', 'Cheval', ['Copie de travail', ['accent', '1 à relire']], 'Active · version publiée 3 · brouillon version 4 · revue n° 2 : À relire', '9 nov. 2026, 12:06', 'Brouillon'],
['Chien, squelette et rachis', 'Chien', [], 'Active · aucune version publiée · brouillon version 1', '8 nov. 2026, 17:41', 'Brouillon'],
['Chat, squelette et rachis', 'Chat', [], 'Active · aucune version publiée · brouillon version 2 · revue n° 1 : Modifications demandées', '7 nov. 2026, 09:15', 'Brouillon'],
['Cheval, tête et crâne', 'Cheval', [['accent', '1 à relire']], 'Active · version publiée 1 · brouillon version 2 · revue n° 2 : À relire', '5 nov. 2026, 16:20', 'Brouillon'],
['Âne, squelette et rachis', 'Âne', [], 'Active · version publiée 1', '3 nov. 2026, 11:02', 'Publiée'],
['Bovin, squelette et rachis', 'Bovin', [], 'Active · aucune version publiée · brouillon version 1', '30 oct. 2026, 14:48', 'Brouillon'],
['Chien, tête et crâne', 'Chien', [], 'Active · aucune version publiée · brouillon version 1', '28 oct. 2026, 10:30', 'Brouillon'],
['Chèvre, squelette et rachis', 'Chèvre', [], 'Active · aucune version publiée · brouillon version 1', '27 oct. 2026, 15:12', 'Brouillon'],
['Mouton, squelette et rachis', 'Mouton', [], 'Active · aucune version publiée · brouillon version 1', '24 oct. 2026, 08:57', 'Brouillon'],
['Porc, squelette et rachis', 'Porc', [['warn', 'Archivée']], 'Archivée · version publiée 1', '21 oct. 2026, 18:05', 'Publiée'],
['Lapin, squelette et rachis', 'Lapin', [], 'Active · aucune version publiée · brouillon version 1', '20 oct. 2026, 13:40', 'Brouillon'],
['Cheval (fiche historique)', 'Cheval', ['Fiche historique'], 'Active · version publiée 2', '9 oct. 2026, 10:00', 'Publiée'],
]
const badges = (bs) => bs.map((b) => Array.isArray(b) ? `<span class="badge ${b[0]}">${b[1]}</span>` : `<span class="badge">${b}</span>`).join('')
const sheetMatch = (s, q) => !q || fold(s[0]).includes(fold(q))
const sheetCount = (n, q) => q ? `${pl(n, 'fiche', 'fiches')} sur ${SHEETS.length}` : pl(n, 'fiche', 'fiches')
function sheetRow(s, o = {}) {
const [name, sp, bs, line, date] = s
if (o.ph) return `<div class="srow" style="min-height:44px"><div class="l1"><b>${name}</b>${badges(bs)}</div><div class="l2">${sp} · ${line}</div><div class="l2">Modifiée le ${date}</div></div>`
return `<div class="srow"><div class="l1"><b>${name}</b>${badges(bs)}<span class="date">Modifiée le ${date}</span></div><div class="l2">${sp} · ${line}</div></div>`
}
const sel = (label, val, o = {}) => `<div class="field" style="${o.style || ''}"><label>${label}</label><span class="inp ${o.focus ? 'focus' : ''}" style="${o.ph ? 'height:44px' : ''}">${val}<span class="caret">${ico('down', 'sm')}</span></span></div>`
const FILTERS = ['Espèce', 'État de la fiche', 'Statut de version', 'État de la dernière revue']
function sheetSearch(q, o = {}) {
const h = o.ph ? 'height:44px;' : ''
return `<span class="inp ${o.focus ? 'focus' : ''}" style="${h}width:${o.w || 340}px;padding-right:${q ? 4 : 10}px">${ico('search', 'sm')}${q ? `<span>${q}</span><span class="clr ${o.ph ? 'big' : ''}" title="Effacer la recherche">${ico('close', 'sm')}</span>` : '<span class="muted">Rechercher une fiche par son nom</span>'}</span>`
}
</script>
<div class="row"><div data-board="28-liste-fiches-desktop">
<p class="sheet-title">28. Administration › Fiches officielles : recherche par nom, tri par dernière modification (défaut) ou nom, date visible ; mêmes filtres, liste générique pour toutes les espèces</p>
<div id="b28"></div></div></div>
<script>
{
const body = `<div style="display:flex;align-items:center;gap:12px"><h1 class="big">Fiches officielles</h1><span class="btn primary" style="margin-left:auto;height:44px">Nouvelle fiche</span></div>
<div class="sbar" style="gap:16px">${sheetSearch('', { focus: true })}<span class="sortsel"><span>Trier par</span><span class="inp" style="min-width:230px">Dernière modification<span class="caret">${ico('down', 'sm')}</span></span></span></div>
<div style="display:grid;grid-template-columns:repeat(4,1fr);gap:12px">${FILTERS.map((f) => sel(f, 'Tous')).join('')}</div>
<div class="count">${sheetCount(SHEETS.length)}</div>
<div class="card" style="overflow:hidden">${SHEETS.map((s) => sheetRow(s)).join('')}</div>`
const Q = 'cheval', hits = SHEETS.filter((s) => sheetMatch(s, Q))
const inset = `<div class="vign"><div class="lbl">Recherche « ${Q} » : le compteur dit « N fiches sur 12 »</div>${vframe(760, 300, `
<div class="sbar" style="gap:16px">${sheetSearch(Q)}<span class="sortsel"><span>Trier par</span><span class="inp" style="min-width:200px">Dernière modification<span class="caret">${ico('down', 'sm')}</span></span></span></div>
<div class="count">${sheetCount(hits.length, Q)}</div><div class="card" style="overflow:hidden">${hits.map((s) => sheetRow(s, { q: Q })).join('')}</div>`)}</div>`
const NQ = 'mulet'
const empty = `<div class="vign"><div class="lbl">Recherche sans résultat</div>${vframe(760, 230, `
<div class="sbar" style="gap:16px">${sheetSearch(NQ)}<span class="sortsel"><span>Trier par</span><span class="inp" style="min-width:200px">Dernière modification<span class="caret">${ico('down', 'sm')}</span></span></span></div>
<div class="count">${sheetCount(SHEETS.filter((s) => sheetMatch(s, NQ)).length, NQ)}</div>
<div class="notice info">${ico('info', 'sm')}<div><b>Aucune fiche ne contient « ${NQ} » dans son nom.</b><div style="margin-top:8px"><span class="btn secondary sm">${ico('close', 'sm')}Effacer la recherche</span></div></div></div>`)}</div>`
document.getElementById('b28').innerHTML = pageFrame({ crumb: 'Administration › Fiches officielles', h: 1110, body })
+ `<div style="display:flex;gap:20px;margin-top:14px;width:1280px;align-items:flex-start"><div style="display:flex;flex-direction:column;gap:20px">${inset}${empty}</div><div style="flex:1;display:flex;flex-direction:column;gap:10px">
${note('<b>Recherche :</b> instantanée, sur le nom de la fiche seulement, sans accents ni casse (comme le catalogue). « Effacer la recherche » vide le champ et y rend le focus. Elle se combine aux quatre filtres existants.')}
${note('<b>Tri :</b> « Dernière modification » (récente d\'abord, défaut) ou « Nom » (A → Z, ordre alphabétique français). <b>Date :</b> voir le point soumis sur sa source (la date actuelle de la liste ignore les enregistrements de brouillon).')}
${note('<b>Si la date reste celle de la fiche (A7, approximation) :</b> la ligne dit « Fiche modifiée le 9 nov. 2026, 12:06 » et la carte d\'accueil « Fiches modifiées récemment » ; avec la lecture SQL, « Modifiée le … » et « Dernières modifications », comme dessiné.')}
${note('<b>Sans résultat :</b> la phrase nomme la recherche (« Aucune fiche ne contient « mulet » dans son nom. ») ; si des filtres sont aussi actifs, la phrase existante « Aucune fiche ne correspond à ces filtres. » reste. Aucun surlignage du texte trouvé.')}
${note('<b>Générique :</b> aucune section « fiches historiques », aucun filtre de test. « Fiche historique » et « Copie de travail » restent les badges actuels, venus des indicateurs du serveur ; ces fiches sont des lignes ordinaires. Lignes, versions et dates : mise en scène (REVUE.md).')}</div></div>`
}
</script>
<!-- ================================================================== 29 phone list and admin home -->
<div class="row"><div data-board="29-liste-fiches-telephone-accueil">
<p class="sheet-title">29. A : la liste des fiches à 375 px (recherche active) ; B : accueil Administration, carte « Fiches officielles » enrichie</p>
<div id="b29" style="display:flex;gap:24px;align-items:flex-start"></div></div></div>
<script>
{
const Q = 'cheval', hits = SHEETS.filter((s) => sheetMatch(s, Q))
const phone = `<div class="vign"><div class="lbl">A. Téléphone, page entière (défilement)</div><div class="frame phone" style="height:1020px">
<div class="ph-top">${ico('menu')}<span class="muted s13">Administration ›</span><b style="font-weight:600">Fiches officielles</b></div>
<div class="ph-body" style="padding:16px;gap:12px">
<h1 class="big" style="font-size:26px">Fiches officielles</h1><span class="btn primary" style="height:44px;align-self:flex-start">Nouvelle fiche</span>
${sheetSearch(Q, { ph: true, w: 327 })}
${sel('Trier par', 'Dernière modification', { ph: true })}
${FILTERS.map((f) => sel(f, 'Tous', { ph: true })).join('')}
<div class="count">${sheetCount(hits.length, Q)}</div>
<div class="card" style="overflow:hidden">${hits.map((s) => sheetRow(s, { ph: true, q: Q })).join('')}</div></div></div></div>`
const top5 = SHEETS.slice(0, 5)
const card = `<div class="ccard"><h2>Fiches officielles</h2><div class="s14 muted">Brouillons, revues, versions.</div>
<div class="small muted" style="font-weight:600;text-transform:uppercase;letter-spacing:.04em">Dernières modifications</div>
<div>${top5.map(([name, sp, bs, line, date]) => `<div class="srow" style="padding:9px 0"><div class="l1"><a class="lnk" style="color:var(--color-ink);text-decoration:none;font-weight:500">${name}</a>${badges(bs)}</div>
<div class="l2">${sp} · ${line}</div><div class="l2">Modifiée le ${date}</div></div>`).join('')}</div>
<a class="lnk s14" style="font-weight:500;min-height:44px;display:inline-flex;align-items:center">Voir les ${SHEETS.length} fiches</a></div>`
const entry = (t, b) => `<div class="ccard"><h2>${t}</h2><div class="s14 muted">${b}</div><span class="btn secondary sm" style="align-self:flex-start">Ouvrir</span></div>`
const home = pageFrame({ crumb: 'Administration', h: 860, body: `<h1 class="big">Administration</h1>
<div class="s14 muted">Vos habilitations : éditeur de fiches, responsable de publication · rôle propriétaire · session renforcée (double authentification) active.</div>
<div style="display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start">${card}<div style="display:flex;flex-direction:column;gap:16px">${entry('Espèces', 'Espèces du catalogue, actives ou non.')}${entry('Accès et habilitations', 'Accès au catalogue et habilitations : attribution, échéance, révocation.')}</div></div>` })
document.getElementById('b29').innerHTML = phone + `<div class="vign"><div class="lbl">B. Accueil Administration (1 280 px)</div>${home}
<div style="display:flex;gap:12px;width:1280px">${note('<b>Carte :</b> les cinq fiches modifiées le plus récemment (même tri et même date que la liste), avec les badges et la ligne de détail de la liste (espèce, état, versions, revue), sans nouveau badge, et la date ; lien « Voir les 12 fiches » vers la liste. Une fiche historique qui entre dans les cinq garde son action « Créer une copie de travail » sous sa ligne, comme aujourd\'hui.', 'flex:1')}
${note('<b>Téléphone :</b> filtres empilés comme aujourd\'hui (une colonne sous 640 px), cibles de 44 px, la date passe sur sa propre ligne. Données de mise en scène.', 'flex:1')}</div></div>`
}
</script>
<!-- ================================================================== 30 catalogue integrity failure -->
<div class="row"><div data-board="30-catalogue-carte-integrite">
<p class="sheet-title">30. Catalogue : une carte dont la version publiée échoue au contrôle d'intégrité, avertie dès la liste ; la page de la fiche garde son message actuel</p>
<div id="b30"></div></div></div>
<script>
{
const views = DOC.views.length, zones = DOC.zones.length
const ok = `<div class="ccard"><div class="lrow" style="min-height:0"><span class="badge">Cheval</span><span class="r badge ok">${ico('check', 'sm')}Publiée</span></div>
<h2>Cheval, squelette et rachis</h2><div class="s13 muted">Version 3 · publiée le 28/10/2026 · ${pl(views, 'vue', 'vues')}, ${pl(zones, 'zone de constats', 'zones de constats')}</div>
<div style="border-radius:12px;background:var(--color-surface-strong);height:170px;display:grid;place-items:center;overflow:hidden">${drawing({ w: 230, h: 165 })}</div>
<span class="btn secondary" style="height:44px;align-self:flex-start">${ico('eye', 'sm')}Consulter</span></div>`
const failCard = (o = {}) => `<div class="ccard"><div class="lrow" style="min-height:0"><span class="badge">Chien</span><span class="r badge ok">${ico('check', 'sm')}Publiée</span></div>
<h2>Chien, squelette et rachis</h2><div class="s13 muted">Version 1</div>
${o.today ? '' : `<div class="notice error">${ico('alert', 'sm')}<div><b>Contrôle d'intégrité échoué : cette version ne peut pas être affichée.</b></div></div>`}
<span class="btn secondary ${o.focus ? 'focus' : ''}" style="height:44px;align-self:flex-start">${ico('eye', 'sm')}Consulter</span></div>`
const netCard = `<div class="ccard"><div class="lrow" style="min-height:0"><span class="badge">Chat</span><span class="r badge ok">${ico('check', 'sm')}Publiée</span></div>
<h2>Chat, squelette et rachis</h2><div class="s13 muted">Version 2</div>
<div class="notice warn">${ico('cloud-off', 'sm')}<div>Connexion au serveur impossible. Vérifiez votre réseau.</div></div>
<div style="display:flex;gap:8px;flex-wrap:wrap"><span class="btn secondary" style="height:44px">Réessayer</span><span class="btn secondary" style="height:44px">${ico('eye', 'sm')}Consulter</span></div></div>`
const body = `<div><h1 class="big">Fiches anatomiques</h1><div class="s14 muted" style="margin-top:4px">Les fiches officielles publiées, par espèce. Consultation seule : rien n'est modifié ici.</div></div>
<div class="sbar" style="gap:12px"><span class="inp" style="width:340px">${ico('search', 'sm')}<span class="muted">Rechercher une fiche</span></span><span class="chip on">Toutes les espèces</span><span class="chip">Cheval</span><span class="chip">Chien</span><span class="chip">Chat</span></div>
<div style="display:grid;grid-template-columns:repeat(3,1fr);gap:16px;align-items:start">${ok}${failCard({ focus: true })}${netCard}</div>`
const cat = pageFrame({ nav: 'Fiches anatomiques', noAdmin: true, crumb: 'Fiches anatomiques', h: 640, body, me: `<span class="me"><span class="avatar">CL</span>Camille Laurent</span>` })
const today = `<div class="vign"><div class="lbl">Aujourd'hui : la même carte, sans rien dire</div><div style="width:330px">${failCard({ today: true })}</div><div class="small muted" style="width:330px">Les détails n'ont pas pu être lus : la carte perd ses comptes et sa vignette sans explication (useCardDetails).</div></div>`
const page = `<div class="vign"><div class="lbl">La page de la fiche, inchangée (CatalogueFailureNotice ; barre latérale omise)</div>${pageFrame({ noSide: true, crumb: 'Fiches anatomiques', h: 240, me: `<span class="me"><span class="avatar">CL</span>Camille Laurent</span>`, body: `<div class="notice error" style="max-width:640px">${ico('alert', 'sm')}<div>L'empreinte de cette version ne correspond pas à celle enregistrée à sa publication.</div></div><span class="btn secondary" style="height:44px;align-self:flex-start">Réessayer</span>`, w: 900 })}</div>`
document.getElementById('b30').innerHTML = cat
+ `<div style="display:flex;gap:20px;margin-top:14px;width:1280px;align-items:flex-start">${today}${page}</div>`
+ `<div style="display:flex;gap:12px;margin-top:12px;width:1280px">${note('<b>Carte :</b> notice d\'erreur existante (même composant, même couleur) dans la carte : « Contrôle d\'intégrité échoué : cette version ne peut pas être affichée. » (EN proposé : « Integrity check failed: this version cannot be displayed. »). La carte reste dans la liste et « Consulter » reste disponible (focus clavier montré) : la page de la fiche donne le détail technique et « Réessayer ». Rien n\'est masqué ni contourné : le contrôle reste celui du cœur. Le badge « Publiée » reste à côté : la version est bien publiée, seule sa lecture échoue.', 'flex:1')}
${note('<b>Portée :</b> le message n\'apparaît que pour un échec d\'intégrité (empreinte de la version, empreinte d\'une illustration, illustration manquante, document illisible) . Un échec d\'une autre nature (ici le réseau, texte existant catalogue.failure.network) a sa propre ligne, en ton d\'avertissement, avec « Réessayer » pour cette carte. Les échecs de taille (caps) et de vue (view) restent à classer. « Chien » et « Chat, squelette et rachis » sont des cas illustratifs ; « Cheval, squelette et rachis », sa version et sa date de publication reprennent la planche 01 v1-2-4 ; ses comptes de vues et de zones sont ceux du brouillon.', 'flex:1')}</div>`
}
</script>
</body>
</html>
@@ -0,0 +1,62 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Faunosteo V1-2.6 R0, planche-contact</title>
<!--
Contact sheet of the eight R0 boards (23 to 30), grouped by the owner's decisions. It only shows the PNGs of
this folder, scaled down by the browser; it never redraws them. Rendered to planche-contact.png by
../v1-2-6/render.cjs (one [data-board] element), like maquettes.html. Opened in a browser, each thumbnail
links to its full-size PNG.
-->
<style>
:root {
--color-bg: #fbf9f5; --color-surface: #ffffff; --color-border: #e7e0d2;
--color-ink: #1f1b16; --color-ink-muted: #6b6359; --color-accent-strong: #9c4831;
--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; }
[data-board] { width: 2400px; padding: 40px 48px 48px; background: #ece6da; }
header { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
header img { height: 44px; }
h1 { font: 400 34px/1.2 var(--font-serif); margin: 12px 0 6px; }
.lede { margin: 0; font-size: 17px; color: var(--color-ink-muted); }
.tag { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 15px; font-weight: 600; background: #fffbeb; color: #b45309; }
.meta { text-align: right; font-size: 15px; color: var(--color-ink-muted); line-height: 1.6; }
.flow { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.stage { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 16px; padding: 18px 24px 22px; }
.stage h2 { font: 400 22px/1.3 var(--font-serif); margin: 0 0 14px; display: flex; align-items: baseline; gap: 10px; }
.stage h2 .step { font: 600 14px var(--font-sans); color: var(--color-accent-strong); text-transform: uppercase; letter-spacing: .06em; }
.thumbs { display: flex; gap: 16px; align-items: flex-start; }
figure { margin: 0; }
figure img { display: block; height: 340px; width: auto; border: 1px solid var(--color-border); border-radius: 8px; }
figcaption { margin-top: 8px; font-size: 15px; display: flex; gap: 8px; align-items: baseline; }
.num { font-weight: 700; color: var(--color-accent-strong); }
a { color: inherit; text-decoration: none; }
</style>
</head>
<body>
<div data-board="planche-contact">
<header>
<div><img src="../../../apps/app/public/logo-horizontal.svg" alt="Faunosteo">
<h1>Arbitrages du premier essai : nouvelles maquettes R0</h1>
<p class="lede">V1-2.6 · onglet Références, historique et désélection, liste des fiches, carte du catalogue en échec d'intégrité</p></div>
<div class="meta"><span class="tag">Proposition, non validée</span><br>Brief du 09/11/2026 · branche feature/v1-2-anatomical-sheets<br>Sources : maquettes.html et data.js, rendu par render.cjs</div>
</header>
<div class="flow" id="flow"></div>
</div>
<script>
const STAGES = [
['Références', "Cinquième onglet et volet d'un constat", [['23-references-onglet-desktop', '23', 'Onglet Références'], ['24-references-recherche-tri', '24', 'Recherche, tri, états'], ['25-volet-references-constat', '25', 'Volet depuis un constat'], ['27-telephone-references', '27', 'Téléphone, menu « Plus »']]],
['Historique', 'Défaire, Refaire, Désélectionner', [['26-historique-deselection', '26', 'Libellés, Échap, lecture seule']]],
['Fiches', 'Liste et accueil Administration', [['28-liste-fiches-desktop', '28', 'Liste, recherche et tri'], ['29-liste-fiches-telephone-accueil', '29', 'Téléphone et carte d\'accueil']]],
['Catalogue', "Échec d'intégrité", [['30-catalogue-carte-integrite', '30', 'Carte avertie dès la liste']]],
]
document.getElementById('flow').innerHTML = STAGES.map(([step, title, boards]) =>
`<section class="stage"><h2><span class="step">${step}</span>${title}</h2><div class="thumbs">${boards.map(([f, n, c]) =>
`<figure><a href="${f}.png"><img src="${f}.png" alt="Planche ${n}"></a><figcaption><span class="num">${n}</span>${c}</figcaption></figure>`).join('')}</div></section>`).join('')
</script>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 647 KiB

+138
View File
@@ -0,0 +1,138 @@
# Dedicated manual trial stack: technical plan
Status: PROPOSAL, 2026-11-09 (owner brief « V1-2.6 UX — Arbitrages du premier essai propriétaire », §5). Plan
only: no stack is created, started, reset or removed, no script changes, existing data untouched. Implementation
needs its own owner authorisation. Companion of `V1-2-6_U1_CORRECTIONS.md`.
## 1. Why
The owner's first trial (2026-11-09) ran on the automated sandbox through `pnpm db:sandbox trial`
(`scripts/db-sandbox.sh:386-453`). The sandbox then held 219 official sheets, 217 of them made by the e2e and
vitest suites, a working copy left by a suite, and seven versions with a fictitious fingerprint. The owner chose a
persistent manual stack that no automated suite touches.
## 2. Today's setup (facts the plan builds on)
- The sandbox: containers and network `faunosteo_dbsandbox_*` (`db-sandbox.sh:47-56`), loopback ports 57xxx
(:59-60), no Docker volume (:2-6; checked 2026-11-09: neither the Postgres nor the Storage image declares one, data
lives in the containers until `down`). Secrets in `~/.cache/faunosteo-db-sandbox/secrets.sh`, generated at each
`up` (:93-119), keys valid 30 days (:101).
- Seeds: `supabase/config.toml:44` lists `seed.sql` (three accounts with the public DEV password, `seed.sql:5`) and
`seed/anatomical-sheets/equine/draft/equine_draft.sql` (the historical equine sheet).
- How suites reach a stack: vitest and Playwright get endpoints and keys only from `with_sandbox_env`
(`db-sandbox.sh:270-276`); `packages/supabase/tests/sandbox/stack.ts:11-26` throws without them; the e2e app is
built against a fake origin replayed onto those URLs (`apps/app/e2e/support/sandbox.ts:11-40`); e2e dev servers
on 5191 and 5192.
- The trial app: Vite with `apps/app/vite/trial.config.ts`, which takes the gateway URL and the host from its
environment and refuses anything but `http://127.0.0.1:<port>` and a private IPv4 (:12-25).
- DEV: `supabase_*_faunosteo`, ports 54321 to 54324 on all interfaces.
- Measured on 2026-11-09 (`docker stats`): sandbox about 620 MiB (PostgREST 280, Postgres 185, Storage 105), DEV
about 545 MiB; host 14.7 GiB RAM, 16 CPUs. Ports 58000 to 58999 and 5194 free (`ss -ltn`).
## 3. Design
### 3.1 Containers, network, volumes
Prefix `faunosteo_trial_`: `_db`, `_auth`, `_rest`, `_storage`, `_mail`, `_gateway`; network `faunosteo_trial_net`;
named volumes `faunosteo_trial_db` (Postgres `PGDATA=/var/lib/postgresql/data`) and `faunosteo_trial_storage`
(Storage `FILE_STORAGE_BACKEND_PATH=/mnt`). Same images and versions as the sandbox (`db-sandbox.sh:42-46`). The
sandbox's guard and removal name only `faunosteo_dbsandbox_*` (:242, :262-267), so `pnpm db:sandbox up` or `down`
never sees the trial stack; the trial script acts only on its own prefix.
### 3.2 Ports (loopback only, app excepted)
| Service | Port |
|---|---|
| Postgres | 127.0.0.1:58432 |
| GoTrue | 127.0.0.1:58999 |
| PostgREST | 127.0.0.1:58300 |
| Storage | 127.0.0.1:58500 |
| Mailpit (UI) | 127.0.0.1:58025 |
| Gateway (`/auth/v1`, `/rest/v1`, `/storage/v1`) | 127.0.0.1:58801 |
| App (Vite, `trial.config.ts`) | trial host:5194 (LAN address by default, 127.0.0.1 for host-only, same rule as `trial_host`, `db-sandbox.sh:392-408`) |
Every start checks that each port is free and that the container publishes it on 127.0.0.1 only, as the sandbox
gateway does (:422-423).
### 3.3 Secrets and state
`~/.cache/faunosteo-trial/` (700, outside the repository, refused inside it as `db-sandbox.sh:66-70` does):
`secrets.sh` (600) with its own Postgres password, JWT secret, anon and service keys; env files per service (600),
never argv. Generated once at creation; `start` never regenerates them (the database keeps the role passwords set at
its first initialisation). Keys valid one year instead of 30 days, with a `rotate-keys` command that re-signs both
keys with the same secret and restarts the services: a persistent stack with the sandbox's 30-day keys would lock
itself out after a month. Since every secret differs from the sandbox's, a suite that reached a trial port by mistake
would be refused by GoTrue, PostgREST and Postgres instead of writing.
### 3.4 Persistence and lifecycle
- `create` refuses when a container, the network or a volume of the prefix exists; runs migrations and the equine
seed (3.5); leaves the stack running.
- `stop` / `start`: `docker stop` / `docker start` of the same containers; data kept. Restart policy `no`: nothing
starts at boot.
- `migrate`: applies new migrations of the branch forward (`supabase migration up --db-url`), after an automatic
`backup`; it stops when a migration already applied differs from its file (a file edited in place cannot be
replayed on a persistent stack).
- `backup`: `pg_dump -Fc` into `~/.cache/faunosteo-trial/backups/` and a tar of the storage volume mounted read-only;
sizes printed.
- `destroy`: the only removal path. It prints the inventory (containers, volumes, accounts, sheets, drafts, backups
kept) and requires the typed confirmation of the stack name; under the owner's sandbox rule it is run only after
the owner's go for that operation.
### 3.5 Content: accounts, the equine sheet and its drawings
- Migrations of the branch, then `equine_draft.sql` only. Not `seed.sql`: its three accounts carry the public DEV
password (`seed.sql:5`).
- Trial accounts: `account <email>` creates a confirmed account through GoTrue's admin API, password at a hidden
prompt (12 characters minimum), as `cmd_trial_account` does (`db-sandbox.sh:457-472`); `grant <email> <right>` as
`cmd_trial_grant` (:476-496), plus the platform role `owner` if the owner wants the rights screen (arbitration A13).
Administration then asks for a TOTP factor, enrolled in Mon compte.
- The equine sheet: the seed gives the historical sheet its fixed id and `private.historical_sheet_id()` flags it
(`20261102100000_sheet_admin_reads.sql:56`); it is the only official sheet at creation.
- Its drawings: the existing tool `pnpm assets:upload supabase/seed/anatomical-sheets/equine/draft` (R5.5), through
the trial gateway, the service key passed in its environment from the trial state file. The tool checks the seed
rows and hashes, never overwrites, confirms after verification and can be rerun (`scripts/sheet-assets-e2e.sh`
proves the rerun). No hand-written SQL, no copy from the sandbox, whose data is test data. The working copy is then
made in the app (« Créer une copie de travail »).
### 3.6 No accidental access from the suites
1. Suites read endpoints only from `SANDBOX_*` variables set by `db-sandbox.sh` from the sandbox's secrets; the
trial script never exports them and refuses to run when one is set in its environment.
2. A guard added to `stack.ts`: the container name must start with `faunosteo_dbsandbox_` and every URL must be a
127.0.0.1 port of the sandbox list; any other value stops the suite before its first request.
3. Distinct dev-server ports (5191, 5192 for e2e; 5193 sandbox trial; 5194 trial stack) with `--strictPort`.
4. Distinct secrets (3.3) as the last barrier.
### 3.7 Memory and resources
Per container `--memory`, `--cpus 1`, `--pids-limit`: Postgres 1 GiB (`shared_buffers` 128 MB), PostgREST 384 MiB,
Storage 256 MiB, GoTrue 128 MiB, Mailpit and gateway 64 MiB each: at most about 1.9 GiB, about 650 MiB expected from
the sandbox figures. The Vite server is a host process: `NODE_OPTIONS=--max-old-space-size=768`. With DEV and the
sandbox up, about 2 GiB of 14.7 GiB. DEV shares no name, port, network, volume or secret with the trial stack.
## 4. Commands (proposal, arbitration A11)
`pnpm db:trial create | start | stop | status | migrate | backup | rotate-keys | app | account <email> |
grant <email> <right> | assets | destroy`, in a new `scripts/db-trial.sh` built on the sandbox script's functions
(shared helpers extracted to one sourced file rather than copied).
Trial procedure once built: `create`, `assets`, `account`, `grant` (admin rights and catalogue rights), `app`, sign
in, enrol TOTP, work; Ctrl+C stops the app, `stop` stops the stack and keeps everything.
## 5. What the implementation touches
`scripts/db-trial.sh` (new) and a shared helper file, `package.json` (one script), `packages/supabase/tests/sandbox/
stack.ts` (guard 3.6.2), `vite/trial.config.ts` reused unchanged, docs (`SUPABASE.md` §5, `V1-2-6_OWNER_TRIAL.md`,
CLAUDE.md commands). Its tests create a stack under a test prefix and a temporary state folder and remove only what
they created; `shellcheck` on both scripts.
## 6. Arbitrations
| # | Question | Recommendation |
|---|---|---|
| A11 | Command name, prefix, ports | `pnpm db:trial`, `faunosteo_trial_`, 58xxx and 5194 as in 3.2. |
| A12 | Fate of `pnpm db:sandbox trial`, `trial-account`, `trial-grant` | Removed once the trial stack is validated: one trial path. |
| A13 | Platform roles of the owner's trial account | `admin` with the catalogue rights, plus `owner` only if the rights screen is part of the trial. |
| A14 | Key lifetime | One year, with `rotate-keys`. |
| A15 | Backup before every `migrate` | Automatic, kept in the state folder, never pruned without the owner. |
+171
View File
@@ -0,0 +1,171 @@
# V1-2.6 U1 corrections after the owner's first trial
Status: PROPOSAL, 2026-11-09. Owner brief « V1-2.6 UX — Arbitrages du premier essai propriétaire » (2026-11-09),
answering the trial diagnosis of the same day. Design, documentation and plan only: nothing here authorises code.
Lot R0 (boards) is delivered in `docs/design/v1-2-6-r0/` and awaits the owner's graphic validation; R1 to R4 start
only on their own explicit authorisation. Contract: `.claude/tasks/contracts/2026-11-09-v1-2-6-trial-arbitrations.md`.
Companion: `TRIAL_STACK.md` (the dedicated manual trial stack, request §5).
## 1. Owner decisions (2026-11-09)
| # | Decision |
|---|---|
| D1 | A fifth main tab « Références » between Constats and Vérification becomes the main access to the reference library. The header « Références » button is removed. |
| D2 | A contextual panel stays, opened from a finding's detail, filtered on its citations, with « Tout afficher » leading to the tab. About 34 rem wide within the available space, a lateral slide of 150 to 200 ms, `prefers-reduced-motion` honoured. |
| D3 | The tab shows collapsible tiles: closed = short citation, type, citation count; open = full information, DOI, URL, actions. Instant search with a clear button. Sort by document order (default), A to Z, citation count or type. Sorting never changes the document; reorder commands only while document order is shown. |
| D4 | Kept: unsaved changes, focus, « Aller à », permissions, read-only mode, accessibility tests. Below 640 px, Références goes in the « Plus » menu. Boards validated before any UI code. |
| D5 | History reads « Défaire » / « Refaire » instead of « Annuler » / « Rétablir », with explicit accessible names, the keyboard shortcuts kept and the distinction from dialog « Annuler » buttons kept. |
| D6 | A « Désélectionner » button near « Supprimer ». Escape deselects when no dialog, priority panel, menu or tracing in progress consumes it. Deselecting is interface state: no document change, no history entry. A click on an empty part of the drawing is left to U2. |
| D7 | Sheet list: instant search with clear, sort by last modification (default) or name, the last-modification date visible, better Administration home cards. No section built on UUIDs, names, slugs or test conventions; generic for every species; no artificial test filter. |
| D8 | A dedicated, persistent manual trial stack, separate from the automated sandbox: technical plan only, nothing created, reset or deleted now (`TRIAL_STACK.md`). |
| D9 | Three separate test anomalies tracked apart from U1 and U2: A fictitious fingerprints, B working copy never archived by `sheets-admin.sandbox.ts`, C integrity failure invisible in catalogue cards (section 5). |
| D10 | Lots R0 (boards), R1 (history labels, deselect), R2 (References tab), R3 (sheet list), R4 (catalogue integrity warning, independent fix). Any SQL schema or Rust core change needs its own checkpoint. |
## 2. What these decisions supersede
| Earlier validated item | Where | New state |
|---|---|---|
| U1 AC1: « no … « Références » … tab remains » | U1 contract `.claude/tasks/contracts/2026-11-06-v1-2-6-ux-u1-1123.md:373-375` | Five tabs (D1). |
| U1 AC3: panel opened from the header button and from a finding; focus back to the opener, else the header button | same contract :381-389 | Opened from a finding only; focus back to the finding's « n référence(s) » button. Scrim, `inert` tab panels, Escape / ✕ / scrim close and read-only behaviour unchanged. |
| U1 AC4 and T15 (history part): visible « Annuler » / « Rétablir », name « Annuler la dernière modification » | contract :390-397, `V1-2-6_UX_DECISIONS.md:309-322` | « Défaire » / « Refaire » (D5). T15's form wording (« Abandonner », « Abandonner les modifications ») unchanged. |
| U1 AC10: no horizontal scroll with the references panel open | contract :420-421 | Kept, re-checked with the 34 rem panel. |
| U1 AC12, AC13: « Aller à » a reference opens the side panel | contract :425-431 | « Aller à » a reference opens the Références tab, the tile open and focused. |
| U1 AC17: panel tests « open from header and finding »; keyboard order with the panel | contract :439-446 | Tests rewritten for the tab and the finding-only panel; the panel keeps its place in the keyboard order when open. |
| Checkpoint choice 5: Général and Constats under « Plus » below 640 px | `V1-2-6_UX_U1_CHECKPOINT.md:24` | Général, Constats and Références under « Plus ». |
| Checkpoint choice 10: search on citation, DOI and URL; ↑/↓ only on the unfiltered list | same file :29 | Carried to the tab: same search fields; reorder only in document order and without an active search. |
| Checkpoint choice 15: « Références » announced as a panel | same file :34 | Announced as a tab, like the four others. |
| Board 11 (references side panel as the main access) | `docs/design/v1-2-6/11-constats-references-desktop.png` | Replaced by boards 23 to 27 once validated. |
| BDR-099 item 5 (collapsible references rejected) | memory | Not contradicted: it concerned the catalogue page on a phone (`docs/design/README.md`, accepted deviation 2), not the editor. |
| U2b F5 (filter panel in the references panel's slot) | `V1-2-6_UX_FINDINGS_NAV.md:104-126` | Unaffected: the panel slot stays, used by the contextual references panel now and by the filter panel in U2b. |
## 3. Lots
Every lot: one commit or more per coherent change, pushed; gates in this order: `pnpm typecheck`, `pnpm lint`,
`pnpm test:run`, `pnpm build`, `pnpm e2e:ui`, then the shell suite on the sandbox as it stands, with its exact result
(the suite is not green today: four `admin.spec.ts:717` failures from the taken working-copy slot, anomaly B). Every
removed or rewritten assertion is mapped to its replacement in the commit message (R-24). Design gates: the boards of
R0 as validated, `impeccable detect` on the changed components, a fresh design review before the lot closes.
### R0 — Boards and owner validation (this delivery)
Boards 23 to 30 in `docs/design/v1-2-6-r0/` (sources, data generated from the equine draft, `REVUE.md`). Exit: the
owner validates each board, or asks for corrections; the validated boards then join `docs/design/README.md` as the
reference of R1 to R4.
### R1 — History labels and deselection (D5, D6)
- Labels: `editor.history.*` keys in `apps/app/src/i18n/fr.ts` and `en.ts` (FR « Défaire » / « Refaire », names
« Défaire la dernière modification » and « Refaire la dernière modification défaite »; EN « Undo » / « Redo »
unchanged); `HistoryButtons.tsx` keeps its structure. Shortcuts unchanged: Ctrl/⌘+Z undo, Ctrl/⌘+Maj+Z redo
(`apps/app/src/editor/useUndoShortcuts.ts:19-23`). Every prose string that names the history « Annuler » is
reworded; dialog « Annuler » buttons untouched.
- « Désélectionner »: a secondary button beside « Supprimer » (`PropertiesPanel.tsx:257-284`), shown while an
annotation is selected, in read-only modes too (selection is interface state); it dispatches the existing
« no selection » path that « Toutes les annotations » uses (`PropertiesPanel.tsx:93-108`).
- Escape: today a tracing consumes it when the canvas box has focus (`usePlacement.ts:82`), the references panel
when not already handled (`ReferencesPanel.tsx:234`), dialogs natively (`ModalDialog.tsx:111`). One handler on the
workspace, at the bubbling phase, deselects only when `event.defaultPrevented` is false, no dialog is open, no menu
is open and no tracing runs; each consumer marks the key handled. The « Plus » menu's own Escape path is checked
first (it has no explicit handler today).
- Unit tests: deselect leaves the document text and the history length unchanged; undo after a deselect undoes the
previous edit; the Escape matrix (dialog, menu, panel, tracing, nothing open) with one consumer each time; focus
after « Désélectionner » on the annotation's list row (arbitration A6); accessible names of both history buttons in FR and EN; read-only modes
show « Désélectionner » and no « Supprimer ».
- E2E: the journeys that name « Annuler » / « Rétablir » rewritten one for one; a new desktop spec for the button and
Escape; axe on Annotations with a selection.
### R2 — The Références tab (D1 to D4)
- Tab model: `EDITOR_TABS` gains `references` between `findings` and `verification` (`apps/app/src/editor/tabs.ts:6-11`),
`SHOWN.small` keeps it under « Plus » (:18). The id collides with the panel's `data-place` name `references`: the
panel place is renamed first (internal name, no visible effect). Touched with it: `navigation.ts` `targetOfKey`
(:65-81, reference keys go to the tab), `focusRequest.ts:19-22`, `useEditorNavigation.ts`, `EditorTabBody.tsx:16-23`,
`EditorWorkspace.tsx:85-131`, `verification.ts`, i18n keys.
- Tab content: tiles built from `ReferenceRow` / `ReferenceForm` (`components/editor/references/`), a disclosure
button per tile (`aria-expanded`, `aria-controls`), the toolbar with a search field and its explicit clear button
(focus back to the field), a native `<select>` with its external « Trier par » label. Tile count reads « Citée N
fois » (citations from families and findings, as `citations.ts` counts them); the open tile names a family as a family.
« Ajouter une référence » appends in document order, resets search and sort, opens the new tile in edit with focus
on its citation field. Sorting is a pure function over the reference ids that never
touches the document: document order; citation A to Z with `Intl.Collator` of the current language; citation count
descending, ties in document order; type in the order of the type list, ties in document order. Search keeps
`filter.ts` (citation, DOI, URL, `folded`).
- Panel: opened only from a finding (`EditorWorkspace.tsx:94` width becomes `min(34rem, 100%)`), slide from the right
in 150 to 200 ms with a shorter exit, no slide under `prefers-reduced-motion` (Tailwind `motion-reduce:`); the panel
stays mounted during its exit and the page stays `inert` until the exit ends (LRN-085); no permanent `will-change`
(LRN-045). The header button and its focus fallback are removed (`HeaderActions.tsx`, `REFERENCES_BUTTON_ID` in
`tabs.ts:57`).
- Unit tests (about 15 files today assert the four-tab structure or the panel): five tabs and the « Plus » tier at
500 px; each sort, stable, document untouched (text compared before and after); reorder commands present only in
document order without search; clear button; tile disclosure and focus; « Aller à » from Vérification opens the
tab, the tile open and focused; « Aller à » from a tile reaches the finding; the panel from a finding: filtered,
« Tout afficher » opens the tab with search and sort reset and focus on its heading, close returns focus to the
finding's button; unsaved edits in a tile form survive a tab change (kept-mounted places); no edit control in any
read-only mode or without the editor right; the reduced-motion class.
- E2E: `TABS` helper (`e2e/support/editor.ts:327`) to five; `editor-shell-journeys.spec.ts:116-125` count 4 to 5;
layout specs with the panel open at 1 024, 1 180, 1 279, 1 280 px (no horizontal scroll); 375 px « Plus »;
axe on the tab (tiles closed and open) and on the panel; keyboard walk of the new order; about 28 panel open/close
calls rewritten.
### R3 — Sheet list and Administration home (D7)
- `AdminSheetsRoute.tsx`: search on the sheet name in both languages (`folded`, accents ignored) with a clear
button, a « Trier par » select (last modification descending by default, name A to Z by `Intl.Collator`), the
result count, the date on each row; the four filters unchanged (`apps/app/src/admin/filters.ts`).
- `AdminHomeRoute.tsx` « Fiches officielles » card (`CARD_SHEETS = 5`, :25): the five most recently modified sheets
with species, status and date, and « Voir les N fiches ».
- Date source (arbitration A7): the list payload carries `anatomical_sheets.updated_at`
(`supabase/migrations/20261102100000_sheet_admin_reads.sql:54`), which a draft save does not move:
`save_sheet_draft` writes `anatomical_sheet_versions` only (`20261028110000_sheet_review_workflow.sql:569-630`). On
the sandbox, 28 of 219 official sheets have a version newer than the sheet row. A true « dernière modification »
needs one read change in SQL (a `last_modified_at` field, greatest of the sheet's and its versions' `updated_at`,
in `private.official_sheet_admin_summary`; no table, policy or privilege change), hence an SQL checkpoint, pgTAP,
regenerated types, and its application to the sandbox, which needs the owner's go for that operation.
- Search and sort run in the browser on the full list: `shortcut:` until RR-13 pages the list on the server, where
search and sort move with it.
- Tests: unit for search (accents, both languages, empty, clear), sort (date ties by name, collation), date format
FR/EN, the home card (at most five, sorted); e2e admin list search and sort at desktop and 375 px with axe; the four
filters unchanged.
### R4 — Integrity warning in catalogue cards (D9 C, independent fix)
- The card already runs the integrity check: `useCardDetails` calls `loadVersion` and drops a failed load in
silence (`apps/app/src/catalogue/useCardDetails.ts`, `if (!load.ok) return`). R4 keeps the failure kind in the
card's state and shows a warning inside the card; the sheet page's `CatalogueFailureNotice` is unchanged. No SQL,
no Rust: the check stays the core's `check_published`, never bypassed.
- Tests: unit for a card whose load fails with `fingerprint_mismatch` (warning shown, link kept) and with a transport
failure (its own line and « Réessayer », arbitration A10); e2e on a catalogue entry whose stored fingerprint differs, built by
the test itself (never by editing an existing sheet); axe on the list.
- Its own commit and verification, kept out of the U1 shell lots.
## 4. Order and dependencies
R0 first (validation). R1 is independent of R2 and can ship first. R2 depends on the validated boards 23 to 27. R3
depends on arbitration A7; with the SQL option, its migration goes through its own checkpoint before the UI part.
R4 is independent and may run any time after its board (30) is validated. Anomaly B (section 5) should land before
the gates of R2 and R3 are read, since its taken slot fails four admin specs on every run.
## 5. Test anomalies tracked apart (D9)
| Item | Cause | Constraint |
|---|---|---|
| A. Fictitious fingerprints | Worker stand-ins publish with `'a'.repeat(64)`: `packages/supabase/tests/sandbox/sheet-fixtures.ts:115` (`openRound`), `sheets-concurrency.sandbox.ts:168`, `sheets-perf.sandbox.ts:169`. Seven published or deprecated versions on the sandbox fail `check_published`; the owner opened three of them on 2026-11-09. | Compute the real fingerprint through the core as the catalogue e2e does (`fingerprintOf`), never weaken the publish gate or the reader's check. |
| B. Working copy never archived | `packages/supabase/tests/sandbox/sheets-admin.sandbox.ts:181-195` creates the historical sheet's working copy (`8c315a12-…`, 2026-11-08 21:00:30) and never archives it; the single slot then disables « Créer une copie de travail » (`WorkingCopyAction.tsx:88`) and fails `admin.spec.ts:717` four times. | Make the suite independent (its own cleanup, or a precondition it creates and removes); the existing copy is not touched before the owner authorises it. |
| C. Silent card failure | Section 3, R4. | Show the failure, never hide or route around it. |
## 6. Arbitrations for the owner
| # | Question | Recommendation |
|---|---|---|
| A1 | Reorder commands with a search active in document order | Hidden, as checkpoint choice 10 already rules (moving among a hidden subset is ambiguous); one hint line. |
| A2 | Tiles open at once; how long open state, search and sort last | Several open at once; kept while the editor stays open (kept-mounted tab), reset when it reopens. |
| A3 | Actions in the contextual panel | Modifier, « Aller à »; no add, no reorder. Every reference in the panel is cited by the finding, so « Supprimer » would always be refused by the core (no dangling reference): offer « Retirer de ce constat » (removes the id from the finding's citations, an ordinary undoable edit) instead, or nothing. « Tout afficher » opens the tab with search and sort reset, focus on its heading. |
| A4 | Closed tile content | Citation on two lines at most, type, « Citée par N constats » or « Non citée ». |
| A5 | Escape priority | Dialog, then open menu, then contextual panel, then tracing in progress, then selection. |
| A5b | « Toutes les annotations » (top of the properties panel) already clears the selection | Keep both: « Désélectionner » sits where the eye is after acting on an annotation, as decided (D6); the top entry keeps its role of returning to the list. Alternative: rename the top entry. |
| A6 | Focus after « Désélectionner » (the button leaves with the selection) | The annotation's row in the list, as « Toutes les annotations » already does (`PropertiesPanel.tsx:92-102`, `focusRow`). |
| A7 | Source of the last-modification date | SQL read change `last_modified_at` with its own checkpoint (recommended). Without it, label the row « Fiche modifiée le » and accept that draft saves do not move it. |
| A8 | Date format | Absolute, « 9 nov. 2026, 12:06 » (EN « 9 Nov 2026, 12:06 »). |
| A9 | Administration home card | The five most recently modified sheets with species, status and date, then « Voir les N fiches ». |
| A10 | Catalogue warning wording | FR « Contrôle d'intégrité échoué : cette version ne peut pas être affichée. », a distinct line for a load that failed for another reason. |
| A11 to A15 | Trial stack: names, ports, old trial commands, account roles, key lifetime, backups | `TRIAL_STACK.md` section 6. |