chore(docs): V1-2.6 UX U1 contract and challenged plan
Owner approach A and four choices recorded as gated clarifications. Plan lots A to I after three blind challengers and one confirmation pass; no application code, no DEV.
This commit is contained in:
1 parent
846994b4ab
commit
2e46c14697
3 files changed
+954
-1
No files matched your search
@@ -679,7 +679,8 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
|
||||
- [ ] separate tracks kept apart: TOTP asked at sign-in; missing illustrations blocking the copy of the historical equine sheet; phone editing (full touch editing below 1 024 px) = distinct future lot after V1-2 (owner 2026-11-05, choice 9; boards 14-16 kept as its reference)
|
||||
- [ ] V1-2.6 UX redesign technical preparation (owner brief 2026-11-05 « V1-2.6 — Validation UX définitive et préparation technique »: 16 boards + 11 choices validated; docs and static audits only, no app/Rust/SQL/worker code, no DEV, no merge, no V1-2.7; STOP at the technical checkpoint)
|
||||
- [x] static audits (core model, rendering/PDF/N-1, geometry/wasm, SQL/worker, editor/tests) · [x] docs/development V1-2-6_UX_{PLAN,COMPATIBILITY,TESTS,RISKS,DECISIONS}.md (sub-steps U0-U9, decisions T1-T19) · [x] independent review (3 lenses: CONCERNS 5/9/6, no BLOCKER) + fixes integrated (plan §6) · [x] commit + push branch · [x] owner answers 2026-11-05 (brief « V1-2.6 UX — Ratification des décisions techniques », BDR-100): T11 approved, T16 conditional deferral (curves lot), T2/T3 conditional on proofs, T4 no residual gap, T5 history preserved, T9 three actions, T10 navigation type, T12 principle · [x] five docs updated (decisions, compatibility §0/§7/§8, tests, risks + blocking criteria, plan §7) · [x] LRN-118 (wasm measuring rule) · [x] independent reviews: correctness challenger CONCERNS(5 MAJOR, 7 MINOR) integrated; verifier ECARTS(2) fixed; targeted re-check ECARTS(2) (one U6 test assumed permissive save, deploy order said all rounds) fixed · [x] third independent check before commit (2026-11-05): ECARTS(2) on K10/K11 (R-3 mitigation, U6 objective on older T4 scope, write-lock test assumed stripping save, T16 count scope in two forms) fixed · [x] fresh targeted re-check: CONFORME 12/12 (G1-G4 closed; 7 observations kept for U0) · [x] commit + push · [x] owner answers 2026-11-05 (brief « Autorisation U0 uniquement », BDR-101): T4 both SQL checks approved (O22 amended), T5 defaults, T10 option B, T15, T16 count before activation, « Remplacer par un polygone » explicit · [x] T17 answered 2026-11-06 (BDR-102) · [ ] still open: T12 text (before U7), T6 (V1-2.8), T14 follow-up; T1 only if a measure exceeds · [x] owner authorisation to start U0 (2026-11-05)
|
||||
- [ ] V1-2.6 UX U0, contract and decisions, docs only (contract `.claude/tasks/contracts/2026-11-05-v1-2-6-ux-u0.md`; no code, no SQL, no DEV, no U1): [x] V1-2 contract §6.2, §6.4, §6.7, §7.4, §8.2-§8.4, §12.2 + §17.1 (O22), §16.7, §16.12, §17.12 · [x] level-1 contract C3, C4, C5, C6, C7, C8, C11, C13, C16, C18, C20, C25, C28, C32, C33, C40, with the precedence rule of its header · [x] docs/design/README.md · [x] rules sheet-model.md, schemas.md · [x] five UX docs · [x] BDR-101 · [x] preconditions (r5:import-equine --check clean, seed 22/6/0 paths, wasm 592 143 B) · [x] independent verification: ECARTS x6 fixed, then CONFORME 12/12 (2026-11-06); open points for U2/U6 not in docs: point edge-size handle (boards 02/03), default laterality of the automatic access (U6), §15 replay text vs the category.fixed.* filter · [x] commit + push · [ ] owner U0 checkpoint (then U1 on a new authorisation)
|
||||
- [ ] V1-2.6 UX U0, contract and decisions, docs only (contract `.claude/tasks/contracts/2026-11-05-v1-2-6-ux-u0.md`; no code, no SQL, no DEV, no U1): [x] V1-2 contract §6.2, §6.4, §6.7, §7.4, §8.2-§8.4, §12.2 + §17.1 (O22), §16.7, §16.12, §17.12 · [x] level-1 contract C3, C4, C5, C6, C7, C8, C11, C13, C16, C18, C20, C25, C28, C32, C33, C40, with the precedence rule of its header · [x] docs/design/README.md · [x] rules sheet-model.md, schemas.md · [x] five UX docs · [x] BDR-101 · [x] preconditions (r5:import-equine --check clean, seed 22/6/0 paths, wasm 592 143 B) · [x] independent verification: ECARTS x6 fixed, then CONFORME 12/12 (2026-11-06); open points for U2/U6 not in docs: point edge-size handle (boards 02/03), default laterality of the automatic access (U6), §15 replay text vs the category.fixed.* filter · [x] commit + push · [x] owner U0 checkpoint (approved for good in the brief « Autorisation de U1 uniquement », 2026-11-06)
|
||||
- [ ] V1-2.6 UX U1, editor shell (brief « Autorisation de U1 uniquement » + « U1 — Validation de la conception interne », approach A; contract `.claude/tasks/contracts/2026-11-06-v1-2-6-ux-u1-1123.md`; plan `.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md`, lots A, B1, B2, C-I; no Rust/SQL/worker/scripts, no DEV, no merge, no U2): [x] design approach A validated by the owner with 10 precisions · [x] owner choices 2026-11-06 (server save time, non-modal references panel, citation button in the finding's detail, board 01 annotation card) · [x] plan written + three-lens challenge (correctness CONCERNS 6, robustness CONCERNS 5, simplicity CONCERNS 2, no BLOCKER) integrated · [ ] owner plan checkpoint · [ ] lots A-I · [ ] gates, verifier, security · [ ] owner U1 checkpoint
|
||||
- [ ] follow-up candidates (owner T14): multi-tab notice; RR item for the rollback limit of the category model (new id, reconcile with develop)
|
||||
- [ ] curves lot (ex-U9, owner T16 2026-11-05): curve handle editing, curved zone move, path remap, path point correction; spec `V1-2-6_UX_PLAN.md` §2 D, tests `V1-2-6_UX_TESTS.md` « Curves lot ». Rule: no feature that lets a path enter a document (package import, zones from the drawing's shapes, a curve drawing tool) ships before or without it. Before the new model is activated on an environment, and before U6 or U8 reaches any environment beyond the throwaway sandbox: read-only count of path geometries in its drafts and published versions (sandbox by U6 itself; DEV and shared environments by the owner or under explicit authorisation; non-zero reopens T16)
|
||||
- [ ] MANDATORY before merging V1-2 into develop (owner 2026-11-03): registry id reconciliation. LRN-095 collides: develop 09655b2 « Port a safe runner verbatim… » (2026-11-02) vs V1-2 « pgTAP across PGlite and the real Supabase image… » (2026-10-28, cited by BDR-084 and the V1-2.1 TODO lines). BLK-013 exists on develop only (« e2e:avatar on develop reached DEV »): `memory.sh` on V1-2 would hand out BLK-013 again, so a V1-2 blocker needs its id checked against develop first. Same for the TODO release-readiness ids: RR-11 is develop's (« sandbox-only e2e follow-ups »), V1-2 uses RR-12. No renumbering during V1-2.6 unless needed; renumber one side and patch its citers at the merge
|
||||
|
||||
@@ -0,0 +1,267 @@
|
||||
# CONTRACT — v1-2-6-ux-u1
|
||||
- date: 2026-11-06 | flow: ship-feature | branch: feature/v1-2-anatomical-sheets
|
||||
- status: active
|
||||
- worktree: /home/bchanot/Documents/faunosteo-v1-2 (every command runs from this absolute path; never from
|
||||
/home/bchanot/Documents/faunosteo; never against DEV: the `supabase_*_faunosteo` containers are DEV; the throwaway
|
||||
sandbox is `faunosteo_dbsandbox_*`, reached only through `pnpm db:sandbox …`)
|
||||
- base: 846994b (T17 recorded, BDR-102). Commit in place, push each commit; no merge, no `gitflow.sh finish`
|
||||
(T13), no sub-branch.
|
||||
- spec: `docs/development/V1-2-6_UX_PLAN.md` §3 U1 and §2 G (undo rules), `docs/development/V1-2-6_UX_TESTS.md` U1,
|
||||
`docs/development/V1-2_ANATOMICAL_SHEETS.md` §8.2-§8.4 and §17.12 as amended, the level-1 contract
|
||||
`.claude/tasks/contracts/2026-11-03-v1-2-6-editor-1509.md` with its U0 notes and header precedence rule,
|
||||
`docs/development/V1-2-6_UX_DECISIONS.md` (T15, T17, « Points from the boards for U1 and later »), boards
|
||||
`docs/design/v1-2-6` (`maquettes.html` is their source).
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
|
||||
# FAUNOSTEO — V1-2.6 UX — Autorisation de U1 uniquement
|
||||
|
||||
Le propriétaire approuve définitivement le checkpoint U0.
|
||||
|
||||
U0 est terminé, vérifié CONFORME 12/12, commité et poussé au HEAD 452a346.
|
||||
|
||||
J'autorise maintenant l'implémentation de U1 uniquement, conformément à V1-2-6_UX_PLAN.md, aux contrats amendés et aux 16 maquettes V2 validées.
|
||||
|
||||
## 1. Périmètre U1
|
||||
|
||||
Implémenter la nouvelle structure générale de l'éditeur anatomique.
|
||||
|
||||
Navigation principale à quatre onglets :
|
||||
- Général
|
||||
- Annotations
|
||||
- Constats
|
||||
- Vérification
|
||||
|
||||
Les références doivent rester accessibles depuis un panneau secondaire, sans imposer un onglet principal supplémentaire.
|
||||
|
||||
Les vues détaillées et les régions vertébrales seront intégrées progressivement à Annotations dans les étapes prévues. U1 ne doit pas anticiper les opérations U2 à U6.
|
||||
|
||||
## 2. Annuler / Rétablir
|
||||
|
||||
Déplacer les commandes globales dans l'en-tête conformément aux maquettes corrigées.
|
||||
|
||||
Contraintes :
|
||||
- Historique global de la fiche.
|
||||
- Conservation du comportement existant et de la pile d'historique.
|
||||
- États activé/désactivé correctement synchronisés.
|
||||
- Raccourcis clavier appropriés.
|
||||
- Noms accessibles explicites, notamment « Annuler la dernière modification ».
|
||||
- Aucun bouton flottant redondant sur le dessin.
|
||||
|
||||
Ne pas confondre Annuler/Rétablir avec l'abandon d'un formulaire.
|
||||
|
||||
## 3. Navigation et compatibilité
|
||||
|
||||
Préserver toutes les fonctions métier de l'ancien éditeur pendant leur réorganisation.
|
||||
|
||||
En particulier :
|
||||
- Aucune perte de brouillon lors d'un changement d'onglet.
|
||||
- Aucun changement non prévu du mécanisme de sauvegarde explicite.
|
||||
- Préservation de la récupération locale.
|
||||
- Préservation des contrôles d'autorisation et du MFA.
|
||||
- Aucune modification des règles de soumission et de publication.
|
||||
- Aucun changement du format des documents anatomiques.
|
||||
- Conservation des chemins et des états nécessaires aux étapes suivantes.
|
||||
|
||||
Ne pas implémenter prématurément des fonctions de V1-2.7 simplement parce qu'elles figurent dans certaines maquettes.
|
||||
|
||||
## 4. Responsive et accessibilité
|
||||
|
||||
Appliquer les règles UX validées :
|
||||
- Barre latérale repliée sous 1 280 px dans l'éditeur.
|
||||
- Navigation accessible au clavier.
|
||||
- Focus visible et cohérent après changement d'onglet.
|
||||
- Annonces et libellés accessibles.
|
||||
- Préservation de la règle O14 A : téléphone en lecture seule sous 1 024 px.
|
||||
- Ne pas supprimer les capacités tactiles déjà présentes sur les largeurs autorisées.
|
||||
|
||||
La manipulation avancée des points et des polygones relève de U2, pas de U1.
|
||||
|
||||
## 5. Décision T17
|
||||
|
||||
Le propriétaire valide la solution suivante pour U6 :
|
||||
|
||||
Lorsqu'aucune catégorie ne porte le rôle `vertebra`, proposer une entrée de secours « Régions vertébrales » depuis Annotations.
|
||||
|
||||
Lorsqu'une catégorie Vertèbres existe, sa configuration doit se faire depuis cette catégorie, sans doublon.
|
||||
|
||||
Enregistrer cette décision selon la convention du registre et actualiser ses dépendances. Ne pas implémenter maintenant le nouveau modèle de catégories.
|
||||
|
||||
## 6. Vérifications
|
||||
|
||||
Avant toute exécution de tests :
|
||||
- Vérifier le répertoire et la branche.
|
||||
- Examiner le statut Git.
|
||||
- Préserver le fichier de revue non suivi.
|
||||
- Inspecter les commandes pour confirmer qu'elles ne visent pas DEV.
|
||||
|
||||
Exécuter les vérifications applicables à U1 :
|
||||
- TypeScript et lint.
|
||||
- Tests unitaires de navigation et d'historique.
|
||||
- Tests de non-régression.
|
||||
- Tests clavier/accessibilité pertinents.
|
||||
- Tests d'intégration et E2E en sandbox jetable strictement isolée, si nécessaires.
|
||||
|
||||
Ne jamais exécuter une commande susceptible de joindre ou modifier Supabase DEV.
|
||||
|
||||
Faire une revue indépendante de la conformité U1 et corriger les écarts justifiés.
|
||||
|
||||
## 7. Git et traçabilité
|
||||
|
||||
Travailler dans :
|
||||
|
||||
`/home/bchanot/Documents/faunosteo-v1-2`
|
||||
|
||||
Sur :
|
||||
|
||||
`feature/v1-2-anatomical-sheets`
|
||||
|
||||
Utiliser les conventions Git du projet, avec commits réguliers et push.
|
||||
|
||||
Ne pas ajouter les fichiers non suivis préexistants sans nécessité et autorisation.
|
||||
|
||||
Ne pas modifier le checkout V1-1.
|
||||
|
||||
## 8. Interdictions
|
||||
|
||||
Aucune modification Rust, SQL, worker ou schéma documentaire.
|
||||
|
||||
Aucune migration, aucune opération sur DEV et aucun déploiement.
|
||||
|
||||
Aucune fusion.
|
||||
|
||||
Ne pas commencer U2, U3, U4, U5, U6, U7, U8 ou V1-2.7.
|
||||
|
||||
## 9. Checkpoint U1
|
||||
|
||||
Fournir :
|
||||
- Liste des modifications réalisées.
|
||||
- Correspondance entre l'interface et les maquettes V2.
|
||||
- Tests réellement exécutés et leurs résultats.
|
||||
- Revue indépendante et verdict exact.
|
||||
- Éventuelles limitations restantes.
|
||||
- Démonstration testable dans la sandbox.
|
||||
- Commits et état Git.
|
||||
- Critères de sortie U1.
|
||||
|
||||
S'arrêter au checkpoint U1.
|
||||
|
||||
Ne pas commencer U2 sans nouvelle autorisation explicite.
|
||||
|
||||
## CLARIFICATIONS
|
||||
Q: The plan's U1 tooling (worker image commit label in `crates/worker/Dockerfile`, `verify-e2e` image check against
|
||||
HEAD, demo sheet provisioned by the trial command in `scripts/db-sandbox.sh`) — the brief forbids worker changes /
|
||||
A: [gated 2026-11-06] defer all of it to U6 (owner). No change under `crates/` or `scripts/` in U1. The U1 demo runs
|
||||
on the existing trial stack: the owner creates a non-equine sheet in the UI as in `docs/development/V1-2-6_OWNER_TRIAL.md`.
|
||||
The PLAN U1 acceptance line « a stale worker image is refused » and the TESTS U1 « Tooling » row move to U6.
|
||||
Q: Where does « Abandonner les modifications » (C11, return to the last saved revision) sit, since the boards show no
|
||||
discard control / A: [gated 2026-11-06] in the header, a secondary button beside the save state and « Enregistrer »,
|
||||
edit mode only, disabled when nothing is unsaved; same confirmation and behaviour as today (owner).
|
||||
Q: Internal design (brief « U1 — Validation de la conception interne », 2026-11-06) / A: [gated 2026-11-06] approach
|
||||
A: the Annotations panel keeps board 01's cards; « Gérer les vues », « Modifier les catégories » and « Régions
|
||||
vertébrales » open the existing level-1 editors in full-width sections with « Retour au dessin », until U3, U4 and U6
|
||||
replace them; four tabs, references in a side panel, history in the header, sidebar hidden below 1 280 px, keyboard
|
||||
navigation, focus management, read-only below 1 024 px. Ten mandatory precisions: no silent loss of changes, history
|
||||
or editing state on a section, tab or panel change; « Retour au dessin » restores a coherent context and an
|
||||
accessible focus; history tests on typed text, shortcuts and section transitions; a save shown only after effective
|
||||
confirmation, never the browser clock as proof of persistence; read-only below 1 024 px on every editing entry,
|
||||
moved forms and shortcuts included; reference counters from the current document, no network, no costly recount per
|
||||
render; no « Prévisualiser » nor withdrawal, no existing function removed; the regions entry respects T17 without
|
||||
anticipating U6; « Abandonner les modifications » only for unsaved changes, confirmed when data can be lost, never
|
||||
removing the local copy silently; no provisional code hard to remove, sections replaceable without rebuilding the
|
||||
navigation. Plan: `.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md`.
|
||||
Q: Save time source / A: [gated 2026-11-06] server time: after a confirmed save, one read of the existing admin
|
||||
endpoint; « Enregistré à hh:mm · révision n » only when `draft_last_save` names the same revision, else « Enregistré ·
|
||||
révision n »; never the browser clock.
|
||||
Q: References panel behaviour / A: [gated 2026-11-06] non-modal: scrim over the content below the tabs (board 11),
|
||||
content inert, header, tabs and Annuler/Rétablir usable, Escape or scrim click closes, content kept across closes.
|
||||
Q: Control opening the filtered panel from a finding / A: [gated 2026-11-06] a « n référence(s) » button in the
|
||||
Citations block of the selected finding's detail; no control inside the ARIA tree.
|
||||
Q: Annotation list layout / A: [gated 2026-11-06] board 01 card « Annotations de la vue » (grouped by category,
|
||||
« Filtrer par nom »), shown when nothing is selected; the properties panel gains « Toutes les annotations » to return
|
||||
to it.
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. Four tabs from 1 024 px: Général, Annotations, Constats, Vérification, as an ARIA tablist (arrows, Home/End not
|
||||
required beyond today's pattern); no « Vues et illustrations », « Références » or « Vertèbres » tab remains; the
|
||||
initial-tab rule of C40 as amended holds (Général for a sheet without a measurable view, else Annotations).
|
||||
2. Annotations holds, with their level-1 operations unchanged: the views and their drawings (main view, detail views,
|
||||
upload, cleaning, attach, the numeric crop editor kept until U4), the annotation categories (level-1 editor kept
|
||||
until U3) and the « Régions vertébrales » fallback entry with the level-1 regions editor (T17, BDR-102; no role
|
||||
exists before U6), laid out after board 01's overview panel; no U2-U6 operation is added (no handle, slider,
|
||||
rectangle, remap, role, opacity).
|
||||
3. References open in a side panel after board 11, from a « Références » button in the header and from a finding
|
||||
(its citation badge), filtered to that finding's citations with « Tout afficher », with search, the citation count
|
||||
per reference, and the level-1 add / edit / delete; read-only (no edit control) in every read-only mode; a modal
|
||||
panel uses `ModalDialog` (D13, BDR-076); closing returns focus to the opener.
|
||||
4. Undo and redo sit at the right of the tab row on every tab (board `hist()`): icon and visible « Annuler » /
|
||||
« Rétablir »; « Annuler » has the accessible name and tooltip « Annuler la dernière modification » (T15); redo's
|
||||
long name is a label proposal; enabled exactly when the store can undo or redo AND the editor is in edit mode with
|
||||
no recovery pending; disabled in every read-only mode (narrow, frozen, rights, inactive, historical, recovery
|
||||
pending, saving); the same `undo()`/`redo()` store actions as today, history and its 8 MiB bound unchanged;
|
||||
Ctrl+Z and Ctrl+Shift+Z unchanged; the undo and redo buttons of the tool column are removed (no pair on the
|
||||
drawing).
|
||||
5. Undo from any tab reverts the last accepted commit, whichever tab made it; a field holding typed text is committed
|
||||
before the header undo, and that commit is what the undo reverts (behaviour pinned by a test).
|
||||
6. « Abandonner les modifications » replaces « Annuler les modifications » in the header beside « Enregistrer »
|
||||
(clarification), with the same confirmation and `discardChanges` behaviour; C28's list names it.
|
||||
7. The header save line follows the boards: « n modification(s) non enregistrée(s) » while unsaved (count through the
|
||||
existing plural mechanism), « Enregistrement… » while saving, « Enregistré à hh:mm · révision n » after a save in
|
||||
this page session; « Révision n » when nothing was saved yet in the session; the save mechanism itself unchanged.
|
||||
8. The Vérification tab shows the boards' text badge « n erreur(s) » (plural mechanism) when the in-page check has
|
||||
errors.
|
||||
9. In the editor, the application sidebar is hidden below 1 280 px and shown from 1 280 px; below 1 280 px the top bar
|
||||
shows the menu button, which opens the existing drawer (D11, BDR-079) one tap away; the drawer does not close by
|
||||
itself while the sidebar stays hidden; every menu link stays under the leave guard (BDR-078); other pages keep
|
||||
today's 1 024 px rule.
|
||||
10. From 1 024 to 1 279 px the editor follows board 13: properties beside the canvas (C25 as amended), header actions
|
||||
in reach; no horizontal scroll at 1 024, 1 180, 1 279 and 1 280 px on any tab and with the references panel open.
|
||||
11. Below 1 024 px (O14 A, C16 as amended): read-only as today, notice title alone, badges, tabs, whole drawing, zoom
|
||||
and pan, properties summary, no editing action and no enabled undo or redo; unsaved work survives a width change;
|
||||
no horizontal scroll at 320, 375 and 768 px; touch abilities already present from 1 024 px kept.
|
||||
12. Focus and announcements: clicking or arrowing a tab keeps focus on that tab; a tab change started from inside a
|
||||
panel (a hint link, « Aller à ») moves focus to its target element, or to the new tab when there is none, never to
|
||||
`body`; a polite live region (distinct from the save status) announces a tab or section reached that way; focus
|
||||
is visible on every new control.
|
||||
13. « Aller à » reaches every issue kind in its new place: views, categories and regions in Annotations (the section
|
||||
shown and its row focused), references in the side panel (opened, the reference focused), annotations, findings
|
||||
and general fields as today.
|
||||
14. Unchanged: the explicit save, the local recovery (C13, C27, C28), conflicts, rights and MFA checks, the mode
|
||||
precedence (C38), submission and publication rules, the document format, Rust, SQL, the worker, the core and its
|
||||
wasm build; level-1 criteria C13, C14, C16, C34 and C41 re-run green.
|
||||
15. No V1-2.7 control: no « Prévisualiser », no withdrawal (DECISIONS « Points from the boards »).
|
||||
16. i18n: every string through `useT`, FR/EN parity; prose that names an old tab is reworded to the new place; the new
|
||||
labels are listed as proposals in `.claude/audits/2026-11-06-v1-2-6-u1-label-proposals.md` for the owner's label
|
||||
review (C19, C44).
|
||||
17. Tests: unit tests for the tab model and tiers, header undo/redo states (edit and every read-only mode), cross-tab
|
||||
undo, the typed-field flush, the references panel (open from header and finding, filter, close, focus return),
|
||||
« Aller à » targets, the sidebar rule, the save line; e2e helpers (`e2e/support/editor.ts`, `warm-up.ts`) and
|
||||
specs rewritten for the new shell; every removed or rewritten assertion mapped to its replacement in the commit
|
||||
message (R-24); axe with no serious or critical violation on the four tabs, the open references panel and the
|
||||
narrow read-only mode; a keyboard test of the order header → tabs → panel → canvas.
|
||||
18. Gates, in this order, all green: `pnpm typecheck`, `pnpm lint`, `pnpm test:run`, `pnpm build`, `pnpm e2e:ui`,
|
||||
a fresh sandbox `pnpm db:sandbox up fresh` then `test-db → e2e-shell → test` (LRN-113), `pnpm check:all`,
|
||||
`pnpm r5:import-equine --check`; a fresh verifier and a fresh security review.
|
||||
19. Scope: no change under `crates/`, `supabase/`, `scripts/`, `packages/core-wasm/src/`, `packages/supabase/src/`,
|
||||
`docs/design/v1-2-6/`; nothing staged from the untracked review file.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet 846994b..HEAD -- crates supabase scripts packages/core-wasm/src packages/supabase/src docs/design/v1-2-6 && git diff --quiet -- crates supabase scripts packages/core-wasm/src packages/supabase/src docs/design/v1-2-6 && ! git ls-files --error-unmatch faunosteo-v1-2-6-revue-ux-chatgpt.md >/dev/null 2>&1 && echo U1_SCOPE_OK
|
||||
EXPECT: U1_SCOPE_OK
|
||||
EVIDENCE: pending
|
||||
20. FR/EN dictionaries hold the same keys.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && node -e "const fs=require('fs');const k=f=>new Set([...fs.readFileSync(f,'utf8').matchAll(/^\s*'([a-z0-9_.]+)':/gm)].map(m=>m[1]));const a=k('apps/app/src/i18n/fr.ts'),b=k('apps/app/src/i18n/en.ts');const d=[...a].filter(x=>!b.has(x)).concat([...b].filter(x=>!a.has(x)));if(d.length||a.size<100){console.error(d);process.exit(1)}console.log('I18N_PARITY_OK',a.size)"
|
||||
EXPECT: I18N_PARITY_OK
|
||||
EVIDENCE: pending
|
||||
|
||||
## FILE SCOPE
|
||||
- apps/app/src: editor tabs model (`editor/tabs.ts`, `editor/useViewport.ts`, `editor/verification.ts`,
|
||||
`editor/focusRequest.ts`, `editor/annotations/focusTarget.ts`), editor state selectors needed for the header
|
||||
(`editor/state/*`, read-only additions only: save count, save time), `components/editor/**` (EditorTabs,
|
||||
EditorTabBody, DraftHeader, tab bodies, annotations panels, references panel, verification), `components/shell/
|
||||
{AppLayout,MobileDrawer,SidebarNav}.tsx`, `app/routes/app/admin/AdminSheetDraftRoute.tsx`, `i18n/{fr,en}.ts`
|
||||
- apps/app/tests/unit/**, apps/app/tests/helpers/**, apps/app/e2e/** (support helpers, shell and ui specs)
|
||||
- docs: `docs/development/V1-2-6_OWNER_TRIAL.md` (U1 demo steps), `docs/development/BROWSER_TESTS.md` if a suite
|
||||
changes, `docs/development/V1-2-6_UX_{PLAN,TESTS}.md` (tooling moved to U6), `.claude/audits/2026-11-06-v1-2-6-u1-
|
||||
label-proposals.md`
|
||||
- .claude/tasks (this contract, plan, TODO), .claude/memory (through memory.sh)
|
||||
- NOT in scope: crates/**, supabase/**, scripts/**, packages/core-wasm/src/**, packages/supabase/src/**,
|
||||
docs/design/v1-2-6/**, the V1-1 checkout
|
||||
@@ -0,0 +1,685 @@
|
||||
# Plan: V1-2.6 UX U1, editor shell (four tabs, sections, references panel, header history)
|
||||
|
||||
> For agentic workers: executed lot by lot under `subagent-driven-development` (ship-feature STEP 4); each lot is
|
||||
> one coherent change, committed and pushed by the orchestrator after its own checks.
|
||||
|
||||
Status: REVISED after the three-lens challenge (2026-11-06, record at the end), for the owner's plan checkpoint. No
|
||||
application code is written before the owner approves this plan (brief « U1 — Validation de la conception
|
||||
interne »).
|
||||
|
||||
- Goal: replace the seven-tab level-1 shell of the draft editor by the four-tab shell of the validated v1-2-6
|
||||
boards, with approach A (owner, 2026-11-06): the level-1 editors of views, categories and vertebral regions open in
|
||||
full-width sections of Annotations with « Retour au dessin », References in a side panel, history in the header.
|
||||
- Architecture: a pure navigation model (tab, Annotations section, references panel, focus request) held by the
|
||||
editor workspace; every visited place stays mounted and is hidden with the `hidden` attribute, so no switch loses
|
||||
state and no effect re-runs on a switch; the unsaved count is derived from the history the store already holds; the
|
||||
store gains one display field (`lastSave`, the server's save time).
|
||||
- Stack: React 19.2.6, Zustand 5, Tailwind 4 (`lg` 64rem, `xl` 80rem; preflight hides `[hidden]` with `!important`),
|
||||
vitest + happy-dom, Playwright 1.64.1 + axe on the throwaway sandbox.
|
||||
- Spec: contract `.claude/tasks/contracts/2026-11-06-v1-2-6-ux-u1-1123.md` (AC1-AC20, CLARIFICATIONS
|
||||
[gated 2026-11-06]); `docs/development/V1-2-6_UX_PLAN.md` §3 U1 and §2 G; `docs/development/V1-2-6_UX_TESTS.md`
|
||||
U1; `docs/development/V1-2-6_UX_DECISIONS.md` (T11, T15, T17, « Points from the boards for U1 and later »); level-1
|
||||
contract `.claude/tasks/contracts/2026-11-03-v1-2-6-editor-1509.md` (header precedence rule, C3, C4, C5, C6, C11,
|
||||
C13, C14, C16, C27, C28, C32, C34, C36, C38, C40, C41, C44, C47 as amended); boards `docs/design/v1-2-6` 01, 11,
|
||||
12 A, 13 (source `maquettes.html`: `hist()` :287, `save()` :292, `overviewPanel()` :325, board 11 :615-628); board
|
||||
05 of v1-2-4 for the narrow read-only mode.
|
||||
- Reading list for every executor: the contract, this plan, the files named in its lot, `.claude/rules/i18n.md`,
|
||||
`.claude/rules/stores.md`.
|
||||
- Format: the project's lot format (precedent `.claude/tasks/plans/2026-11-03-v1-2-6-editor.md`): every choice is
|
||||
closed here, executors write the code and the tests named per lot.
|
||||
|
||||
## Global constraints
|
||||
|
||||
- Worktree `/home/bchanot/Documents/faunosteo-v1-2`, branch `feature/v1-2-anatomical-sheets`, base 846994b; every
|
||||
shell command starts with `cd /home/bchanot/Documents/faunosteo-v1-2 &&` (LRN-110). Commit in place, push each
|
||||
commit, no sub-branch, no merge, no `gitflow.sh finish` (T13).
|
||||
- Never DEV: no `pnpm db:start`, `db:reset`, `db:test`, `db:types`, `pnpm supabase …`, `e2e:avatar`,
|
||||
`e2e:sheet-assets`; database work only through `pnpm db:sandbox …` (containers `faunosteo_dbsandbox_*`).
|
||||
- The sandbox is shared with the level-1 owner trial stack: Lot B1 runs `pnpm db:sandbox up fresh`, which wipes the
|
||||
trial accounts and data (`scripts/db-sandbox.sh:47-60`). Approving this plan authorises that wipe; no other
|
||||
checkout runs the sandbox during U1.
|
||||
- No change under `crates/`, `supabase/`, `scripts/`, `packages/core-wasm/src/`, `packages/supabase/src/`,
|
||||
`docs/design/v1-2-6/` (AC19 CHECK); `faunosteo-v1-2-6-revue-ux-chatgpt.md` never staged.
|
||||
- No U2-U6 operation (no handle, slider, rectangle, remap, role, opacity, own-colour revert, category fold, view
|
||||
menu), no V1-2.7 control (no « Prévisualiser », no withdrawal), no existing function removed (owner precision 7).
|
||||
- Store rules unchanged: `undoStep()` / `redoStep()`, `HISTORY_LIMIT_BYTES` 8 388 608, one commit per change on
|
||||
blur, confirm or pointer-up (BDR-050), the save request, the recovery copy (C13, C27, C28), conflicts (C12, C29),
|
||||
mode precedence (C38). Store addition: `lastSave` only (Lot E); the count is a selector.
|
||||
- Every string through `useT`, FR/EN key parity (AC20), counts through `usePlural` (`editor/plural.ts`, C36); new
|
||||
labels are proposals (C44) listed in `.claude/audits/2026-11-06-v1-2-6-u1-label-proposals.md`. Prose naming a
|
||||
place is reworded in the lot that moves that place.
|
||||
- Focus moves only through the navigation hook or a one-shot focus request; no kept-mounted component focuses or
|
||||
scrolls in a mount effect.
|
||||
- Our code: functions at most 25 logic lines, 5 params, 5 locals, 100 columns in TypeScript (project exception).
|
||||
`DraftEditor`, `DraftHeader`, `EditorTabs`, `FindingsTab` and `AppLayout` already exceed 25 lines: each one this
|
||||
plan touches is split along the lines below, never grown.
|
||||
- Browser suites stay green at every lot: each lot from B1 rewrites the e2e assertions its change breaks (mapped in
|
||||
its commit message, R-24) and runs every `apps/app/e2e/shell/editor-*.spec.ts` on the sandbox started in Lot B1
|
||||
(`pnpm db:sandbox e2e-shell <spec>` per spec); a spec that breaks and is not in the lot's list is added to the
|
||||
lot, never skipped. The full suites run in Lot H and in the gate order of Lot I on a new fresh sandbox.
|
||||
- Queries: tests never query labels or text page-wide; they scope to the visible place (`data-place` hook, below)
|
||||
or use role queries, which ignore hidden content.
|
||||
|
||||
## Review focus (failure modes no single lot owns; each pinned by a test in the named lot)
|
||||
|
||||
1. A hidden place answers instead of the visible one: a focus request consumed by a hidden body, a label or text
|
||||
locator matching a hidden copy (« Nom (FR) » labels the sheet, a region and an annotation), a static `id`
|
||||
repeated. Pinned in Lot B2 (requests routed to their owner, unique ids once every place is visited, Chromium spec
|
||||
of the keep-alive and focus rules) and every lot's e2e scoping.
|
||||
2. Undo from another place removes what a kept place still shows: the canvas's current view (with a pending
|
||||
creation or a tracing on it), the selected annotation, the finding the references filter names. Pinned in Lot B1
|
||||
(full canvas reset to the main view) and Lot D (filter falls back to « Tout afficher »).
|
||||
3. The save line says something false: a count after undoing past the save point, after a trim by a commit, an undo
|
||||
or a redo, after a restored copy, after commits or undos during a save; a time from another revision or an old
|
||||
save. Pinned in Lot E (`savedDistance` table, including the sequences the challengers found; `saveLineState`
|
||||
table; `readSaveTime` drops late answers and is skipped on `draft.unchanged`).
|
||||
4. A width change across 1 024 px with a section or the panel open: every place turns read-only in place, unsaved
|
||||
document changes kept, edit mode back on widening, no crash. Creation forms (canvas pending creation and every
|
||||
`!readOnly` form) unmount as today: documented limit, section 2. Pinned in Lot H.
|
||||
5. The references panel over the header: Enregistrer, Annuler and Rétablir must stay clickable with the panel open.
|
||||
Pinned in Lot D (Chromium check at 1 024 and 1 280 px).
|
||||
|
||||
---
|
||||
|
||||
## Architecture (closed decisions)
|
||||
|
||||
### 1. Navigation model (owner precisions 1, 2, 10)
|
||||
|
||||
- New pure module `apps/app/src/editor/navigation.ts`:
|
||||
- `ANNOTATION_SECTIONS = ['drawing', 'views', 'categories', 'regions'] as const`, `AnnotationSection`.
|
||||
- `EditorTarget = { place: 'tab'; tab: EditorTabId; section: AnnotationSection | null; key: ElementKey | null }
|
||||
| { place: 'references'; key: ElementKey | null; citedBy: ElementKey | null }`. One encoding: a target on
|
||||
Annotations always names its section (`'drawing'` for the canvas); `section` is null on the other tabs.
|
||||
- `targetOfKey(key: ElementKey): EditorTarget`: `sheet` → general; `zone`, `finding` → findings; `annotation` →
|
||||
annotations/drawing; `view` → annotations/views; `category` → annotations/categories; `region` →
|
||||
annotations/regions; `reference` → references (citedBy null). The only place a key meets a place.
|
||||
- `FocusRequest = { target: EditorTarget; serial: number }` is defined here (Lot A) and re-exported by
|
||||
`editor/focusRequest.ts` from Lot B1.
|
||||
- `NavigationState = { tab; section; references: { open: boolean; citedBy: ElementKey | null }; visitedTabs:
|
||||
readonly EditorTabId[]; visitedSections: readonly AnnotationSection[]; referencesMounted: boolean; focus:
|
||||
FocusRequest | undefined }`; `initialNavigation(tab)`.
|
||||
- `navigationReducer(state, action)`, actions `select_tab` (manual; keeps the Annotations section; no focus
|
||||
request), `open_section`, `back_to_drawing`, `open_references` (citedBy) and `close_references` (both keep tab and
|
||||
section: the panel opens over whatever is shown), `go_to` (target: sets tab, section or panel; `focus = { target,
|
||||
serial: previous + 1 }`), `focus_consumed` (serial). Visited lists grow, never shrink.
|
||||
- `useFocusRequest(focus, apply: (target) => 'found' | 'kept' | 'none')` reports `consumed(serial, outcome)`
|
||||
through `FocusConsumedContext` (`kept`: the place kept a creation or tracing in progress instead of jumping,
|
||||
section 4); `useRowFocus` returns `found` or `none`. A request is passed only to the body,
|
||||
section or panel its target names; `FindingsTab`'s `focusId` becomes one-shot (cleared once applied,
|
||||
`findings/FindingTree.tsx:31-33`, `tabs/FindingsTab.tsx:47,73,90`), so a later visit never re-focuses the tree and a
|
||||
second « Aller à » to the same finding focuses it again.
|
||||
- New hook `apps/app/src/editor/useEditorNavigation.ts`, called in the new `EditorWorkspace` (rendered only once the
|
||||
version is ready, so `initialTab(previewState, tier)` is known at mount: lazy `useReducer` initialiser, no
|
||||
render-phase `setTab`, no reset action; reloads keep `status: 'ready'`, `editorLoad.ts:136-152`). It owns the DOM
|
||||
side:
|
||||
- stable callbacks (`useCallback` over `dispatch`): `navigate(target, opener?)`, `selectTab(tab)`,
|
||||
`openSection(section, opener)`, `backToDrawing()`, `openReferences(citedBy, opener)`, `closeReferences()`;
|
||||
- before every move (tab click or key, « Plus » item, section entry, « Retour au dessin », panel open, panel close
|
||||
by ✕, Escape or scrim, « Aller à », hint link), `commitFocusedField()` (new in `editor/focusRequest.ts`): when
|
||||
`document.activeElement` is an `input`, `textarea` or `select` inside the editor, `blur()` it, so its
|
||||
`TextField` commits on blur (`TextField.tsx:75-79`) before the place is hidden. Today an unmount commits that
|
||||
text (`TextField.tsx:61-68`); kept-mounted places never unmount, and Safari and iPadOS do not move focus to a
|
||||
tapped button, so the blur is forced rather than assumed (confirmation challenge);
|
||||
- openers kept in a ref (`section`, `references`), never in state;
|
||||
- after each programmatic move, in an effect keyed on the move: focus the request's element, else the section
|
||||
heading, the panel heading, the active tab button `#editor-tab-<id>`, or « Plus » when the active tab sits in
|
||||
the closed « Plus » list (< 640 px); never `body`;
|
||||
- one polite live region text `{ text, serial }` on programmatic moves only (go to, hint links, section open and
|
||||
back, panel open and close): « Annotations · Vues », « Références »; rendered as `<p aria-live="polite"
|
||||
className="sr-only">`, distinct from the save status (AC12); a repeated text alternates a trailing no-break
|
||||
space.
|
||||
- `EditorTabProps` becomes `EditorPlaceProps = { readOnly: boolean; navigate: (target: EditorTarget, opener?:
|
||||
HTMLElement | null) => void; focus?: FocusRequest; reloadSheet: () => void }`. The route computes `readOnly` once
|
||||
and passes `!readOnly` to `useUndoShortcuts` and to the history buttons (no third spelling of the predicate).
|
||||
|
||||
### 2. Kept-mounted places (precision 1: no silent loss on a tab, section or panel change)
|
||||
|
||||
- Each visited tab panel, each visited Annotations section and the references panel once opened stay mounted inside
|
||||
a plain wrapper `<div data-place="…" hidden={!visible}>` (no display class on the wrapper; Tailwind 4 preflight
|
||||
forces `display: none` on `[hidden]`). Hidden content keeps its state (canvas reducer: tool, selection, pending
|
||||
creation, tracing; framing; findings selection and expansion; every `DraftField` form; an open crop group) and
|
||||
leaves the accessibility tree and axe.
|
||||
- Why not React 19.2 `<Activity>`: it re-runs every effect on reveal, which resets zoom and pan
|
||||
(`catalogue/useFraming.ts:69`, `setFraming(FIT)` on mount) and re-focuses the findings tree
|
||||
(`FindingTree.tsx:31-33`)
|
||||
on each return (correctness challenge). With `hidden`, no effect runs on a switch; typed text is committed by the
|
||||
forced blur of section 1 before any move.
|
||||
- One composed copy of a view in the page: the core gives every composition of a view the same id scope
|
||||
(`fv.<view>.`, `crates/core/src/anatomy/compose.rs:164,193`), so the edit drawing (`AnnotationCanvas`) and the
|
||||
views section's `CropCanvas` (`views/CropCanvas.tsx:33`, the parent view) would repeat ids and let `url(#…)`
|
||||
resolve into a hidden copy. The wrapper `KeptPlace({ name, visible, children })` provides `usePlaceVisible()`
|
||||
(nested: parent and own); both canvases detach their composed tree while their place is hidden and rebuild it on
|
||||
show (an effect keyed on that flag; component state, zoom and pan included, stays). The Vues card rows carry no
|
||||
drawing thumbnail for the same reason (visible choice 17).
|
||||
- `data-place` values: `general`, `findings`, `verification`, `annotations.drawing`, `annotations.views`,
|
||||
`annotations.categories`, `annotations.regions`, `references`. The tab panels themselves are
|
||||
`<div role="tabpanel" id="editor-panel-<tab>" aria-label="<tab name>">` (aria-label kept as today, so a panel whose
|
||||
tab sits in the closed « Plus » list still has a name); tabs carry `aria-controls` to their own panel.
|
||||
- Cost control: hidden places re-render on store changes. `editor/sheetDocument.ts` gets a single-entry module cache
|
||||
keyed on the document text, so all places share one `JSON.parse` per commit; the workspace passes stable props
|
||||
(memoised callbacks). Lot H records the commit-to-paint time with every place visited on the equine spec; above the
|
||||
500 ms budget of the UX plan, STOP and report.
|
||||
- Unique ids: grep found `finding-*`, `views-main-title`, `annotation-category`, `conflict-keep-hint`, each in one
|
||||
place; a Lot B2 test visits every place and asserts no `id` repeats.
|
||||
- Documented limit, unchanged from level 1: a width change across 1 024 px or a recovery decision switches between
|
||||
read-only and edit rendering; the canvas's pending creation and every creation form rendered under `!readOnly`
|
||||
(`CategoriesSection.tsx:51`, `ReferencesTab.tsx:44`, `ViewsTab.tsx:65`, `VertebraeTab.tsx:49`,
|
||||
`FindingsTab.tsx:105`) unmount then with their typed text. Keeping them would break precision 5. No tab, section or
|
||||
panel change is involved.
|
||||
|
||||
### 3. Four tabs and the tab row (AC1, AC8)
|
||||
|
||||
- `apps/app/src/editor/tabs.ts`: `EDITOR_TABS = ['general', 'annotations', 'findings', 'verification']`; tiers: wide
|
||||
and medium show the four; small (< 640 px) shows Annotations and Vérification with Général and Constats under the
|
||||
existing « Plus » disclosure (today's rule minus the removed tabs). `initialTab` unchanged in substance (C40 as
|
||||
amended).
|
||||
- `EditorTabs.tsx` split into `EditorTabs` (row), `TabList` (role `tablist`, tabs only, arrows as today) and
|
||||
`MoreTabs` (small tier). The row is `flex`: tablist, « Plus », then the history buttons at the right (Lot E),
|
||||
outside the tablist.
|
||||
- Vérification badge: visible text « n erreur(s) » / « n error(s) » through `usePlural` (keys
|
||||
`editor.tab.errors_one`, `editor.tab.errors_other`), inside the tab's accessible name; the aria-hidden number goes.
|
||||
|
||||
### 4. Annotations: drawing, overview panel, sections (approach A, AC2, T17)
|
||||
|
||||
- `components/editor/tabs/AnnotationsTab.tsx` hosts the drawing workspace and each visited section. The registry
|
||||
`ANNOTATION_SECTION_BODIES: Record<Exclude<AnnotationSection, 'drawing'>, { titleKey; Body }>` in
|
||||
`components/editor/annotations/sections/registry.ts` is the one place later steps edit (U3 replaces `categories`,
|
||||
U4 replaces `views`, U6 adds the vertebra-role path and removes `regions` when the role exists).
|
||||
- Section frame `components/editor/annotations/sections/AnnotationSection.tsx`: « Retour au dessin » first, then an
|
||||
`h2` (tabIndex -1), then the body full width. Opening focuses the `h2` through the hook; « Retour au dessin » →
|
||||
`backToDrawing()`, focus to the overview entry that opens this section when it is rendered, else the canvas box
|
||||
(focusable today for keyboard pan), never `body`.
|
||||
- Bodies reuse the level-1 editors unchanged in behaviour, moved with `git mv`: `tabs/ViewsTab.tsx` →
|
||||
`annotations/sections/ViewsSection.tsx` (views, upload, cleaning, attach and repair, numeric crop editor until U4);
|
||||
`general/CategoriesSection.tsx` leaves `GeneralTab` and becomes the `categories` body (level-1 editor until U3);
|
||||
`tabs/VertebraeTab.tsx` → `annotations/sections/RegionsSection.tsx` (↑/↓ kept, code read-only after creation,
|
||||
C5). No role check is written: before U6 no role exists, so the T17 fallback entry is always shown (a comment at the
|
||||
entry cites T17 and U6).
|
||||
- Overview panel `components/editor/annotations/OverviewPanel.tsx` (board 01 `overviewPanel()`), in the side column
|
||||
when nothing is selected or pending, in edit and read-only modes:
|
||||
- « Vues » (Lot B1): one row per view (name, « Vue principale » or « Vue détaillée », « n annotations »), each a
|
||||
button selecting that view (`aria-current` on the shown one); « Gérer les vues » (read-only « Voir les vues »).
|
||||
Not built: « Nouvelle », ⋮ (U4, U5).
|
||||
- « Catégories » (Lot B1): one chip per category (swatch, name), the count; « Modifier les catégories »
|
||||
(read-only « Voir les catégories ») and « Régions vertébrales » with the region count (T17). Not built: the fold
|
||||
(U3).
|
||||
- « Annotations de la vue » (Lot C, owner choice): annotations of the shown view grouped by category in document
|
||||
order, « Sans catégorie » only if a document holds one, count per group, « Filtrer par nom » (case- and
|
||||
accent-insensitive on the displayed name, through `folded` exported from `catalogue/useCatalogue.ts:53`), every
|
||||
row a button selecting the annotation (`aria-current`), all rows shown. The list under the drawing moves here.
|
||||
- `PropertiesPanel` gains « Toutes les annotations » (edit and read-only, Lot C): clears the selection, shows the
|
||||
overview, focuses the deselected annotation's row.
|
||||
- Counts per view, category and region come from one memoised derivation of the parsed document
|
||||
(`editor/annotations/overview.ts`), no core call, no network.
|
||||
- When the canvas's current view no longer exists (undo, delete in the views section), edit mode dispatches the full
|
||||
reset `{ type: 'view', viewId: main }` (`initialUi` clears pending creation, tracing, selection and hint,
|
||||
`editor/annotations/uiState.ts:55-64`), so a pending point is never inserted on another view
|
||||
(`creationAttempt.ts:38`); the read-only body sets its `viewId` to the main view and clears its selection.
|
||||
The reset is dispatched only when `ui.viewId` names a view absent from the document and the main view exists
|
||||
(`view` always returns a new state, `uiState.ts:57`, so an unconditional dispatch would loop).
|
||||
- « Aller à » an annotation while a creation is pending (`ui.pending`) or a tracing is open (`ui.tracing`: new zone,
|
||||
link or « Remplacer par un polygone »): it is kept, Annotations shows it, `apply` answers `kept`, focus goes to the
|
||||
creation panel heading (`CreationPanel.tsx:90`, tabIndex -1 added) or to the tracing bar, and the live region says
|
||||
a creation or a tracing is in progress (no `view` or `select` dispatch, which would drop it,
|
||||
`EditableAnnotations.tsx:60-65`, `uiState.ts:56-67`); the target can be reached again once it is finished or
|
||||
abandoned.
|
||||
- Retargeted links (Lot B1): `UnmeasuredHint` (`PropertiesPanel.tsx:159-175`) and `ToolNotes`
|
||||
(`EditableAnnotations.tsx`) navigate to `annotations/views` with the view's key; their prose and
|
||||
`no_category`/`no_child_view` are reworded in the same lot.
|
||||
- Layout 1 024-1 279 px (board 13, C25 as amended, Lot C): the side column sits beside the canvas from `lg`
|
||||
(`lg:grid-cols-[minmax(0,1fr)_22rem]`, `EditableAnnotations.tsx:94` and the read-only body), measured before any
|
||||
CSS change (LRN-094).
|
||||
|
||||
### 5. References side panel (AC3; owner choices: non-modal, button in the finding's detail)
|
||||
|
||||
- `components/editor/references/ReferencesPanel.tsx` (from `tabs/ReferencesTab.tsx`, `git mv`, Lot B1 minimal,
|
||||
Lot D complete), mounted at the first opening and kept mounted (`data-place="references"`). A `section` labelled
|
||||
by its `h2` « Références » (tabIndex -1).
|
||||
- Position (board 11, robustness challenge): the panel and its scrim live in a `relative` container that starts after
|
||||
the tab row and holds the tab panels; the panel is `absolute right-0 top-0 bottom-0`, width `min(27rem, 100%)`,
|
||||
with a `sticky top-14` inner box of height `calc(100dvh - 3.5rem)` and its own scroll; it never covers the draft
|
||||
header or the tab row. The scrim covers the tab panels only; while open they get `inert`. Header (Références, save
|
||||
line, Abandonner, Enregistrer), tab row and Annuler/Rétablir stay usable; Ctrl+Z works (no `dialog[open]`). DOM
|
||||
order: header → tab row → panel → tab panels.
|
||||
- Closing: ✕ « Fermer les références », Escape inside the panel, a scrim click; focus returns to the opener when it is
|
||||
connected and visible, else the header « Références » button. A `DeleteDialog` opened from the panel is the only
|
||||
modal on screen (D13 unchanged).
|
||||
- Content (Lot D): chip « Citées par « {nom} » (n) » when opened from a finding, « Tout afficher (N) » clears it;
|
||||
field « Rechercher une référence » (case- and accent-insensitive on citation, DOI and URL, `folded`); per reference
|
||||
its type, « citée n fois » and the level-1 fields and actions (edit, ↑/↓, delete with dependents listed, add form).
|
||||
↑/↓ only when neither filter nor search is active. Read-only modes: no edit control.
|
||||
- The filter is the finding's key, re-read from the current document on each render; a finding that no longer exists
|
||||
clears it.
|
||||
- « Aller à » on a reference: the reducer clears `citedBy`; the panel clears its search on that request, then focuses
|
||||
the card after the commit that shows it (two phases: the card does not exist while a search hides it).
|
||||
- Citation counts: pure `citationCounts(doc): ReadonlyMap<string, number>` in
|
||||
`apps/app/src/editor/references/citations.ts`, counting `reference_ids` over `buildItems(doc)`
|
||||
(`editor/findings/tree.ts:161`, every finding category and node), memoised on the parsed document (precision 6).
|
||||
Boundary note (BDR-043, EVAL-034): a display count read from the document, no rule; the core's `sheet.dependents`
|
||||
stays the authority for refused deletions.
|
||||
- Opening points: header « Références » (all modes, `aria-expanded`, `aria-controls`, Lot B1); in the selected
|
||||
finding's detail (`findings/FindingContent.tsx` Citations block) a button « n référence(s) » when it cites at
|
||||
least one, opening the panel filtered to it (Lot D).
|
||||
|
||||
### 6. Header and history (AC4-AC7, T15, precisions 3, 4, 9)
|
||||
|
||||
- `DraftHeader.tsx` split in Lot B1 (first header control) into `DraftHeader` (title, badges), `HeaderActions`
|
||||
(« Références », separator, save line, discard, « Enregistrer ») and `SaveLine`. Badges, heading focus and the
|
||||
edit-mode-only rule of discard and Enregistrer unchanged; « Prévisualiser » not built; the right group wraps under
|
||||
the title when the width requires it (measured in Lot H).
|
||||
- `components/editor/HistoryButtons.tsx` (Lot E) at the right of the tab row on every tab: glyph + visible
|
||||
« Annuler » / « Rétablir »; accessible name and `title` « Annuler la dernière modification » (T15) and « Rétablir la
|
||||
dernière modification annulée » (proposal); `aria-keyshortcuts` « Control+Z », « Control+Shift+Z »; below 640 px
|
||||
the label is visually hidden (name kept); 44 px targets below 1 280 px (board 13).
|
||||
- Enabled exactly when the route's `!readOnly` (edit mode, no recovery pending: the shortcut's predicate) and the
|
||||
store can step. Saving does not disable them (amendment of AC4, below): the store already accepts a step during a
|
||||
save and keeps such changes unsaved (`editorSave.ts:118`), and Ctrl+Z is unchanged there.
|
||||
- `aria-disabled` instead of `disabled`, so a button that becomes unusable keeps focus.
|
||||
- `onPointerDown`: `commitFocusedField()` (section 1) first; the field's `TextField` commits on blur. The click
|
||||
handler then reads `getState()` and steps when `!readOnly` and the store can step. So typed text is the last
|
||||
change and the undo reverts exactly it (AC5), with an empty history too; keyboard users reach the button with
|
||||
Tab, which blurs the field the same way.
|
||||
- A refused blur commit (the field shows its error, `aria-invalid="true"`, e.g. `editor.field.required_names`): the
|
||||
undo is skipped and focus returns to that field, so an earlier unrelated change is never undone in its place.
|
||||
- No layout shift between press and release: the save line reserves the width of its longest form in both locales
|
||||
(tabular figures), so the tab row does not move when the blur's commit changes the line (LRN-104).
|
||||
- The tool column's pair is removed (`ToolColumn.tsx:83-84`, `:122-133`); ToolColumn's whole glyph map moves to
|
||||
`components/editor/EditorGlyph.tsx` (plus `search`), one glyph table for the editor; `book` and `close` come from
|
||||
`components/ui/Icon.tsx`, unchanged.
|
||||
- Unsaved count, a selector (`apps/app/src/editor/saveLine.ts`, `savedDistance(state)`), no store field: the saved
|
||||
text, the shown text and the history entries are the same strings (`editorLoad.ts:81-82`, `:138-139`;
|
||||
`editorSave.ts:86`; `editorEdit.ts:58`, `:76`; `undo.ts:52-73`). `staleBase` → null; `documentText === savedText` →
|
||||
0; else the 1-based depth of the nearest undo entry whose `text === savedText`, else the same in redo, else null.
|
||||
Memoised on the identities of `documentText`, `savedText`, `undo`, `redo`. It covers load, reload, discard, restore,
|
||||
every trim (commit, undo and redo all call `bounded()`), commits and undos made during a save.
|
||||
- Save line (`saveLineState(state)` in the same module), first match wins:
|
||||
1. a copy issue (cap or quota): today's text;
|
||||
2. `saving`: « Enregistrement… »;
|
||||
3. `unsaved`: « n modification(s) non enregistrée(s) » when `savedDistance` is a positive number, else
|
||||
« Modifications non enregistrées »;
|
||||
4. `lastSave` and `lastSave.revision === savedRevision`: « Enregistré à hh:mm · révision n » when
|
||||
`lastSave.savedAt` is known, else « Enregistré · révision n »;
|
||||
5. « Révision n ».
|
||||
The visible line is a plain `<p>`; a separate visually hidden `role="status"` announces state changes only
|
||||
(unsaved, saving, saved, copy issue), never each count change (robustness challenge).
|
||||
- Store addition `lastSave: { revision: number; savedAt: string | null } | null` (`editor/state/*`): set to
|
||||
`{ revision, savedAt: null }` by `applySaved` (after the server answer: effective confirmation); then, except on
|
||||
`draft.unchanged` (`editorSave.ts:105`, an older save's time would be shown), `void readSaveTime(api, session,
|
||||
revision)` (never awaited, the save outcome is not delayed) reads `getOfficialSheetAdmin` (existing accessor,
|
||||
already used by `readConflict`) and writes `savedAt = draft_last_save.saved_at` only when
|
||||
`draft_version.version_id` is this version, `draft_last_save.revision === revision`, and the session and
|
||||
`lastSave` are unchanged; any failure leaves null (owner choice: server time only). Formatted with
|
||||
`formatParisTime` (`editor/format.ts:18`). Reset by open and reload.
|
||||
- « Abandonner les modifications » (C11 as amended, precision 9): `editor.draft.discard` relabelled; disabled rule,
|
||||
confirmation and `discardChanges({ confirmed: true })` unchanged; when the dialog opens, `copyExists(userId,
|
||||
versionId)` (`editor/state/recovery.ts:80`) decides whether the confirmation adds « La copie locale temporaire de
|
||||
ces modifications sera aussi supprimée. », so a copy left by an earlier write after a quota refusal is named too
|
||||
(`copyWritten` only tells the last write).
|
||||
|
||||
### 7. Shell (AC9, Lot F)
|
||||
|
||||
- `AppLayout.tsx`: on the editor path one of two static class sets (Tailwind needs literal classes): sidebar
|
||||
`hidden xl:flex …`, menu button and brand link `xl:hidden`, top-bar `h1` `hidden xl:block`; elsewhere today's `lg`
|
||||
set. Split (layout, top bar) to stay under the line limit. Today's top bar with the menu button is kept (board 13's
|
||||
merged row is not built).
|
||||
- `MobileDrawer.tsx`: prop `closesFrom: '64rem' | '80rem'` (default '64rem') replaces `LARGE_SCREEN`; the effect,
|
||||
with `closesFrom` in its deps, closes the drawer at setup when the query already matches and on later `change`
|
||||
events. AppLayout passes '80rem' on the editor. The drawer stays open from 1 024 to 1 279 px in the editor; leaving
|
||||
the editor at 1 180 px with the drawer open closes it. Drawer links stay under the capture leave guard (BDR-078).
|
||||
|
||||
### 8. « Aller à » (AC13)
|
||||
|
||||
- `editor/verification.ts`: `ROOT_TAB` and `tabOf` become a table built on `targetOfKey`; `issueTarget` returns
|
||||
`{ target: EditorTarget; name }` (the target carries the key, or the place alone when the key does not resolve).
|
||||
`IssueList` calls `navigate(target)`; its fallback label names the place (« Aller à Vues »).
|
||||
- Focus per target: general, views, categories, regions, findings rows through `focusAttrs`; an annotation: select
|
||||
it, then focus the properties panel heading (`PropertiesPanel.tsx:61`, tabIndex -1 added); a reference: section 5;
|
||||
nothing found: section 1's fallback chain.
|
||||
|
||||
### 9. Narrow read-only (AC11, C16, precision 5)
|
||||
|
||||
- Mode logic unchanged (`mode.ts`). Every moved form takes `readOnly` from the route: the three sections and the
|
||||
panel show no edit control in any read-only mode; overview entries open sections in consultation; history buttons
|
||||
disabled and Ctrl+Z off (same predicate). The store's `canEdit` stays true in narrow mode by design (recovery copy).
|
||||
- No horizontal scroll at 320, 375 and 768 px, panel open included; the tab row uses the small tier and icon-only
|
||||
history below 640 px.
|
||||
|
||||
### 10. i18n (AC16, AC20)
|
||||
|
||||
- Keys renamed in Lot B1: `editor.tab.views|references|vertebrae` → `editor.place.views|references|regions`, plus
|
||||
`editor.place.drawing`, `editor.place.categories`; `editor.tab.general` kept (a group name in
|
||||
`ReviewFigures.tsx:32`); each removed key grepped before deletion, e2e and LAN specs included
|
||||
(`e2e/lan/trial-lan.spec.ts:125,148`; `Dict` is `Record<string, string>`, so typecheck does not catch a removed
|
||||
key).
|
||||
- Prose naming an old tab or « Annuler » reworded in the lot that moves the place: `fr.ts:1218`, `:1510`, `:1515`,
|
||||
`:1516`, `:1420` (Lot B1), `:1400`, `:1425-1426` (Lot E) and EN counterparts (`en.ts:1187`, `:1389`, `:1479` and
|
||||
neighbours in B1; `:1369`, `:1394-1395` in E).
|
||||
|
||||
---
|
||||
|
||||
## Lots
|
||||
|
||||
Each lot: `pnpm typecheck && pnpm lint && pnpm test:run` green, its e2e specs and the two sentinels green on the
|
||||
sandbox, then commit (removed or rewritten assertions mapped in the message) and push.
|
||||
|
||||
### Lot A · Navigation model (pure)
|
||||
|
||||
- Files: create `apps/app/src/editor/navigation.ts`; test `apps/app/tests/unit/editor-navigation.test.ts`.
|
||||
- Produces: `ANNOTATION_SECTIONS`, `AnnotationSection`, `EditorTarget`, `FocusRequest`, `NavigationState`,
|
||||
`NavigationAction`, `initialNavigation`, `navigationReducer`, `targetOfKey`.
|
||||
- Tests: `targetOfKey` for the eight `ElementKey` kinds; `go_to` increments the serial and sets tab, section or
|
||||
panel; `select_tab` keeps section and panel and issues no request; `open_section`, `back_to_drawing`;
|
||||
`open_references` and `close_references` keep tab and section (opened from the views section, the section stays);
|
||||
`focus_consumed` clears only its serial; visited lists only grow.
|
||||
- Commit: `feat(editor): navigation model for the four-tab shell`.
|
||||
|
||||
### Lot B1 · Four tabs, sections with their entries, minimal references panel, « Aller à »
|
||||
|
||||
- Files: `editor/{tabs,focusRequest,verification,useEditorNavigation}.ts`, `editor/annotations/focusTarget.ts`,
|
||||
`components/editor/{EditorTabs,EditorTabBody,DraftHeader,HeaderActions,SaveLine}.tsx`,
|
||||
`components/editor/tabs/{GeneralTab,AnnotationsTab,FindingsTab,VerificationTab}.tsx`,
|
||||
`components/editor/annotations/{EditableAnnotations,PropertiesPanel,OverviewPanel,CreationPanel,TracingBar}.tsx`
|
||||
(OverviewPanel: Vues and Catégories cards with their entries; CreationPanel heading and the tracing bar get
|
||||
tabIndex -1 for the `kept` focus), `components/editor/annotations/sections/{registry.ts,AnnotationSection.tsx,
|
||||
ViewsSection.tsx,RegionsSection.tsx}` (moved), `components/editor/general/CategoriesSection.tsx`,
|
||||
`components/editor/references/ReferencesPanel.tsx` (moved from `tabs/ReferencesTab.tsx`, toggled by the header
|
||||
button, level-1 content), `components/editor/findings/{FindingTree,FindingsTab}` focus one-shot,
|
||||
`components/editor/verification/IssueList.tsx`, `editor/annotations/overview.ts` (counts),
|
||||
`app/routes/app/admin/AdminSheetDraftRoute.tsx` (`DraftEditor` keeps session and mode; new `EditorWorkspace`
|
||||
renders header, notices, tab row, places, live region), i18n keys and prose of the lot;
|
||||
`e2e/support/{editor,warm-up}.ts` (`selectTab` by role with a name pattern, `place(page, name)` returning the
|
||||
visible `data-place`, `openSection`, `backToDrawing`, `openReferences`, `TABS` of four), the specs that select a
|
||||
removed tab (`editor-access:34-42,156-200`, `editor-drawings:57,84,133`, `editor-structures:59-63,73-78,103-109`,
|
||||
`editor-geometry:204,260,347,374,399`, `editor-equine:112-131,288-299`, `editor-journey:82,101,108-111`,
|
||||
`editor-recovery`, `editor-signout`), `e2e/lan/trial-lan.spec.ts:125,148`.
|
||||
- No keep-alive yet: a place unmounts when left, as a tab does today; no level-1 function is unreachable at this
|
||||
commit (views, categories and regions through the overview entries and « Aller à », references through the header).
|
||||
- Sandbox: before the first e2e run, `pnpm db:sandbox up fresh` (wipes the trial data, authorised by this plan).
|
||||
- Tests: `editor-route.test.tsx` (four tab names; tiers at 1 280, 800, 500 px with « Plus » holding Général and
|
||||
Constats; arrows), `editor-mode.test.ts:99-117`, `editor-initial-tab.test.ts`, `editor-focus-request.test.tsx`
|
||||
(each request reaches its owner; annotation target focuses the properties heading; not found → tab, or « Plus »
|
||||
below 640 px, never `body`), `editor-verification.test.tsx` (each issue root → its target; fallback label), new
|
||||
`editor-sections.test.tsx` (entries open each section, `h2` focused, « Retour au dessin » focuses the entry, the
|
||||
region entry present with no role code; read-only labels; undo of a view creation while that view is shown with a
|
||||
pending point and with a tracing → main view, pending and tracing cleared, and no dispatch when the shown view
|
||||
still exists; « Aller à » an annotation while a creation is pending, and while a zone tracing is open, keeps it,
|
||||
focuses its panel or bar and announces it). Tests rendering the moved components import their new paths
|
||||
(`editor-tabs-views`, `editor-drawing-upload:94`, `editor-repair:300`, `editor-tabs-lists`,
|
||||
`editor-tabs-general:105-185`), assertions kept; `editor-findings.test.tsx:32` and
|
||||
`editor-annotations-tab.test.tsx:44` gain `navigate` in their props; `editor-route-recovery:93-97` moves to the
|
||||
header button.
|
||||
- Commit: `feat(editor): four tabs, Annotations sections, references from the header`.
|
||||
|
||||
### Lot B2 · Kept-mounted places
|
||||
|
||||
- Files: `components/editor/{EditorTabBody.tsx,KeptPlace.tsx (new),tabs/AnnotationsTab.tsx}`, route workspace
|
||||
(references wrapper), `components/editor/annotations/AnnotationCanvas.tsx` and
|
||||
`editor/annotations/useCanvasBuild.ts`, `components/editor/views/CropCanvas.tsx` (detach while hidden),
|
||||
`editor/sheetDocument.ts` (single-entry cache),
|
||||
new `apps/app/tests/unit/editor-keep-alive.test.tsx`, new `apps/app/e2e/shell/editor-shell.spec.ts` (first
|
||||
journeys); rewrites `editor-route.test.tsx:135` (the hidden Annotations tab is now in the DOM) and
|
||||
`editor-journey.spec.ts:309` (`getByLabel('Nom (FR)')` scoped to the visible place).
|
||||
- Tests (unit): text typed in the category add form survives Général ↔ Annotations and a section round trip; findings
|
||||
expansion and selection survive a tab change; the canvas tool, selection and zoom survive a tab change and the
|
||||
views section round trip through the unmeasured hint; a field still focused while a programmatic move happens
|
||||
(keyboard shortcut to a tab, « Aller à », Escape closing the panel from a reference field) is committed first (one
|
||||
undo entry, `unsaved` true, leave guard armed); text typed in the reference add form survives closing and reopening
|
||||
the panel; every place visited, a crop group open in the views section → no duplicate `id`, SVG ids included; a
|
||||
request reaches only its owner while others are mounted; after an « Aller à » to a finding, arrowing back onto
|
||||
Constats keeps focus on the tab; one `JSON.parse` per document text across places.
|
||||
- Tests (Chromium, `editor-shell.spec.ts`): the same keep-alive rules for the category form and the zoom; focus after
|
||||
« Aller à », « Retour au dessin » and a tab click checked with `document.activeElement` (happy-dom does not refuse
|
||||
focus on hidden elements).
|
||||
- Commit: `feat(editor): kept-mounted tabs, sections and references panel`.
|
||||
|
||||
### Lot C · Annotation card and side column from 1 024 px
|
||||
|
||||
- Files: `components/editor/annotations/{OverviewPanel,AnnotationList,EditableAnnotations,PropertiesPanel}.tsx`,
|
||||
`components/editor/tabs/AnnotationsTab.tsx` (read-only body), `editor/annotations/overview.ts` (grouping, filter),
|
||||
`apps/app/src/catalogue/useCatalogue.ts` (export `folded`, no other change), i18n keys of the lot; e2e specs that
|
||||
select annotations from the list or query it (`editor-annotations`, `editor-geometry`, `editor-journey`,
|
||||
`editor-equine.spec.ts:281,319`, `editor-structures.spec.ts:288`).
|
||||
- Tests: new `editor-overview.test.tsx` (card in edit and read-only, grouping in category order, filter ignoring case
|
||||
and accents, « Toutes les annotations » returns to the card with focus on the row, view rows switch the canvas
|
||||
view); `editor-annotations-tab.test.tsx` list assertions move to the card (mapping); grid from `lg`; overflow
|
||||
measured at 1 024 and 1 180 px before the CSS change.
|
||||
- Commit: `feat(editor): board 01 annotation card, side column from 1 024 px`.
|
||||
|
||||
### Lot D · References panel complete
|
||||
|
||||
- Files: `components/editor/references/{ReferencesPanel,ReferenceRow,ReferenceForm}.tsx`,
|
||||
`editor/references/citations.ts` (new), `components/editor/findings/{FindingContent,FindingDetail}.tsx` and
|
||||
`components/editor/tabs/FindingsTab.tsx` (the opener passed down), route workspace (container,
|
||||
scrim, `inert`), i18n keys of the lot; `editor-structures.spec.ts` references part; `editor-shell.spec.ts` panel
|
||||
journeys.
|
||||
- Tests (unit): `citationCounts` (nested categories and nodes, several citers, zero); new
|
||||
`editor-references-panel.test.tsx`: opens from the header (focus on heading) and from a finding (chip and count,
|
||||
filtered list, « Tout afficher (N) »), search on citation, DOI and URL ignoring case and accents, ↑/↓ hidden while
|
||||
filtered or searching, Escape, ✕ and scrim close, focus back to the opener or the header button, tab panels `inert`
|
||||
while open, Ctrl+Z reverts a reference edit while open, undo removing the cited finding clears the filter,
|
||||
read-only modes show no edit control, « Aller à » on a reference hidden by an active search clears the search and
|
||||
focuses its card.
|
||||
- Tests (Chromium): Enregistrer, Annuler and Rétablir receive a real click (no interception) with the panel open at
|
||||
1 024 and 1 280 px, page at the top and scrolled; the panel never overlaps the draft header or the tab row.
|
||||
- Commit: `feat(editor): references side panel with filter, search and counts`.
|
||||
|
||||
### Lot E · Header history, save line, Abandonner
|
||||
|
||||
- Files: `components/editor/{HistoryButtons,EditorGlyph,SaveLine,HeaderActions,EditorTabs}.tsx`,
|
||||
`components/editor/annotations/ToolColumn.tsx` (pair removed, glyphs from `EditorGlyph`), `editor/saveLine.ts`,
|
||||
`editor/state/{editorTypes,editorBase,editorSave,editorLoad}.ts` (`lastSave` in `initialData()`, `readSaveTime`),
|
||||
route (`!readOnly` to both), i18n keys and prose of the lot; e2e assertions on the old undo pair, the discard label,
|
||||
« Révision n » and « modifications non enregistrées » (`editor-journey:272-285,345,372`,
|
||||
`editor-annotations:129-155`, `e2e/support/editor.ts` `saveDraft` `:352-363`, `trial-lan.spec.ts:24-29,145`,
|
||||
`editor-structures.spec.ts:229-231` (a `toHaveCount(0)` on the old text would pass vacuously),
|
||||
`editor-recovery.spec.ts:142-146,168-172`). A press on an `aria-disabled` button in Playwright goes through
|
||||
`page.mouse` at the button's box (actionability treats it as disabled).
|
||||
- Tests: `savedDistance` table (load 0; commits; undo and redo around the save point; a commit after undoing past
|
||||
it → null; trim by a commit, an undo and a redo → null; restore → null; save sent at 3, then two undos and three
|
||||
commits in flight → null, and one undo and one commit in flight → null; nearest duplicate wins); `saveLineState`
|
||||
table (five forms, priority); `readSaveTime` (written only for the same version and revision; late answer after
|
||||
another save or a reload dropped; failure → no time; not called on `draft.unchanged` nor on a failed save; the save
|
||||
outcome resolves before the read); new `editor-history-buttons.test.tsx` (names and titles, T15; enabled only in
|
||||
edit mode without pending recovery; disabled in narrow, frozen, rights, inactive, historical, recovery pending;
|
||||
enabled while saving and in step with Ctrl+Z; focus kept when the last undo empties the stack; undo from
|
||||
Annotations reverts a Général change and from Constats a canvas change; typed text then header undo reverts exactly
|
||||
it, with and without earlier history; pointerdown blurs the focused field; a refused blur commit (names required)
|
||||
skips the undo and returns focus to the field; Ctrl+Z inside a field leaves the store
|
||||
untouched; Ctrl+Z ignored while a `DeleteDialog` is open; no pair left in the tool column); save status announces
|
||||
transitions only; discard confirmation with the copy sentence when `copyExists`, including a quota refusal after an
|
||||
earlier write, and without it when no copy exists; cancel keeps changes and copy. Rewritten: `editor-route.test.tsx`
|
||||
(`:104-119`, `:63`, `:93`, `:96`, `:118`), `editor-route-conflict.test.tsx:100,140`,
|
||||
`editor-route-recovery.test.tsx:125`, `editor-annotations-tab.test.tsx:502-515` (mapping).
|
||||
- Commit: `feat(editor): header history, save line and Abandonner les modifications`.
|
||||
|
||||
### Lot F · Editor sidebar from 1 280 px
|
||||
|
||||
- Files: `components/shell/{AppLayout,MobileDrawer}.tsx`, `apps/app/tests/unit/shell.AppLayout.test.tsx`;
|
||||
`editor-shell.spec.ts` sidebar journeys.
|
||||
- Tests: editor path uses the `xl` set, other paths the `lg` set; the drawer closes on the `80rem` query in the
|
||||
editor, on `64rem` elsewhere, and at setup when the query already matches (leaving the editor at 1 180 px with the
|
||||
drawer open); a drawer link with unsaved changes asks before leaving; Chromium: sidebar hidden at 1 024, 1 180,
|
||||
1 279 px, shown at 1 280 px, menu reachable in one tap, drawer staying open at 1 180 px.
|
||||
- Commit: `feat(app): editor sidebar hidden below 1 280 px, menu one tap away`.
|
||||
|
||||
### Lot G · Label proposals and parity
|
||||
|
||||
- Files: `.claude/audits/2026-11-06-v1-2-6-u1-label-proposals.md` (format of
|
||||
`.claude/audits/2026-11-03-v1-2-6-label-proposals.md`: key, FR, EN, board, status « proposal »), dead keys removed
|
||||
after grep.
|
||||
- Tests: AC20 parity command.
|
||||
- Commit: `docs(i18n): U1 label proposals`.
|
||||
|
||||
### Lot H · Browser journeys and full suites
|
||||
|
||||
- Files: `apps/app/e2e/shell/editor-shell.spec.ts` (completed), `docs/development/BROWSER_TESTS.md`.
|
||||
- Journeys: four tabs; cross-tab undo; typed text then header undo; Ctrl+Z outside and inside a field; « Aller à »
|
||||
for each issue kind; save line « n modifications non enregistrées » → « Enregistrement… » → « Enregistré à hh:mm ·
|
||||
révision n »; no horizontal scroll at 1 024, 1 180, 1 279, 1 280 px on the four tabs, the three sections and with
|
||||
the panel open, and at 320, 375, 768 px in read-only; a width change below 1 024 px with a section open and with the
|
||||
panel open (read-only, no edit control, unsaved kept, edit back on widening); keyboard walk header → tab list →
|
||||
Annuler/Rétablir → panel when open → tab panel content (tools, canvas, side column); axe with no serious or critical
|
||||
violation on the four tabs, each section, the open panel and the narrow read-only mode (after animations settle,
|
||||
LRN-082; from the top, LRN-089; dialog count 0 after a close, LRN-111, LRN-116); commit-to-paint time with every
|
||||
place visited on the equine spec, recorded (above 500 ms: STOP).
|
||||
- Regression: the whole shell suite on the sandbox; C13, C14, C16, C34, C41 journeys green (T11);
|
||||
`e2e/lan/trial-lan.spec.ts` run with the trial stack of the Lot I demo, or recorded as not run with the reason.
|
||||
- Commit: `test(app): browser journeys of the four-tab editor shell`.
|
||||
|
||||
### Lot I · Docs, gates, checkpoint
|
||||
|
||||
- Files: `docs/development/V1-2-6_OWNER_TRIAL.md` (U1 demo: create a non-equine sheet in the UI, switch tabs, undo a
|
||||
Général change from Annotations, open References from a finding, « Gérer les vues » and « Retour au dessin »,
|
||||
resize to 1 180 px; `:136`, `:151`, `:155`, `:159`, `:161` reworded), `docs/development/V1-2-6_UX_{PLAN,TESTS}.md`
|
||||
(U1 tooling row and « a stale worker image is refused » moved to U6, per CLARIFICATIONS), `.claude/tasks/TODO.md`,
|
||||
the contract (EVIDENCE lines).
|
||||
- Gates in the AC18 order, each recorded with its command and result: `pnpm typecheck`, `pnpm lint`,
|
||||
`pnpm test:run`, `pnpm build`, `pnpm e2e:ui`, a new `pnpm db:sandbox up fresh` then `pnpm db:sandbox test-db`,
|
||||
`pnpm db:sandbox e2e-shell`, `pnpm db:sandbox test` (LRN-113, EVAL-042), `pnpm check:all`,
|
||||
`pnpm r5:import-equine --check`; the AC19 and AC20 CHECK commands; a fresh verifier on the enriched contract; a
|
||||
fresh security review on `846994b..HEAD`.
|
||||
- Checkpoint report (brief §9): changes, board correspondence, tests run with results, verdicts, limits, sandbox
|
||||
demo, commits and Git state, exit criteria. STOP; no U2.
|
||||
|
||||
---
|
||||
|
||||
## Edge cases (all lots)
|
||||
|
||||
- StrictMode open → close → open: navigation lives in `EditorWorkspace`, which mounts once the version is ready; the
|
||||
route key per version id resets it; the store's session token rules unchanged.
|
||||
- A recovery offer pending at opening: every place is consultation only; history disabled; sections and panel open
|
||||
read-only.
|
||||
- Save in flight while a section or the panel is open: navigation does not depend on `saving`.
|
||||
- Conflict dialog open: page inert (modal), shortcuts off as today; places keep their state behind it.
|
||||
- Leaving the page with the panel open and unsaved changes: leave guard as today (BDR-078).
|
||||
|
||||
## Disposition of memory (claimed by this plan)
|
||||
|
||||
- BDR-102 [in force]: the regions editor sits in Annotations as the T17 fallback entry, always shown before U6, no
|
||||
role logic written.
|
||||
- BDR-101 [in force]: T15 wording: header undo named « Annuler la dernière modification »; « Abandonner les
|
||||
modifications » for C11; dialogs that close without effect keep « Annuler ».
|
||||
- BDR-100 [in force]: level 1 not validated (T11); C13, C14, C16, C34, C41 re-run in Lot H.
|
||||
- BDR-099 [in force]: permission states and their order in the route (`AdminSheetDraftRoute.tsx:175-235`) untouched;
|
||||
fresh stack for the gate run (Lot I).
|
||||
- BDR-096 [in force]: board 05 of v1-2-4 stays the narrow read-only reference (section 9).
|
||||
- BDR-076 [in force]: D13: the panel is non-modal (owner choice), so no `ModalDialog`; every modal stays on it
|
||||
(delete, discard, conflict, leave, drawer).
|
||||
- BDR-078 [in force]: drawer and menu links under the capture leave guard at every width (Lot F test).
|
||||
- BDR-079 [in force]: D11 drawer only, no tab bar; the menu opens the existing drawer.
|
||||
- BDR-050 [in force]: commits on blur, confirm or pointer-up only; the header undo relies on the blur commit, forced
|
||||
at pointerdown.
|
||||
- BDR-006 [pattern kept]: ↑/↓ kept in the panel (unfiltered) and the regions section until U6.
|
||||
- BDR-042 [rule kept]: no element ahead of the boards: « Prévisualiser », the view menu, the category fold and the
|
||||
merged tablet top row are not built.
|
||||
- LRN-017 / AC20: parity in Lot G and Lot I.
|
||||
- LRN-057: the discard sentence reads the stored copy, the saved state the server answer and the admin read.
|
||||
- LRN-082: happy-dom proves wiring only; axe and focus checked in Chromium (Lots B2, D, H).
|
||||
- LRN-085: focus after a drawer navigation unchanged.
|
||||
- LRN-087: wrappers forward `aria-*`; tests find sections and the panel by role and name.
|
||||
- LRN-088: `useT` never an effect dependency (live regions, focus effects).
|
||||
- LRN-094: overflow measured before CSS changes (Lots C, H).
|
||||
- LRN-110, LRN-113, LRN-114, EVAL-042: absolute worktree, fresh sandbox in the order test-db → e2e-shell → test, the
|
||||
tracked ledger, gate commands copied verbatim.
|
||||
- EVAL-034: the citation count stays a TypeScript read of the document (section 5 boundary note).
|
||||
- LRN-111, LRN-115, LRN-116, LRN-089, LRN-104 [already seen]: dialog count 0 after closes, destination landmark
|
||||
awaited, scans from the top, click coordinates recomputed after header or tab-row shifts; LRN-115's class (a locator
|
||||
hitting the wrong copy) is why queries are scoped to the visible place.
|
||||
|
||||
## Visible choices taken in this plan (for the owner at the plan checkpoint)
|
||||
|
||||
Answered by the owner on 2026-11-06 (recorded [gated] in the contract): server time on the save line; non-modal
|
||||
references panel; citation button in the finding's detail; board 01 annotation card with « Toutes les
|
||||
annotations ».
|
||||
|
||||
Taken here, to confirm or change:
|
||||
1. Unsaved count = accepted changes between the shown and the saved document along the history; « Modifications non
|
||||
enregistrées » without a number when the saved text is no longer in the history (restored copy, trim, a change
|
||||
made after undoing past the save).
|
||||
2. After `draft.unchanged`: « Enregistré · révision n », without a time.
|
||||
3. Annuler and Rétablir stay enabled during a save, as Ctrl+Z (amends AC4).
|
||||
4. Typed text then « Annuler »: the typed text is the last change and is undone, even when the history was empty
|
||||
(AC5).
|
||||
5. Below 640 px: Annotations and Vérification shown, Général and Constats under « Plus »; history icon-only.
|
||||
6. From 1 024 to 1 279 px today's top bar with the menu button stays; board 13's merged row is not built; the
|
||||
header's right group wraps under the title when needed.
|
||||
7. Board 12 A's save-failure strip is not built; today's `SaveFailureNotice` stays.
|
||||
8. « Régions vertébrales » sits in the Catégories card; read-only entries read « Voir les vues » and « Voir les
|
||||
catégories ».
|
||||
9. The annotation card shows every row (no « Voir les n annotations » truncation); the filter matches the displayed
|
||||
name.
|
||||
10. Panel: search on citation, DOI and URL; ↑/↓ only on the unfiltered list; focus on its heading at opening.
|
||||
11. Undo that removes the view shown on the canvas: back to the main view, a pending creation or tracing on the
|
||||
removed view is dropped (it can no longer be created there).
|
||||
12. « Aller à » an annotation while a creation is pending or a tracing is open: it is kept and shown, focus on its
|
||||
panel or bar, an announcement; no jump until it is finished or abandoned.
|
||||
13. Keyboard order: header → tab list → Annuler/Rétablir → panel when open → tab panel content in visual order
|
||||
(tools, canvas, side column); the TESTS wording « panel → canvas » would put the DOM order against the visual one.
|
||||
14. Focus after « Retour au dessin »: the section's entry button, else the canvas box.
|
||||
15. Announcements: « {Onglet} » or « {Onglet} · {Section} », « Références »; save status announced on state changes
|
||||
only, not on each count change; the Vérification badge text is part of the tab's name.
|
||||
16. Discard confirmation adds the copy sentence whenever a copy is stored.
|
||||
17. Vues card rows without the drawing thumbnail of board 01: a second composition of each view would repeat the
|
||||
core's ids in the page (section 2); name, kind and annotation count only.
|
||||
18. A typed value the field refuses (e.g. a name left empty) is not followed by an undo: « Annuler » leaves the
|
||||
history alone and returns focus to the field with its message.
|
||||
|
||||
## Contract amendments proposed (applied only on the owner's approval of this plan)
|
||||
|
||||
- AC3: non-modal panel below the tab row (owner answer), content `inert` under a scrim, header and history usable.
|
||||
- AC4: « saving » leaves the list of states that disable Annuler and Rétablir (choice 3).
|
||||
- AC5: typed text undone even with an empty history; pointerdown blur (choice 4).
|
||||
- AC7: count and time rules of section 6 (choices 1, 2; owner answer on the time).
|
||||
- AC17: keyboard order as choice 13.
|
||||
- FILE SCOPE: add `apps/app/src/editor/{navigation,saveLine,useEditorNavigation,sheetDocument}.ts`,
|
||||
`apps/app/src/editor/references/citations.ts`, `apps/app/src/editor/annotations/{overview,useCanvasBuild}.ts`
|
||||
(overview new; the build hook detaches while hidden; the canvas reset
|
||||
uses the existing `view` action of `uiState.ts`, unchanged), `apps/app/src/catalogue/useCatalogue.ts` (export
|
||||
`folded` only),
|
||||
`apps/app/e2e/lan/trial-lan.spec.ts`; `editor/state/*` edits limited to `lastSave` and `readSaveTime`.
|
||||
- Design criteria from the owner's precisions 1-10, tagged [gated] at approval: no loss on a tab, section or panel
|
||||
change (Lots B2, D tests); « Retour au dessin » focus and context; history tests on typed text, shortcuts and
|
||||
section transitions; save shown only after the server answer, time only from the server; read-only below 1 024 px
|
||||
on every moved form and shortcut; counts from the current document without network; no « Prévisualiser », no
|
||||
withdrawal, no removed function; T17 entry without role logic; discard confirmation naming the stored copy;
|
||||
sections replaceable through one registry.
|
||||
- Documented limit (section 2): creation forms unmount on a width change across 1 024 px or a recovery decision, as
|
||||
in level 1.
|
||||
|
||||
## Challenge record (2026-11-06, three blind lenses on the first draft)
|
||||
|
||||
- Correctness CONCERNS(6 MAJOR, 7 MINOR), robustness CONCERNS(5 MAJOR, 10 MINOR), simplicity CONCERNS(2 MAJOR,
|
||||
7 MINOR); no BLOCKER tag. Every MAJOR closed by a named change:
|
||||
- false unsaved count (three lenses): the hand-kept `saveDistance` and `nextSaveDistance` replaced by the
|
||||
`savedDistance` selector over the history (section 6), with the challengers' sequences in Lot E;
|
||||
- `<Activity>` re-runs effects on reveal (zoom reset `useFraming.ts:69`, tree focus `FindingTree.tsx:31-33`):
|
||||
replaced by kept-mounted `hidden` wrappers; `focusId` one-shot; no focus in mount effects (section 2, global
|
||||
constraints);
|
||||
- Lot B depended on Lot D and was too large: split into B1 (tabs, sections with their entries, minimal panel,
|
||||
« Aller à ») and B2 (kept-mounted places); the overview's Vues and Catégories cards move to B1;
|
||||
- e2e red from B to H and blind happy-dom focus: each lot keeps its specs green on the sandbox; Chromium focus and
|
||||
keep-alive spec in B2;
|
||||
- LAN trial spec forgotten: `trial-lan.spec.ts` in B1, E and H;
|
||||
- typed text with disabled buttons contradictory: AC5 followed, pointerdown blur, test rewritten;
|
||||
- panel covering the header: anchored below the tab row, Chromium click checks in Lot D;
|
||||
- pending creation written on the main view after its view vanished: full canvas reset;
|
||||
- discard sentence keyed on `copyWritten`: `copyExists` read at opening;
|
||||
- hidden copies matched by label and text locators: `data-place` scoping, no page-wide non-role query.
|
||||
- MINOR integrated: header split and glyphs in the lots that use them; no `history.ts` (route's `!readOnly`); one
|
||||
glyph table and `Icon` for book and close; counts over `buildItems`, `folded` shared; lazy initial tab, no reset
|
||||
action; prose reworded in the lot that moves each place; one encoding for the drawing; drawer closes at setup when
|
||||
the query matches; save status announces transitions only; panels keep an aria-label and the focus fallback reaches
|
||||
« Plus »; `readSaveTime` not awaited and skipped on `draft.unchanged`; « Aller à » clears the panel search before
|
||||
focusing; shared parse cache and stable callbacks; « Aller à » keeps a pending creation; documented limit widened to
|
||||
every creation form.
|
||||
- Confirmation pass (one fresh correctness challenger on the revised plan): CONCERNS(3 MAJOR, 5 MINOR), no BLOCKER;
|
||||
it confirmed that the `savedDistance` string identity holds on every path. Closed by named changes:
|
||||
- typed text left uncommitted in a hidden field when no blur fires (Safari and iPadOS taps, Escape closing the
|
||||
panel): `commitFocusedField()` before every move (section 1), tests in Lot B2;
|
||||
- « Aller à » dropping a tracing: the keep rule covers `ui.tracing` (section 4, Lot B1 tests);
|
||||
- specs broken outside a lot's list: every lot runs all `editor-*.spec.ts`, the found breakages named in B2, C, E;
|
||||
- MINOR: SVG id scope shared by the drawing and the crop preview (detach while hidden, no thumbnails); refused
|
||||
blur commit skips the undo; reserved save-line width; `page.mouse` on `aria-disabled`; three-outcome `apply`,
|
||||
tabIndex on the creation heading and tracing bar, guarded reset dispatch; `FocusRequest` defined in Lot A, file
|
||||
lists completed (B1, D, E); `open_references` and `close_references` keep tab and section.
|
||||
Per `challenge-plan.md`, no further pass; the owner decides at the gate.
|
||||
Reference in new issue
Block a user