17 KiB
CONTRACT — v1-2-6-u2-implementation
- date: 2026-11-17 | flow: implementation of U2 (direct manipulation of annotations, properties dialog) | branch: feature/v1-2-anatomical-sheets
- status: open
- plan:
.claude/tasks/plans/2026-11-17-v1-2-6-u2.md(rev 3, validated 2026-11-17) - base:
838ae42. Commit in place, pushed by the hooks; no merge, nogitflow.sh finish. - worktree: /home/bchanot/Documents/faunosteo-v1-2. Every command runs from this absolute path, checked first
(LRN-110). Never DEV: the
supabase_*_faunosteocontainers are DEV. Database work goes throughpnpm db:sandboxonly. Claude writes nothing on the trial stack (pnpm db:trial), which is the owner's. - untracked file kept:
faunosteo-v1-2-6-revue-ux-chatgpt.md.
REQUEST (verbatim — IMMUTABLE)
Owner brief 2026-11-17 (U2 design validated, technical plan requested)
J'ai fait examiner l'archive graphique U2 par ChatGPT.
La revue graphique est favorable. Je valide les neuf maquettes ainsi que les arbitrages A1 à A15, y compris les trois écarts A1, A2 et A3 par rapport à l'orientation initiale.
En particulier :
- A1 : le premier clic sélectionne l'annotation sans ouvrir de modale. Un deuxième clic, un double-clic ou le bouton « Propriétés » ouvre la modale. La création ouvre automatiquement la modale après le placement du point ou la fermeture du tracé.
- A2 : la modale des propriétés s'affiche sur la colonne de droite pour préserver la visibilité du squelette.
- A3 : la colonne de droite reste présente avec les vues, catégories et annotations.
- A4 à A15 : les propositions des maquettes sont acceptées.
Trois ajustements mineurs sont demandés :
-
A13 : rendre compréhensible le déplacement du dessin à deux doigts sur tablette, avec une indication discrète et contextuelle. Ne pas surcharger l'interface.
-
A14 : s'assurer que l'apparition et la disparition des messages comme « Point déplacé · Défaire » ne provoquent aucun déplacement ni redimensionnement du schéma.
-
Planche 33 : rendre les messages de validation cohérents avec les champs réellement manquants. Si la catégorie est déjà sélectionnée, le message ne doit pas demander de la choisir à nouveau.
Ces ajustements ne nécessitent pas de refaire l'ensemble des maquettes.
Tu peux considérer la conception graphique U2 comme validée et poursuivre avec la préparation du plan technique U2, selon ton processus habituel.
Je te laisse autonome sur l'architecture, les choix techniques, les tests, les relectures et l'organisation des travaux.
L'objectif reste une édition anatomique fluide, précise et intuitive, aussi bien à la souris qu'au toucher, sans perte de données et sans déplacement intempestif de l'interface.
Présente-moi le plan technique et les éventuels arbitrages réellement nécessaires avant l'implémentation.
Owner brief 2026-11-17 (U2 plan rev 2 validated, implementation authorised)
Je valide le plan technique U2 en révision 2, avec les décisions suivantes.
D1 : VALIDÉ. Conserver les coordonnées dans le dialogue exceptionnel de réparation des dessins jusqu'à U5.
La suppression des champs de coordonnées prévue en A8 concerne le parcours normal d'édition des annotations. Il n'est pas nécessaire de refaire le dialogue de réparation dans U2.
D2 : VALIDÉ, avec une précision UX. Masquer les boutons « + » lorsque les segments sont trop courts pour être manipulés correctement.
Le zoom doit permettre de les faire apparaître et de les utiliser.
En revanche, lorsqu'une zone est sélectionnée et que ses segments sont trop courts, prévoir une indication discrète permettant de comprendre qu'il faut zoomer pour ajouter un sommet.
L'objectif est d'éviter les insertions accidentelles sans rendre la fonction incompréhensible.
J'ai également une correction à apporter à l'une des règles R-1 à R-17.
Le plan indique que Retour ou un changement d'onglet annule automatiquement les modes Déplacer et Redessiner, sans confirmation.
Je souhaite distinguer deux situations :
- Aucune manipulation commencée : annulation immédiate, sans confirmation.
- Position déjà modifiée ou nouveau tracé commencé, mais pas encore validé : demander confirmation avant d'abandonner.
Cette règle doit rester cohérente avec nos décisions précédentes sur la protection des modifications en cours et l'absence de perte silencieuse.
Les autres choix visibles du plan me conviennent :
- clic sur le voile sans fermeture ;
- double-clic pour ouvrir les propriétés ;
- bandeau et messages sans déplacement du schéma ;
- lecture seule avec propriétés consultables ;
- gestion du toucher, de la loupe et des gestes.
Je valide également les trois ajustements A13, A14 et planche 33 tels que tu les as intégrés.
Tu peux finaliser le contrat d'implémentation, intégrer ces décisions et commencer U2 selon ton orchestration habituelle.
Je te laisse autonome sur les détails techniques, les relectures, les tests et l'organisation des tâches.
L'objectif est de livrer une manipulation directe des annotations fluide, précise, accessible et sans perte silencieuse de travail.
Je souhaite pouvoir essayer le résultat sur db:trial avant la clôture définitive de U2.
CLARIFICATIONS
- Graphic reference: boards
docs/design/v1-2-6-u2/02 to 06, 13, 31, 32 and 33 withREVUE.mdandARBITRAGES.md(A1 to A15 validated, three adjustments, BDR-122). Boards 14 and 16 (phone, read-only) unchanged. - The plan's recorded choices R-1 to R-18 bind, as validated, with the owner's correction of R-12 (move mode and redraw: immediate end when nothing was started, a question once work has started) and the D2 precision (R-18).
- Reading of the R-12 correction: the owner names Back and a tab change. The rule applies to every navigation that would drop the mode: Back, a tab, a section, a view chip, a tool, sign-out and leaving the editor. « Annuler », « Annuler le tracé » and Escape are explicit cancels drawn on board 32 (row 4) and act at once.
- No silent loss, applied beyond the navigation sites:
- A read-only flip suspends a started mode instead of dropping it (R-14).
- A document change made elsewhere (reload, recovery, save refresh) that drops a started mode says so (R-13).
- D1:
RepairDialogkeeps its coordinate fields until U5. A8 governs the normal annotation editing journey. - Rust by default: the new TypeScript modules are listed in R-17 and in the review's Part II exception table.
- Owner trial: on
pnpm db:trialbefore U2 closes. U2 adds no migration. The owner runsdb:trial startanddb:trial app; Claude writes nothing there.
ACCEPTANCE CRITERIA
Core
- Minimum point radius.
PreviewState.min_point_radiusgives, for each view with a usable frame and a minimum, the smallest radius that passesTooSmall, rounded up to 0.01. It is absent when the preview scale is at least 1.- Rust tests cover the equine values (about 26.50 on the main view, 15.98 on the head) and the edge frames.
- Property:
r = valuepasses andr = value − 0.01givesTooSmall. - The ts-rs types are committed, and the wasm gzip figure and its delta are recorded in
RUST.md, within 600 000 B.
Press and handles
- Press machine. One press machine is the editor's only click, drag and tap decider.
- Slop: 4, 6 and 10 CSS px for mouse, pen and finger, measured as displacement.
- A second pointer cancels the press: no click, no commit, and the pinch zooms.
- The topmost annotation decides; the nearest handle wins, with ranked ties.
- A double click (400 ms, 8 px) opens the properties and never acts on a handle.
- The catalogue's behaviour is unchanged.
- Table-tested (
stepPress,pressTarget,nearestHandle,clickAction,dragAction,isDoubleClick), plus e2e mouse and touch.
- Arrow keys. They pan only when the canvas box itself has the focus. On a focused handle they move the handle as a series: one commit on Enter or blur, none on Escape.
Strip, messages, layout
-
Strip. One fixed-height strip above the drawing and the column replaces the tool line, the selection tag (in the edit body) and the tracing bar. Its labels per state come from REVUE's table and R-1 to R-18.
-
No layout shift (A14). The boxes of the canvas, the strip, the aside and the header, the scroll height and the client width are unchanged, with a zero layout-shift sum, around:
- select, deselect, tool change, tracing steps, the first commit,
- a message showing and expiring, the hint,
- dialog open and close, mode entry and exit.
This is checked at 1 024, 1 180 and 1 280 px. The editor carries
scrollbar-gutter: stable, asserted as a computed style. -
Message line. It reads « Point déplacé · Défaire » and the like, lasts 6 s, pauses on mouse hover only, and is closed by any commit, undo or redo. Its « Défaire » is the header's undo and is hidden during a creation. It is a polite live region; a refusal is an alert with no « Défaire ».
-
Two-finger hint (A13, R-1). « Deux doigts pour déplacer ou zoomer le dessin » / « Use two fingers to move or zoom the drawing » shows after a futile one-finger drag, only when the line is free, and never again in the visit once a two-finger gesture has worked.
Points and zones
- Points.
- The handle drags at any pointer.
- The size slider has the view's stops, the red mark at the core minimum and the R-10 range. It commits once on release, Enter or blur.
- A new point takes the most used size (A5) on every path: click, C26 and keyboard.
- « Déplacer le point » opens the move mode: four arrows, « Valider la position » commits once, « Annuler » and Escape restore.
- The inherited out-of-frame point is repaired through the move mode, with no coordinate field.
- Zones.
- Vertex choose and drag, « + » (midpoint, new vertex chosen), « − » (disabled at 3 with its reason), Insert and Delete.
- The interior drag works by mouse and pen; « Déplacer la zone » and « Déplacer le sommet » use the mode, with a finger or the arrows.
- « Redessiner » keeps the old outline until it is accepted, makes one commit, and keeps the trace open on a refusal.
- Above 40 vertices, the outline and the message.
- A path keeps its
dbyte-identical and gets « Remplacer par un polygone » only.
- « + » and zoom (D2, R-18). A « + » shows only when its segment is at least two hit radii long on screen, and zooming reveals it. While a selected zone has a hidden « + », the strip shows « Zoomez pour ajouter un sommet sur les segments courts. » / « Zoom in to add a vertex on short segments. » This line is not timed and yields to a refusal or an issue. Insert stays available on the keyboard.
Dialogs
- Properties dialog (A1, A2, A3, A9, A10).
- Opening: a first click or Enter on a row only selects. A second click on the selection (with no vertex chosen), a double click, Enter on the selected row or « Propriétés » opens it. A drag never opens it.
- Placement: over the right column at its width and top, never over the canvas box at 1 024, 1 180 and
1 280 px, under a 22 % veil that ignores clicks; with the tablet keyboard, the
visualViewportfallback. - Read mode first. « Couleur » appears only when set. « Marquer comme relu » is one undo.
- Edit mode is transactional: one save is one undo step, built from the current stored annotation. « Supprimer »
goes through
DeleteDialog. - The focus returns as board 32 says. The aside always shows the overview, with the selected row marked.
- It is an
annotationhistory layer: Back closes it, Forward reopens it, a vanished id is sanitised away, and another view's id switches the view.
- Creation (A4, A5, A7, A12, A15).
- The point preview follows the pointer. A click or a closed trace opens « Nouveau point » or « Nouvelle zone » by itself, with the ghost visible.
- The category is prefilled and recolours the ghost; the laterality has no default.
- « Replacer le point » and « Reprendre le tracé » keep the form.
- « Créer » is one insert. Then: « Sélectionner », the new annotation selected, its message, and the focus on its row.
- « Abandonner », ✕, Escape and Back always ask (the shape exists).
- During a creation, the others are dimmed and unselectable, and undo is inactive.
- The keyboard add buttons place the shape and open the dialog. A link uses « Vue ouverte ». The C26 notice shows in the dialog, without numbers.
- Validation messages (board 33). Only the missing fields are named, under each field, with the summary
« À compléter : … » in form order. A chosen category is never asked for again. The general line
editor.annotations.required.fieldsis gone. The creation and the edit form sharemissingFields.
No silent loss
- Guards (R-12, owner correction).
- A creation asks before a tab, a section, a view chip, a tool, Back, Escape, sign-out and leaving the editor.
- A move mode or a redraw ends at once on those navigations while nothing is started. Once the position differs or a vertex is placed, it asks « Abandonner le déplacement ? » or « Abandonner le nouveau tracé ? ».
- « Annuler », « Annuler le tracé » and Escape cancel a mode at once.
- « Continuer » always keeps the work intact.
- Pending work.
- An undo while a move mode, a slider or a keyboard series is pending only cancels that preview (R-13).
- Previews and the chosen vertex are stamped with the document text. A stale one never commits; it is dropped, and announced when it was a started mode.
- After undoing « + », « − » removes nothing stale.
- Read-only flip (R-14). A crossing below 1 024 px, a refusal or a refresh keeps an open dialog in read-only form with its draft, and nothing commits. It suspends a started mode. Both resume on the way back.
- Read-only sheet (R-16). At 1 024 px and wider: the strip in read-only form, « Propriétés » opening the read-only dialog, the overview kept, no handle, no slider. Below 1 024 px, boards 14 and 16 are unchanged.
Accessibility and touch
- Accessibility.
- Handles are focusable outside any
aria-hiddensubtree, with names such as « Sommet 3 de Thoraciques ». - Every drag has a non-drag path (WCAG 2.5.7): move mode arrows, a track click, « + » and « − » clicks, « Redessiner ».
- axe passes on the selection, tracing, move, creation and dialog states.
- The touch hit circles are at least 44 px on a coarse pointer.
- Handles are focusable outside any
- Touch.
- One finger on a handle drags it, with the loupe.
- One finger elsewhere moves nothing.
- Two fingers zoom and pan.
- A finger closes a trace within 22 px.
- Page scroll over the canvas without a selection still works.
- The smoothness measure (p95, CPU ×4, 1 180 px) is recorded in the plan. If only the loupe without the drawing is acceptable, STOP for the owner.
Scope, gates, process
-
Scope.
RepairDialogkeepsGeometryGroup(D1). No other coordinate field remains in the annotation journey.PropertiesPanel.tsx,AnnotationFields.tsx,CreationPanel.tsx,TracingBar.tsxanduseMoveGesture.tsare deleted; every removed assertion is mapped in its commit body.
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app/src && test ! -e components/editor/annotations/PropertiesPanel.tsx && test ! -e components/editor/annotations/AnnotationFields.tsx && test ! -e components/editor/annotations/CreationPanel.tsx && test ! -e components/editor/annotations/TracingBar.tsx && test ! -e editor/annotations/useMoveGesture.ts && [ "$(grep -rl "GeometryGroup" --include=*.tsx . | grep -v "annotations/GeometryGroup.tsx" | sort | tr '\n' ' ')" = "./components/editor/views/RepairDialog.tsx " ] && echo SCOPE_OK
EXPECT: SCOPE_OK
-
Documents. All aligned as built:
docs/ANNOTATION-RENDERING.md« Editor overlay », updated before the rendering changes.V1-2-6_UX_TESTS.md§U2 andV1-2-6_UX_PLAN.md§U2.RUST.md(size, exception row) andRUST_ARCHITECTURE_REVIEW.mdPart II.docs/design/README.mdandCLAUDE.mdfolder lines.V1-2-6_OWNER_TRIAL.md§4.17 « Démonstration U2 », in French, onpnpm db:trial.
-
Gates. Typecheck, lint, the app unit suite, build,
pnpm rust:check,pnpm wasm:buildand the size test.pnpm check:allexits 0 at the final head. The sandbox runsup fresh → test-db → e2e-shell → testwith exact counts recorded. The commit latency stays under 500 ms for a vertex drag, an insert and a removal. No failed suite is called green. -
Reviews. A fresh verifier against this contract, and a fresh security auditor on the U2 diff, once each before the checkpoint. Their exact results are recorded.
-
Process. No merge, no deploy, DEV unchanged, no write on the trial stack. U2 closes only after the owner's trial on
pnpm db:trial.
FILE SCOPE
crates/core/src/anatomy/frame.rs, crates/core/src/domain/sheet/preview.rs, crates/core/tests/, packages/core-wasm/types/, packages/core-wasm/tests/, apps/app/src/{editor/,components/editor/, components/ui/Dialog.tsx,catalogue/useFraming.ts,app/routes/app/admin/AdminSheetDraftRoute.tsx, components/shell/SignOutButton.tsx,styles/index.css,i18n/fr.ts,i18n/en.ts}, apps/app/tests/, apps/app/e2e/, docs/, CLAUDE.md, CHANGELOG.md, .claude/tasks/**, .claude/memory/*