From 541706cba90b4d3b2bd31512d263bc6f997e19b5 Mon Sep 17 00:00:00 2001 From: bchanot Date: Thu, 12 Nov 2026 11:15:31 +0100 Subject: [PATCH] docs(app): R1 criteria for deselecting by a click on the drawing (D6b) Owner U1 manual test 2026-11-12: a click outside any annotation must deselect. D6b supersedes D6's deferral to U2; code change and tests named, implementation awaits the go. --- .claude/tasks/TODO.md | 3 +- docs/development/V1-2-6_U1_CORRECTIONS.md | 44 +++++++++++++++++++++-- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index fceae09d..9cd46444 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -687,6 +687,7 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet - [ ] V1-2.6 U1 corrections after the owner's first trial (brief « V1-2.6 UX — Arbitrages du premier essai propriétaire », 2026-11-09, BDR-107; contract `.claude/tasks/contracts/2026-11-09-v1-2-6-trial-arbitrations.md`; plan `docs/development/V1-2-6_U1_CORRECTIONS.md`): design and docs only so far, no app/scripts/SQL/Rust code, no DEV, sandbox untouched, no merge, no U2/U2b/V1-2.7 - [x] R0 boards 23-30 `docs/design/v1-2-6-r0/`: GRAPHICALLY VALIDATED 2026-11-09 (BDR-110) after owner corrections (BDR-109 + three last: 24 A, 26, 28) and closing counter-check CONFORME; A1-A15 settled (`ARBITRAGES.md`); archive `~/faunosteo-v1-2-6-r0-maquettes.zip`; impeccable 4.1.0 offline: 2 observations kept by owner - [ ] R1 history « Défaire » / « Refaire » + « Désélectionner » + Escape priority (after R0 validation and its own go) + - [ ] D6b (owner 2026-11-12, U1 manual test on db:trial): a click or tap on the drawing outside any annotation deselects; criteria, code change and tests in V1-2-6_U1_CORRECTIONS.md R1; scope presented, awaiting the go - [ ] R2 fifth tab « Références », tiles, search + clear, view-only sort, panel from a finding only (34 rem, 150-200 ms slide, reduced motion) (after R0 validation and its own go) - [ ] R3 sheet list: search + name sort first; date, date sort and « most recent » home card only after the dedicated SQL checkpoint `docs/development/V1-2-6_R3_SQL_CHECKPOINT.md` (A7 ratified 2026-11-09; never a creation date shown as modification date) - [ ] R4 catalogue card integrity warning (independent fix, = anomaly C): `useCardDetails.ts` drops a failed `loadVersion` silently; UI only, check never bypassed @@ -694,7 +695,7 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet - [ ] Test anomaly A (owner 2026-11-09, separate from U1/U2): fictitious fingerprints `'a'.repeat(64)` from worker stand-ins (`packages/supabase/tests/sandbox/sheet-fixtures.ts:115` openRound, `sheets-concurrency.sandbox.ts:168`, `sheets-perf.sandbox.ts:169`); 7 published/deprecated sandbox versions fail `check_published`. Fix: real fingerprint through the core (as e2e `fingerprintOf`, `apps/app/e2e/support/catalogue.ts:88`); never weaken the publish gate or the reader check. Needs its own go. - [ ] Test anomaly B (owner 2026-11-09, separate from U1/U2): `packages/supabase/tests/sandbox/sheets-admin.sandbox.ts:181-195` creates the historical working copy and never archives it; slot taken → `admin.spec.ts:717` fails x4. Fix test independence and cleanup; the existing copy `8c315a12-20d4-4432-9db3-7cb88b27a5b4` stays untouched until the owner authorises. Linked: RR-13, the admin.spec confirmation line above. - [ ] Test anomaly C (owner 2026-11-09, separate from U1/U2): integrity failure invisible in catalogue cards; implemented as lot R4; failure shown, never hidden or bypassed. - - [ ] Dedicated persistent manual trial stack (owner 2026-11-09, D8; brief « Après R0 — Implémentation technique », contract .claude/tasks/contracts/2026-11-09-db-trial-stack-1809.md): [x] lot A suites' guard · [x] lot A2 trial dev server target (R13) · [x] lot B1 foundation · [x] lot B2 backups, restore, migrate, rotation · [x] lot B3 accounts, grants, drawings, app · [x] lot C docs · [x] reviews (verifier ECARTS owner-gated only, security PASS, code review + 2 re-reviews fixed: d3bdbbe, f2cbf68) · [x] first create 2026-11-11 at 255dd67 (owner go) · [x] post-create checks: interrupted at check 3 (TR_PW in the db container log), owner decided 2026-11-11 (rotation + fix, sub-item below) · [x] accounts 2026-11-11 (owner brief « Checkpoint sécurité et autorisation des comptes »): owner@trial.local owner+admin, praticien@trial.local admin+sheet_editor, 1 verified TOTP each (BDR-112), roles/rights/audit/aal2 refusals/secrets/persistence checked · [x] equine drawing 2026-11-11 (owner brief « Autorisation de l'import équin »): `pnpm db:trial assets`, 1/1 uploaded and confirmed, object re-downloaded through the gateway byte-identical, second read-only pass nothing to do, draft = document.json, seed = HEAD · [ ] owner browser checks (owner Droits at aal2, praticien draft read-only « Consulter le brouillon »); no working copy without a go + - [ ] Dedicated persistent manual trial stack (owner 2026-11-09, D8; brief « Après R0 — Implémentation technique », contract .claude/tasks/contracts/2026-11-09-db-trial-stack-1809.md): [x] lot A suites' guard · [x] lot A2 trial dev server target (R13) · [x] lot B1 foundation · [x] lot B2 backups, restore, migrate, rotation · [x] lot B3 accounts, grants, drawings, app · [x] lot C docs · [x] reviews (verifier ECARTS owner-gated only, security PASS, code review + 2 re-reviews fixed: d3bdbbe, f2cbf68) · [x] first create 2026-11-11 at 255dd67 (owner go) · [x] post-create checks: interrupted at check 3 (TR_PW in the db container log), owner decided 2026-11-11 (rotation + fix, sub-item below) · [x] accounts 2026-11-11 (owner brief « Checkpoint sécurité et autorisation des comptes »): owner@trial.local owner+admin, praticien@trial.local admin+sheet_editor, 1 verified TOTP each (BDR-112), roles/rights/audit/aal2 refusals/secrets/persistence checked · [x] equine drawing 2026-11-11 (owner brief « Autorisation de l'import équin »): `pnpm db:trial assets`, 1/1 uploaded and confirmed, object re-downloaded through the gateway byte-identical, second read-only pass nothing to do, draft = document.json, seed = HEAD · [x] owner U1 manual test 2026-11-12 (brief « Retour du test manuel U1 »): equine working copy, four tabs, annotation select and edit, saves kept after reload, undo/redo, historical sheet unchanged; one defect → R1 D6b · [ ] owner Droits screen at aal2 not reported - app exposure (owner 2026-11-11, BDR-111): `pnpm db:trial app` listens on 192.168.1.100:5194 only (not 0.0.0.0; Host allowlist answers 403 to other names; 127.0.0.1:5194 closed). The accounts brief authorised 127.0.0.1:5194; the owner moved it to the LAN address the same day. No wider LAN exposure (other port, 0.0.0.0, firewall change) without a distinct decision. - shortcut: `pnpm db:trial app` takes no lock (scripts/db-trial.sh, comment above cmd_app): stop, backup, migrate, destroy, restore or rotate-* started in another terminal in the second before Vite listens on 5194 goes ahead. Upgrade: a dedicated app lock, shared by app and exclusive for those commands. - [x] init log leak: the image's /docker-entrypoint-initdb.d/migrate.sh runs `ALTER USER supabase_admin WITH PASSWORD '…'` while the init server logs statements, before /etc/postgresql.schema.sql (db container log line 379). Owner 2026-11-11 « Correction minimale de la fuite TR_PW »: [x] one-off TR_PW rotation (5 roles, auth/storage/rest recreated, old password refused on scram, services ok; the db container log and frozen env keep the dead old value, allowed) · [x] fix 5f63d22 `-c log_statement=none` on the server command line (contract .claude/tasks/contracts/2026-11-11-trial-init-log-leak-1907.md, harness 373/0, control 372/1, verifier CONFORME, security PASS, LRN-127) · [ ] real proof: a create on a fresh volume with the log scan (needs its own go) · not closed, named in SUPABASE.md §5.2: init error statements, migrate.sh argv, db-sandbox.sh same DB_INIT diff --git a/docs/development/V1-2-6_U1_CORRECTIONS.md b/docs/development/V1-2-6_U1_CORRECTIONS.md index 0012c003..e6440102 100644 --- a/docs/development/V1-2-6_U1_CORRECTIONS.md +++ b/docs/development/V1-2-6_U1_CORRECTIONS.md @@ -15,7 +15,8 @@ Companion: `TRIAL_STACK.md` (the dedicated manual trial stack, request §5). | D3 | The tab shows collapsible tiles: closed = short citation, type, citation count; open = full information, DOI, URL, actions. Instant search with a clear button. Sort by document order (default), A to Z, citation count or type. Sorting never changes the document; reorder commands only while document order is shown. | | D4 | Kept: unsaved changes, focus, « Aller à », permissions, read-only mode, accessibility tests. Below 640 px, Références goes in the « Plus » menu. Boards validated before any UI code. | | D5 | History reads « Défaire » / « Refaire » instead of « Annuler » / « Rétablir », with explicit accessible names, the keyboard shortcuts kept and the distinction from dialog « Annuler » buttons kept. | -| D6 | A « Désélectionner » button near « Supprimer ». Escape deselects when no dialog, priority panel, menu or tracing in progress consumes it. Deselecting is interface state: no document change, no history entry. A click on an empty part of the drawing is left to U2. | +| D6 | A « Désélectionner » button near « Supprimer ». Escape deselects when no dialog, priority panel, menu or tracing in progress consumes it. Deselecting is interface state: no document change, no history entry. A click on an empty part of the drawing is left to U2 (superseded by D6b). | +| D6b | Owner, 2026-11-12, after the U1 manual test on the trial stack: a click or a tap on the drawing anywhere but on an annotation deselects (a bone or any non-interactive SVG shape, an empty part of the drawing); a click on an annotation still selects it; a drag, a pan, a zoom or a touch navigation gesture never deselects; with nothing selected a click changes nothing; same behaviour with a mouse and on a touch screen. Joins R1, beside « Désélectionner » and Escape. | | D7 | Sheet list: instant search with clear, sort by last modification (default) or name, the last-modification date visible, better Administration home cards. No section built on UUIDs, names, slugs or test conventions; generic for every species; no artificial test filter. | | D8 | A dedicated, persistent manual trial stack, separate from the automated sandbox: technical plan only, nothing created, reset or deleted now (`TRIAL_STACK.md`). | | D9 | Three separate test anomalies tracked apart from U1 and U2: A fictitious fingerprints, B working copy never archived by `sheets-admin.sandbox.ts`, C integrity failure invisible in catalogue cards (section 5). | @@ -52,7 +53,7 @@ Boards 23 to 30 in `docs/design/v1-2-6-r0/` (sources, data generated from the eq owner validates each board, or asks for corrections; the validated boards then join `docs/design/README.md` as the reference of R1 to R4. -### R1 — History labels and deselection (D5, D6) +### R1 — History labels and deselection (D5, D6, D6b) - Labels: `editor.history.*` keys in `apps/app/src/i18n/fr.ts` and `en.ts` (FR « Défaire » / « Refaire », names « Défaire la dernière modification » and « Refaire la dernière modification défaite »; EN « Undo » / « Redo » @@ -67,13 +68,50 @@ reference of R1 to R4. workspace, at the bubbling phase, deselects only when `event.defaultPrevented` is false, no dialog is open, no menu is open and no tracing runs; each consumer marks the key handled. The « Plus » menu's own Escape path is checked first (it has no explicit handler today). +- Click on the drawing (D6b). Today, with the select tool, `clickHandler` in + `apps/app/src/editor/annotations/useCanvasGestures.ts:57-68` calls `onSelect` only when the target has a + `[data-anno-id]` ancestor (`annotationIdOf`, `useCanvasBuild.ts:91-94`) and ignores every other click: that is the + defect. Change: the other branch calls a new `onDeselect` input; `EditableAnnotations.tsx` (`CanvasStage`) wires + it to the same deselect path as the button, and only when an annotation is selected (nothing selected: no + dispatch, so a pending keyboard creation, its typed fields and the « Filtrer par nom » term stay). The read-only + twin (`AnnotationsTab.tsx:187`) draws through `CatalogueCanvas`, whose click listener + (`CatalogueCanvas.tsx:99-104`) gets an optional `onEmpty` with the same rule; the catalogue reader page + (`SheetRoute.tsx:150`) passes none and is unchanged. + - Interactive means any `[data-anno-id]` element of the composed view: a point (hitbox and disc), a zone (filled, + `pointer-events` all, `docs/ANNOTATION-RENDERING.md`), a detail link. A click inside a zone selects that zone, as + today. Everything else in the canvas box deselects: a shape of the drawing (bone, outline, any path, rect, + circle or group), the drawing's background, the box margin around the drawing. + - Drawing tools (point, zone, link) and a tracing: unchanged, a click places or adds a vertex. + - Gestures: the existing `swallowClick` of `useFraming` (a press that moved more than 4 CSS px: pan, marker drag, + pinch) already keeps the click from acting; in addition a press during which a second pointer came down (a + two-finger tap or a pinch that moved less than 4 px) never deselects, tracked in the canvas hooks so that + `useFraming`, shared with the catalogue reader, is unchanged. The wheel, Ctrl+wheel, the keyboard pan and zoom, + the zoom buttons and a touch scroll of the page (it ends in `pointercancel`) produce no click on the drawing. + - Effect: the selection and its contextual panel are reset (the overview comes back); document text, handle + version, history length and the save line unchanged; no save, no history entry. A field typed in the panel and + not blurred is committed by its own blur before the click, exactly as with « Toutes les annotations » today. + - Focus and announcement: the click leaves the focus on the drawing box it landed on (no jump to the list row, + which stays the rule of the « Désélectionner » button, A6); the same polite announcement as the button. +- Unit tests for D6b (`apps/app/tests/unit/editor-annotations-tab.test.tsx`, happy-dom; the test drawing has an inner + ``): with a selection, a click on the drawing's inner ``, on its root `` and on the box margin + each deselect, document text, handle version and history length unchanged; a click on another marker selects it, + on the selected one keeps it; nothing selected, a click on the `` changes nothing and a pending keyboard + creation keeps its typed name; a press moved more than 4 px on the `` (pan), a marker drag and a press with + a second pointer keep the selection; undo after a click deselect undoes the previous edit; the focus stays on the + box and the announcement is made; the read-only twin deselects on the ``; `CatalogueCanvas` without + `onEmpty` keeps today's behaviour. - Unit tests: deselect leaves the document text and the history length unchanged; undo after a deselect undoes the previous edit; the Escape matrix (dialog, menu, panel, tracing, nothing open) with one consumer each time; focus after « Désélectionner »: the annotation's list row if it still exists, else the drawing, with no new selection and a polite announcement (A6 as ratified); accessible names of both history buttons in FR and EN; read-only modes show « Désélectionner » and no « Supprimer ». - E2E: the journeys that name « Annuler » / « Rétablir » rewritten one for one; a new desktop spec for the button and - Escape; axe on Annotations with a selection. + Escape; axe on Annotations with a selection. For D6b, in that spec (Chromium, `pnpm e2e:shell` against + `pnpm db:sandbox`, never the trial stack): real clicks on the inner `` and `` of the drawing written by + `e2e/support/editor.ts:78-80`, on the drawing's background and on the box margin, then on another marker; a drag + pan on the zoomed drawing and a marker drag keeping the selection; a touch context (`hasTouch`, as in + `editor-geometry.spec.ts:419`) where a tap deselects and a touch drag does not. `editor-equine.spec.ts`: one click + on a bone path of the historical horse drawing of the working copy deselects. ### R2 — The Références tab (D1 to D4)