U1 demo and known limits in the owner trial guide, tooling moved to U6 in the plan and tests, TODO lots A-H, AC19 and AC20 evidence.
768 lines
63 KiB
Markdown
768 lines
63 KiB
Markdown
# V1-2.6 UX redesign: technical implementation plan
|
||
|
||
Status: PROPOSAL for the owner, 2026-11-05, revised the same day with the owner's answers to T2/T3, T4, T5, T9/T10,
|
||
T11, T12 and T16 (brief « V1-2.6 UX — Ratification des décisions techniques », BDR-100), then with the brief
|
||
« V1-2.6 UX — Autorisation U0 uniquement » (BDR-101: T4 SQL checks, T5 defaults, T10 option B, T15, T16 count,
|
||
« Remplacer par un polygone »), recorded in `V1-2-6_UX_DECISIONS.md` and contract §17.12. Nothing in this file
|
||
authorises code. U0 (documents only) was authorised on 2026-11-05; no application, Rust, SQL or worker change is
|
||
made before the owner authorises each later sub-step explicitly. Branch `feature/v1-2-anatomical-sheets`, worktree
|
||
`/home/bchanot/Documents/faunosteo-v1-2`, audited at `f58cf23`.
|
||
|
||
Companion files:
|
||
|
||
| File | Content |
|
||
|---|---|
|
||
| `V1-2-6_UX_PLAN.md` | This plan: inventory, sensitive points A to I, sub-steps U0 to U8, curves lot (ex-U9) |
|
||
| `V1-2-6_UX_COMPATIBILITY.md` | Old / new schema matrix: core, SQL, worker, PDF, snapshots, N-1, oracles, rollback |
|
||
| `V1-2-6_UX_TESTS.md` | Test matrix per sub-step |
|
||
| `V1-2-6_UX_RISKS.md` | Risks, dependencies, blocking points |
|
||
| `V1-2-6_UX_DECISIONS.md` | Technical decisions still needed (the validated UX choices are not reopened) |
|
||
|
||
Inputs: the owner brief « V1-2.6 — Validation UX définitive et préparation technique » (16 boards of
|
||
`docs/design/v1-2-6/`, archive V2, and the 11 choices of `ARBITRAGES.md`, all validated); five static audits run on
|
||
`f58cf23` (core model, rendering and archives, geometry and wasm, SQL and worker, editor and tests). Every claim of
|
||
the earlier study (`docs/design/v1-2-6/ETUDE-TECHNIQUE.md`, `.claude/audits/2026-11-05-v1-2-6-ux-feasibility.md`)
|
||
was re-checked against the code; §1.7 lists where it was wrong.
|
||
|
||
Paths below are relative to the repository root. `core/` stands for `crates/core/src/`, `app/` for `apps/app/src/`.
|
||
|
||
---
|
||
|
||
## 1. Technical audit
|
||
|
||
### 1.1 What the core already offers (re-verified)
|
||
|
||
- **Edit primitives.** `sheet.edit` (insert, update, remove, move, set_status, mark_reviewed) is a free op, document
|
||
in, document out (`core/ops.rs:106-119`, `core/domain/sheet/edit.rs:96-125`). `update` replaces an element whole
|
||
(`edit.rs:459-509`); an annotation whose content changes turns `to_confirm` (`edit.rs:495-509`). Every gesture on a
|
||
point or a polygon ends in one such `update` (or `insert`).
|
||
- **Removal guard.** `remove` refuses with `has_dependents` while anything names the element (`edit.rs:570-577`,
|
||
`903-908`).
|
||
- **Redrawn views.** After every command, the annotations of a view whose drawing or `view_box` changed turn
|
||
`to_confirm`; geometry is never touched (`edit.rs:792-857`).
|
||
- **Preview handle.** `PreviewSheet` holds the drawings and the document, `preview.state` and `view.canvas`
|
||
(`core/ops.rs:514-530`, `crates/wasm/src/lib.rs:79-154`). Practitioner canvas and editor canvas share one
|
||
composition (`ops.rs:472-507`).
|
||
- **Crop composition is vector.** The whole sanitised drawing is cloned, its root becomes a `<g>`, only the new
|
||
root's `viewBox` frames it (`core/anatomy/compose.rs:94-160`). A crop view needs no derived file.
|
||
- **Placement rules.** `view_frame`, `geometry_bounds`, `placement`, `out_of_frame`, `too_small`, `marker_too_small`
|
||
(`core/anatomy/frame.rs:60-254`) and `interior_too_small` (`core/anatomy/interior.rs:33-43`, `207-222`).
|
||
- **Path reader.** Strict browser grammar, every command, implicit repeats, numbers bounded at 2^20, f64 pen,
|
||
bounds measured on the shape (`core/anatomy/path.rs`, 1 090 lines). Its `Cursor`, `Pen`, `Arc` and `Ellipse` are
|
||
private and the number spans are computed then dropped (`path.rs:136-139`, `203`, `226`, `303-311`).
|
||
- **Number writing.** `json::js_number` prints ECMAScript `Number::toString` (`core/json.rs:18-82`), valid in path
|
||
data. `anatomy/svg/number.rs` is a JavaScript `Number()` reader and is not a path writer.
|
||
- **Names.** `PreviewState.index.names` already ships every annotation's name to the page (`core/domain/sheet/preview.rs:332-356`).
|
||
|
||
### 1.2 What the application already offers (re-verified)
|
||
|
||
| Capability | Code | Use in the redesign |
|
||
|---|---|---|
|
||
| Editor route, modes, permission states | `app/app/routes/app/admin/AdminSheetDraftRoute.tsx:73-156`, `app/editor/mode.ts:12-92` | REUSE |
|
||
| Store, commit, undo (one entry per accepted commit, 8 MiB) | `app/editor/state/editorEdit.ts:45-82`, `undo.ts:7-54` | REUSE, header buttons ADD |
|
||
| Undo shortcuts (global, ignored in fields and dialogs) | `app/editor/useUndoShortcuts.ts:4-24` | REUSE |
|
||
| Explicit save, unsaved state, conflict dialog with M8 | `editorSave.ts:43-149`, `DraftHeader.tsx:27-153`, `ConflictDialog.tsx:105-231` | REUSE |
|
||
| Local recovery (sessionStorage, key user + version, revision in the record) | `recovery.ts:10-155`, `recoveryFlow.ts:56-187` | REUSE |
|
||
| Pan, pinch, wheel, keyboard zoom | `app/catalogue/useFraming.ts:85-168` | REUSE, keys ADAPT |
|
||
| Point and polygon move after 4 CSS px, one update on pointer-up | `useMoveGesture.ts:78-116`, `gesture.ts:5-33` | ADAPT (pointerId) |
|
||
| Point, zone and link creation by clicks | `creation.ts:93-178`, `usePlacement.ts:13-85` | ADAPT |
|
||
| Geometry accept after commit | `app/editor/issues.ts:123-175` | REUSE |
|
||
| Upload, cleaning, attach, repair | `drawingUpload.ts:86-192`, `repair.ts:60-309` | REUSE, attach ADAPT (remap) |
|
||
| Crop preview of the parent | `CropCanvas.tsx:30-77`, `viewBox.ts:31-46` | REUSE as the rectangle's base |
|
||
| Verification tab, submission | `components/editor/tabs/VerificationTab.tsx`, `verification.ts:64-131` | REUSE, targets ADAPT |
|
||
|
||
### 1.3 Interactions possible without a core change
|
||
|
||
Page-only, each ending in `sheet.edit` and judged by the core on commit (`issues.ts:123-175`): the four-tab shell;
|
||
header undo and redo; the references side panel; sidebar collapse; point move; point size slider (the page reads
|
||
the radii present in the view, the core still refuses `marker_too_small`); polygon vertex drag; « + » on a segment;
|
||
« − » on a vertex; zone move (mouse direct, touch mode); zone redraw keeping the old shape until validation; the
|
||
rectangle gesture that sets a detail view's `view_box`; the « replace by a specific SVG » dialog (page work; its offer comes from a new core call, U5, T9); per-annotation
|
||
colour shown only when set, with « back to the category colour » (an `update` with `color: null`); keyboard
|
||
alternatives; 44 px touch handles; the `pointerId` guard; a multi-tab notice if the owner wants one (T14).
|
||
|
||
### 1.4 New Rust operations required
|
||
|
||
| Op | Needed for | Kind | Estimate |
|
||
|---|---|---|---|
|
||
| `sheet.annotations_in_rect` | name proposal of a detail view (choice 6), automatic access only without overlap | `PreviewSheet` op | 80-150 lines, 1.5-4 KB gzip |
|
||
| `sheet.remap_view` | a crop view receiving a re-based drawing (point E) | `PreviewSheet` op returning `sheet.edit` commands | 120-250 lines, 2-5 KB |
|
||
| per-view minimum visible radius | the red « minimum touchable » mark of the size slider (choice 3) | value in `PreviewState` | 20-40 lines, < 0.5 KB |
|
||
| `sheet.path_points` | curve handles (point D, curves lot, T16) | free op | 250-400 lines, 4-8 KB |
|
||
| `sheet.path_move_points` | move anchors and controls without simplifying | free op | 300-500 lines, 5-10 KB |
|
||
| `sheet.path_translate` | move a curved zone whole | free op | 60-120 lines, 1-3 KB |
|
||
| fixed-category rules + opacity in the layer | choices 4 and 5 | schema + `edit.rs` + `sheet_report` issues + `layer.rs` | 1-3 KB |
|
||
|
||
Estimates come from the recorded size history: the frame rule with curve and arc measure cost +12 616 B, the
|
||
interior rule +6 195 B, `sheet.empty` about +2 698 B, reserved ids +655 B (`docs/development/RUST.md:4101`, `4203`,
|
||
`4452`). They are ranges, not measures.
|
||
|
||
### 1.5 Schema change, serialisation, fingerprints, versioning
|
||
|
||
Only choices 4 and 5 touch the document schema (two optional keys on `AnnotationCategory`, route A of the earlier
|
||
study). Facts that govern it:
|
||
|
||
- `AnnotationCategory` is `{id, name, color}` with `deny_unknown_fields`; `color` is a required key that may be
|
||
`null` (`core/domain/sheet/schema.rs:219-228`). Every strict reader refuses an unknown key: `sheet.check` and
|
||
`sheet.edit` answer `invalid_shape`, PreviewSheet `invalid_document`, the verdict
|
||
`verification.integrity.document`, the snapshot gate `SnapshotRejection::Schema`.
|
||
- The fingerprint hashes the JCS text of the typed document re-serialised (`core/domain/sheet/fingerprint.rs:4-11`,
|
||
`246-273`). A new `Option` field keeps every existing fingerprint only if it is **omitted** when absent
|
||
(`skip_serializing_if`), as `LocalizedOptionalText` already does (`schema.rs:162-180`). The nearest precedents
|
||
(`count_range`, annotation `color`) write `null`; following them would change every fingerprint, the equine
|
||
sheet-ref, the alias pair of BDR-070, every review digest and every R4 app-path digest.
|
||
- The fingerprint and the snapshot gate also require no validation **error** (`fingerprint.rs:262-265`,
|
||
`snapshot_rules.rs:334-340`). A new unconditional `validate.rs` error (for example « three roles required ») would
|
||
strip the fingerprint of every existing document and reject old PDF snapshots. Fixed-category rules must live in
|
||
`edit.rs` (editor refusals) and in a verdict-only tier (precedent `GEOMETRY_MISSING`,
|
||
`core/domain/sheet/report.rs:17-19`, `54-55`), never as an unconditional `validate.rs` error. (The first version
|
||
of this plan made the verdict tier relative to the base; withdrawn by T4, see §2 A.)
|
||
- Doctrine conflict, settled by the owner under T2 (route A, ratified with conditions): `.claude/rules/schemas.md:9-11` says additive optional fields keep the
|
||
contract; `.claude/rules/sheet-model.md` says a document schema change bumps `SHEET_DOCUMENT_SCHEMA_VERSION`, with
|
||
no bump during V1-2 (BLK-008); BDR-068 says `v1` freezes the construction and the validation. Route B (schema v3)
|
||
is excluded by the contract during V1-2 (`docs/development/V1-2_ANATOMICAL_SHEETS.md` §12.3, BLK-008 paragraph) and would need a
|
||
data migration (BLK-008) plus a change to `save_sheet_draft`, which never updates `document_schema_version`
|
||
(`supabase/migrations/20261028110000_sheet_review_workflow.sql:621-623` against the CHECK of
|
||
`20261008110000_anatomical_sheets.sql:120-121`).
|
||
|
||
### 1.6 Wasm module size
|
||
|
||
Measured on the shipped build (`packages/core-wasm/pkg/faunosteo_wasm_bg.wasm`, built 2026-11-04 after the last
|
||
core change of 2026-11-02): 1 569 864 B raw, **592 143 B** with Node `gzipSync` level 9, which is what the gate
|
||
measures (`packages/core-wasm/tests/size.test.ts:12-25`). Budget 600 000 B (D-R13), **margin 7 857 B**. GNU `gzip -9`
|
||
gives 583 126 B; the earlier study's « about 17 KB left » used that figure. Without the curve operations (curves lot,
|
||
out of V1-2.6) the new core code is estimated at about 4.5 to 13.5 KB: it may fit or exceed the margin, so the
|
||
plan measures after each op and holds a fallback ready (decision T1). With the curves lot the total reaches 14 to 31 KB and a
|
||
lever is certain. Documented levers, none applied: `wasm-opt -Oz` (never measured; `wasm-opt` is not installed,
|
||
`RUST.md:4054`, so it is a new pinned build tool), a lighter URL check (about 23 KB), the PDF writer, reader and
|
||
inflater in a lazily loaded second module (about 55-60 KB, `RUST.md:4050-4054`; touches the R4 paths, the import
|
||
worker, the CSP proof and trap recovery, and the readers of user data that need an explicit owner ask). Raising the
|
||
budget is an owner decision (D-R13), never silent. Every figure in this plan is taken with the gate's exact call,
|
||
Node `gzipSync(bytes, { level: 9 })` on the `pkg` build, re-measured on 2026-11-05 at 592 143 B (LRN-118).
|
||
|
||
### 1.7 Corrections to the earlier study
|
||
|
||
| Earlier claim | Code |
|
||
|---|---|
|
||
| About 17 KB of wasm margin | 7 857 B by the gate's measure (§1.6) |
|
||
| PDF highlight is a fixed colour, category settings change no PDF | Fill and fill-opacity are overwritten (`compose.rs:259-267`); zone and trigger **strokes keep the category colour** in the PDF. Category opacity has no PDF effect only if written as `fill-opacity` |
|
||
| Old documents re-written identically under route A | Only with `skip_serializing_if`; the precedents write `null`. And any `sheet.edit` output re-serialises the stored text (seed key order, omitted `color`); « byte for byte » holds for untouched stored texts and for the canonical fingerprint |
|
||
| An integer avoids losing `Eq` | `JsInt` wraps an f64 without `Eq` (`core/domain/js.rs:94`); nothing needs `Eq` on the category |
|
||
| Snapshot can strip the fields « as it strips references » | `lean_document` copies categories whole (`snapshot_rules.rs:160`); stripping is new code, and the export gate re-serialises caller snapshots (`pdf/write/input.rs:174-181`, `export.rs:27-37`) |
|
||
| N-1 and 0.2.0 refuse an unknown key | Only the snapshot is dropped (`snapshotRejected 'schema'`); the report is still imported with a degraded alert (`packages/core-wasm/tests/n-1/domain/archive/envelope.ts:110-117`, `core/domain/archive/read.rs:86-89`) |
|
||
| SQL checks arrays and category ids | Category ids are not checked since M5 (`20261028110000:139-144`); the conclusion (optional keys pass SQL) holds |
|
||
| Worker image before the app, as for any core change | Not written anywhere. When verdict codes, group kinds or verdict format change, the **SQL migration** comes first (`20261101100000_sheet_verification_jobs.sql:57-69`, `153-160`, `321`), then the worker, then the app. A new document rule needs no new code: every error issue outside five excluded codes maps to the existing `verification.validation.rules` (`core/domain/sheet/verdict.rs:277-296`) |
|
||
| Replacing a crop by its own drawing displaces annotations | Not for the project's own data: the seed head drawing has `viewBox="60 100 500 380"` (`supabase/seed/anatomical-sheets/equine/legacy-sources/Horse_head.svg`), exactly the `head` crop (`draft/document.json:477-482`), and the same path data as the full drawing. Keeping positions is right for a drawing cut from the same master; a remap is right only for a re-based drawing |
|
||
| Adding a role to `os`, `articulations`, `zone-colonne` suffices | `os` (Os / Bones) and `articulations` (Articulations / Joints) already carry the fixed names; only `zone-colonne` (Segments vertébraux / Vertebral segments) differs. Three equine annotations carry an own colour that overrides any category setting |
|
||
| Not covered | A detail view without an access is a `view.unreachable` **error** (`core/domain/sheet/validate.rs:199-220`): it blocks the fingerprint, the snapshot and publication. Under choice 6 an access not created automatically must be placed before submission |
|
||
| Recovery keyed by version and revision (contract C13) | Key = user + version; the revision is a field of the record (`recovery.ts:47-49`). Code and contract text differ |
|
||
| `useMoveGesture` has a weak pointerId check | It has none (`useMoveGesture.ts:87`): a second finger feeds the drag while the pinch zooms |
|
||
|
||
### 1.8 SQL, RLS and worker
|
||
|
||
- No SQL reads the members of a top-level category. Optional keys pass `check_document_structure`
|
||
(`20261028110000:411-441`), the CHECKs and the RLS unchanged. `schema_version` 3 is refused
|
||
(`20261028110000:424-426`, `20261010100000:10-12`).
|
||
- The worker reads the document strictly through the core (`crates/worker/src/verify.rs:93-97`,
|
||
`core/domain/sheet/verdict.rs:169-185`, `264-274`). An older worker answers a definitive
|
||
`verification.integrity.document` on a draft carrying the new keys, never retried; a newer worker adding a verdict
|
||
code before SQL knows it closes the rounds whose verdict carries it `verdict_refused` (`20261101100000:57-69`,
|
||
`87-90`). The plan adds no verdict code (fixed-category rules are issues mapped to `verification.validation.rules`).
|
||
- App and worker images are built from one `GIT_SHA` by `.gitea/workflows/release-images.yml:103-120` (prepared,
|
||
never run). The sandbox reuses `faunosteo_worker:dev` without checking it matches the checkout
|
||
(`scripts/db-sandbox.sh:335-347`): every model step rebuilds it explicitly.
|
||
- The only SQL the redesign needs is the U6 migration (decision T4): the round withdrawal the contract requires
|
||
when the integrity rules change (contract §6.4, worded at U0: rounds of draft versions), the core gate, the
|
||
rules epoch, the declared publication check and the declared save check (both approved, contract §12.2). The curves lot will need its own
|
||
withdrawal (path reader). References are in the document; own drawings use the existing upload path, capped at
|
||
4 drawings per sheet, 2 MiB each, 6 MiB in all (`core/domain/archive/snapshot.rs:21-28`).
|
||
|
||
### 1.9 Concurrency, multi-tab, recovery
|
||
|
||
- One draft per sheet (unique partial index, `20261008110000:131-133`); `save_sheet_draft` locks and checks the
|
||
revision (`20261028110000:593-608`); a stale save answers `draft_conflict`, nothing is overwritten.
|
||
- No multi-tab detection in the app (no `storage` event, `BroadcastChannel` or `navigator.locks`). Each tab keeps its
|
||
own sessionStorage copy. Two tabs edit freely; the first save wins; « Garder ma version » in the second tab
|
||
overwrites the first tab's save with a whole document after confirmation (`editorSave.ts:140-149`).
|
||
- Undo crosses a save (history kept, `editorSave.ts:84-93`); `addDrawing` is outside history (`editorEdit.ts:85-104`).
|
||
- Clicking a header button while a text field holds typed text blurs it first, which commits; the undo then reverts
|
||
that typing (`TextField.tsx:75-88`, `GeometryGroup.tsx:188`).
|
||
|
||
### 1.10 Keyboard, mouse, touch
|
||
|
||
- Markers are not focusable; keyboard selection goes through the annotation list (`AnnotationList.tsx:55-72`).
|
||
- Arrows already pan the focused canvas box (`useFraming.ts:150-168`): they collide with « arrows move the chosen
|
||
handle » unless focus decides (handle focused → move; box focused → pan).
|
||
- `touch-action: none` while a tool is active, a drag is armed, the view is zoomed or a movable selection exists
|
||
(`useCanvasGestures.ts:76-84`).
|
||
- Overlay vertices are decorative, `pointer-events-none`, radius span/200 drawing units (`AnnotationOverlay.tsx:48-66`,
|
||
`116`, `125`). No multi-touch test exists; the touch test is a single CDP touch at 1 280 px
|
||
(`apps/app/e2e/shell/editor-geometry.spec.ts:416-470`).
|
||
|
||
---
|
||
|
||
## 2. Sensitive points A to I
|
||
|
||
### A. Non-destructive migration for fixed categories and opacity
|
||
|
||
- Route A, ratified in principle with conditions (T2, T3): `role` (`bone` | `joint` | `vertebra` | `navigation`, the last under T10 option B) and
|
||
`fill_opacity` (integer percent 10 to 100) on `AnnotationCategory`, both `Option` + `#[serde(default)]` +
|
||
`js::present` (an explicit `null` refused, one canonical form) + `skip_serializing_if = "Option::is_none"` +
|
||
`ts(optional)`, the `LocalizedOptionalText` pattern; never serialised as `null`; an absent key never defaulted in
|
||
the fingerprinted document. No `SHEET_DOCUMENT_SCHEMA_VERSION` bump, no SQL schema change, no data migration. The
|
||
owner's conditions are the proof list of `V1-2-6_UX_COMPATIBILITY.md` §8, green before any key is written.
|
||
- One-way compatibility, never called full backward compatibility: existing documents carry neither key and read,
|
||
write and fingerprint as today (proven by the pins: equine fingerprint `12d78872…`, alias `27c7383c…`, every seed
|
||
review digest, R4 app-path digests, `V1-2-6_UX_TESTS.md` U6); a document carrying a key cannot be read by any
|
||
earlier application, worker or core, so the first such write is a point of no return (COMPATIBILITY §0, §7).
|
||
- New sheets: `sheet.empty` creates the three fixed categories with roles, core-chosen ids (precedent `view-main`,
|
||
`core/domain/sheet/create.rs:9`, `28`), fixed names and default colours (T5, ratified: `cat-bone`, `cat-joint`,
|
||
`cat-vertebra`, values and sources in DECISIONS T5).
|
||
- Fixed-category checks, no residual gap (T4), never as a `validate.rs` error (that would strip fingerprints and
|
||
reject old snapshots):
|
||
- core, verdict tier: `sheet_report` on the draft gives error issues for a missing role, a duplicate role or a
|
||
wrong name on a role-bearing category, with no base needed, so a first version is judged like any other; they
|
||
map to the existing `verification.validation.rules` (`verdict.rs:277-296`), no new verdict code;
|
||
- core, editor tier: `edit.rs` refuses removing a role-bearing category, changing or clearing its role, a duplicate
|
||
role, a rename away from the fixed names and any edit giving, changing or clearing `navigation` (`cat-access`
|
||
enters only in the core-built access batch, T10); giving a role writes the fixed names
|
||
in the same update; repair commands insert a missing fixed category, restore the fixed names and clear a
|
||
duplicate role (DECISIONS T4);
|
||
- server: the U6 migration withdraws the rounds of draft versions in flight, adds a core gate at
|
||
`complete_sheet_verification` that refuses a passed verdict from a pre-U6 core, and adds a declared SQL check
|
||
of the fixed model at approval and publication and a declared check at `save_sheet_draft` (a role carried
|
||
twice, renamed away or lost refused; role-less drafts still save); both approved, O22 amended at U0 (contract
|
||
§12.2), not built.
|
||
- Functional write lock instead of an expand-then-write split: the U6 migration exposes a rules epoch and the
|
||
application writes no key and creates no new-model sheet before it reads it; SQL first is mandatory, the only
|
||
order that fails closed (COMPATIBILITY §7). U6 runs on the sandbox only until the owner decides otherwise.
|
||
|
||
### B. Historical equine sheet and published documents
|
||
|
||
- The historical sheet `503dc301…` stays read-only on the server (`sheet.historical_read_only`) and in Git: no file
|
||
of `supabase/seed/anatomical-sheets/equine/` changes; `pnpm r5:import-equine --check` stays clean at every
|
||
sub-step; `anatomy_canvas_op.rs:27` keeps reading the seed unchanged.
|
||
- Published versions are immutable (`20261028110000:274-292`) and keep their bytes.
|
||
- Category ids never change (`id_changed`, `edit.rs:486-489`). Converting the equine working copy (roles on
|
||
`os`, `articulations`, `zone-colonne`, the renaming of `zone-colonne`, the three own colours) is V1-2.8 content
|
||
work, a reviewed edit of its draft, after decision T6. Nothing in V1-2.6 converts it.
|
||
- Historical preservation is mandatory (T5): the historical versions keep their category ids, names, colours, the
|
||
three own colours, every annotation and their fingerprints. Roles go on a working copy only; U6 proves on an
|
||
in-memory copy of the seed that a conversion leaves the originals' bytes, fingerprint, alias and review digests
|
||
unchanged. Under T4 the working copy cannot pass verification until V1-2.8 converts it.
|
||
|
||
### C. Proof of compatibility: N-1, PDF snapshots, worker, old drafts
|
||
|
||
- Snapshot: `lean_document` strips `role` and `fill_opacity`, and the export gate strips them on caller-built
|
||
snapshots and in `export_from_envelope`, so no path writes them into an envelope. The PDF needs neither (fill and
|
||
fill-opacity are overwritten in the highlight, `compose.rs:259-267`).
|
||
- N-1: a dedicated New-present sheet fixture and harness export PDFs that must pass the assertions of
|
||
`apps/app/tests/unit/n-1.reader.test.ts:178-196` (envelope success, archive kept, no `snapshotRejected`); the seed
|
||
path stays as it is. `contracts.types.test.ts:53-61` checks assignability: `ts(optional)` on both keys is
|
||
necessary and sufficient; it says nothing about runtime stripping, which the fixture test proves.
|
||
- Worker: the image is rebuilt from the same commit, checked against `git rev-parse HEAD` before the run (U6 adds
|
||
that guard), and `verify-e2e` runs a New-absent and a New-present draft.
|
||
- Old drafts and recovery copies are plain document texts read by the same strict reader.
|
||
- The readers of user data widen (`assert_snapshot`, used by `archive/read.rs`, accepts the keys): the owner agreed to
|
||
a controlled widening (T2). It accepts exactly the two keys with the document reader's types and range; any other
|
||
unknown key, `null`, unknown role or out-of-range opacity still rejects the snapshot (report kept); no version is
|
||
dropped; the frozen N-1 copies are never edited.
|
||
|
||
### D. Editing and translating curves without geometric degradation
|
||
|
||
Validated guarantee already held: a curve is never converted or simplified. Paths are displayed by the core; the
|
||
editor never reshapes them (level-1 C45) and offers « Remplacer par un polygone ». No document of the project holds
|
||
a path (the seed has 22 circles, 6 polygons, 0 paths), and no product path can create one: creation makes points
|
||
and polygons only (`creation.ts:93-97`), package import and zones from the drawing's shapes stay deferred
|
||
(`V1-2_ANATOMICAL_SHEETS.md` §8.3). Board 05 labels its curve card « exemple d'une autre fiche ».
|
||
|
||
Handle editing of curves (anchors, controls, translation) is deferred out of V1-2.6 to the curves lot (ex-U9,
|
||
decision T16). The owner made the deferral conditional on an audit: it confirms that no tracked document holds a
|
||
path and no product journey needs one changed; the database contents of DEV and the sandbox were not queried, so a
|
||
read-only count runs before the new model is activated on an environment and before U6 or U8 reaches any
|
||
environment beyond the throwaway sandbox (DECISIONS T16). Until the curves lot, a stored path keeps its
|
||
`d` text byte for byte, no operation converts it, and every operation that would change it is refused with the
|
||
document unchanged; « Remplacer par un polygone » (contract §8.3) stays the one, explicit, undoable way a path
|
||
leaves a document. The curves lot precedes any feature that lets a path enter a document. Its specification is kept
|
||
so it can start without a new study:
|
||
|
||
- Built on the existing reader (`path.rs`), extended to keep each number's byte span and a segment model (command,
|
||
absolute or relative, origin, anchor, explicit controls).
|
||
- `path_move_points` rewrites only the moved numbers and those that depend on them; every other byte stays.
|
||
Relative commands after a moved anchor are compensated so later absolute positions do not move; H or V moved off
|
||
their axis convert to L (splitting implicit runs); an S or T whose implicit control would change converts to C or
|
||
Q; arcs move their endpoint only (radii, rotation and flags untouched; a λ rescale is reported). Separators are
|
||
re-inserted where a sign or a dot would merge two numbers.
|
||
- `path_translate` changes only absolute coordinates and the leading `m`.
|
||
- Numbers: exact decimal arithmetic on the written digits, output precision = max(input precision of the number,
|
||
2 decimals for a user move), so compensation never moves another point and a translation round-trips exactly.
|
||
- Preview during a drag: page-side transform of the drawn path element (an SVG `transform` on the preview only), one
|
||
core call on pointer-up (BDR-050), never a core call per move.
|
||
- Implicit S/T controls are listed as non-editable; a control outside the frame is never judged on its own.
|
||
- Remap of a crop view holding a path is refused with a closed code until the curves lot.
|
||
|
||
### E. Annotations when a crop view receives its own SVG
|
||
|
||
- Today the attach keeps the old `view_box` and changes only `svg_asset_id` (`drawingUpload.ts:185-192`): the frame
|
||
stays the crop rectangle R, read in the new drawing's space. For a drawing cut from the same master (the seed
|
||
head drawing has exactly the crop's `viewBox`), this is already right and annotations stay on their anatomy.
|
||
- For a re-based drawing (another export with a different `viewBox`), positions must be transposed. The owner
|
||
ratified an explicit choice on every replacement, with no approximate automatic transformation (T9). The dialog
|
||
opens before the upload, no action preselected. Two core calls (DECISIONS T9): an offer computed before the
|
||
upload from the document and the cleaned candidate text (the core reads V from the candidate root), then the
|
||
batch, after the drawing is registered and held, from the view id and the asset id. R is the crop rectangle, V
|
||
the candidate's `viewBox`; both actions rest on a premise the dialog states and both fail closed:
|
||
- « Conserver les positions »: only when V equals R (« ce dessin utilise le repère de la vue parente »);
|
||
- « Repositionner les annotations »: only when V differs from R with the same aspect ratio on the 0.01 grid, no
|
||
path, no descendant crop, numbers in range (« ce dessin montre exactement la zone de la vue »);
|
||
- « Annuler »: always; nothing uploaded, document and history untouched.
|
||
An unavailable action stays visible, disabled, with its reason; a candidate without `viewBox` gets « Annuler »
|
||
only, stricter than today's attach.
|
||
- `sheet.remap_view` (the batch call) returns the `sheet.edit` commands (the view update and one `update` per
|
||
remapped annotation), committed by the existing `commitBatch` as one undo entry under the geometry accept
|
||
(`editorEdit.ts:45-61`); a refusal there leaves the document unchanged and an unreferenced registered drawing.
|
||
The core reads R and V itself; the page supplies no number. Mapping: one scale and one translation (a different
|
||
ratio is refused, `remap.aspect`, never centred); circles move their centre and scale `r`; polygons every point;
|
||
numbers on the 0.01 grid of the page, and a point pushed out of the frame by the rounding refuses the whole remap; every remapped annotation `to_confirm` (by the `update` rule, `edit.rs:495-509`).
|
||
- Scope: the view's own annotations, including the detail triggers drawn in it. Descendant views with their own
|
||
drawing are untouched. Refused as a whole, with closed codes: a different aspect ratio (`remap.aspect`), a
|
||
descendant crop view without its own drawing (`remap.descendant_crop`; no sheet has one), a path in the view
|
||
(`remap.path`, until the curves lot), `unknown_view`, `no_frame`, `out_of_range`. A keep or a repositioning whose
|
||
end state fails the geometry accept leaves the document unchanged, with a message.
|
||
- Fixed user-unit sizes (twin offset 12, floor 2, strokes) do not scale, so `too_small` can change after a downscale;
|
||
the geometry accept and the repair dialog judge the end state.
|
||
|
||
### F. `annotations_in_rect`, name proposal, access placement
|
||
|
||
- Input `{view_id, rect}` on the preview handle; `rect` passes the frame range rule (`Frame::from_numbers`, made
|
||
`pub(crate)`). Output `[{id, relation}]` in document order, `relation` = `inside` | `partial`; names come from
|
||
`index.names`, already on the page.
|
||
- Geometry tested by bounds: circle by its hit-box disc (cx ± r, the box of the frame rule, `frame.rs:167-185`),
|
||
polygon and path by their bounds (`path_bounds` is tight on the shape). `inside` = bounds within the rect;
|
||
`partial` = bounds intersect. Over-reporting for concave shapes is conservative: it can only prevent an automatic
|
||
access, never place one over an annotation.
|
||
- Name proposal (page, display formatting from the core's list): FR and EN names of the `inside` annotations, in
|
||
document order, joined by the locale's list format, the first three then « … »; none inside → « Vue détaillée n »
|
||
/ « Detail view n », n = number of detail views + 1. Both fields stay editable.
|
||
- Access category (T10, option B ratified): a navigation access is never put in Os, Articulations or Vertèbres by
|
||
the system. The navigation type exists (`detail_trigger`, `schema.rs:439-462`) but requires an existing category
|
||
(`schema.rs:449`, `validate.rs:287-292`), and snapshots carry triggers to N-1 (`snapshot_rules.rs:141-165`).
|
||
Ratified (option B, brief U0, BDR-101): one internal category `cat-access`, role `navigation`, created by the
|
||
core inside the automatic-access batch, absent from every visible panel and picker (DECISIONS T10).
|
||
- Access: automatic creation needs that role, so it lands in U6, not U5. Then the view, its access (the drawn
|
||
rectangle as its polygon in the parent view) and, if missing, the navigation category are inserted in one batch,
|
||
only when the overlap list is empty. Otherwise the box is unchecked with the reason stated, and the access is
|
||
placed explicitly from the view's menu (« Ajouter un accès »), which replaces the « Accès à une vue détaillée »
|
||
toolbar tool (choice 6). Before U6, « Ajouter un accès » asks the editor for the category, as level 1 does.
|
||
Until an access exists the view is `view.unreachable`, an error in the validation panel that blocks submission,
|
||
not saving; the creation flow says so and links to the placement.
|
||
|
||
### G. Polygon operations, undo and redo, invalid shapes
|
||
|
||
- Page operations, each one `sheet.edit update` of the whole annotation: vertex drag (preview on move, commit on
|
||
pointer-up), « + » inserts the segment midpoint after the segment's start vertex, « − » removes the chosen vertex,
|
||
zone drag translates every point, redraw replaces the points after the new trace is accepted.
|
||
- Protections before the core: « − » disabled at 3 vertices with « Une zone garde au moins 3 sommets » (board 12 B); no non-finite value committed; a vertex released on
|
||
its neighbour is a no-op; above a handle cap (T18: rule recorded at U0, contract §17.12; value fixed at U2 from the equine maximum, 17 vertices, with a margin) the shape shows its outline
|
||
and a message instead of one handle per vertex. The core judges the end state on commit (`invalid_shape` below 3
|
||
points; `out_of_frame`, `too_small`, `interior_too_small` through `issues.ts:123-175`). A refusal restores the
|
||
previous shape.
|
||
- Pending previews (a drag, arrow moves before Enter, a staged form) are cancelled and restored before any undo,
|
||
redo, document replacement, save reload, tab change or second pointer: index-based operations never apply to a
|
||
document they were not computed on.
|
||
- A second `pointerdown` during an armed drag cancels the drag and restores the shape (a pinch never moves a
|
||
handle). `touch-action: none` sits on the handle hit targets and in the explicit move mode; the canvas box keeps
|
||
panning (the browser reads `touch-action` at touchstart, `useCanvasGestures.ts:73-83`).
|
||
- Redraw: the old shape stays drawn and committed until the new trace closes and is accepted; Escape or a refusal
|
||
keeps the old one. One undo entry.
|
||
- Undo and redo: one entry per accepted commit, whatever the tab; header buttons, shortcuts and the toast call the
|
||
same `undo()`. The toast is dismissed by any commit, undo or redo, stays until then or until closed, is reachable
|
||
by keyboard, and its message is in a live region. Sliders (point size, opacity) and arrow moves commit on release,
|
||
Enter or blur only (BDR-050), so a keyboard walk never floods the 8 MiB history (about 20 entries of the equine
|
||
document).
|
||
- Keyboard: roving focus inside a shape (Tab enters the shape, arrows between handles when the handle list is
|
||
focused, then move the chosen handle in « move » state), Shift ×10, Insert or the visible « + » button, Delete or
|
||
Backspace or the visible « − » button, Enter commits, Escape restores. Arrows pan only when the canvas box itself
|
||
has focus.
|
||
- Self-intersection stays allowed (nonzero rule decides, `interior.rs:33-34`); no new polygon rule.
|
||
|
||
### H. Tests
|
||
|
||
Detail per sub-step in `V1-2-6_UX_TESTS.md`: core unit and conformance, seeded property tests in Rust (no new
|
||
dependency), table tests in TypeScript, hostile inputs at the op level, N-1 on a New-present fixture, oracles and
|
||
seed untouched, axe, keyboard and touch journeys, sandbox and worker runs.
|
||
|
||
### I. Decisions that block before any code
|
||
|
||
Each sub-step lists the decisions it consumes; the single table is in `V1-2-6_UX_DECISIONS.md` and the blocking
|
||
criteria in `V1-2-6_UX_RISKS.md`. Answered 2026-11-05: T2/T3 (with conditions), T4 (with both SQL checks), T5
|
||
(history and new-sheet defaults), T9, T10 (option B), T11, T12 (principle), T15, T16. Still open: before U5 or U6,
|
||
T1 only if a measure exceeds the budget; before U7, the T12 text; at V1-2.8, T6; T14 a follow-up.
|
||
|
||
---
|
||
|
||
## 3. Sub-steps
|
||
|
||
Order: U0, U1, then U2, U2b (owner, 2026-11-06), U3 and U4 (frontend), U5 (first core queries,
|
||
consumer-driven), U6 (model), U7 (common text, when its wording exists), U8 (closure). Curves are deferred to the
|
||
curves lot (ex-U9, T16). Each sub-step ends at an owner checkpoint; the next starts only on a new explicit owner
|
||
authorisation.
|
||
|
||
Common rules for every sub-step that touches code:
|
||
|
||
- Work in `/home/bchanot/Documents/faunosteo-v1-2`, every shell command with that absolute path verified first
|
||
(LRN-110). Commit in place on `feature/v1-2-anatomical-sheets`, one commit per coherent change; rollback = revert
|
||
of the sub-step's contiguous commits. No sub-branch (the gitflow lib only branches from develop), no merge, no
|
||
`gitflow.sh finish`.
|
||
- Gates: `pnpm typecheck`, `pnpm test:run`, `pnpm lint`, `pnpm build`; after any change under `crates/core` or
|
||
`crates/wasm`, `pnpm rust:check` and `pnpm wasm:build` first and the size figure recorded; `pnpm check:all` before
|
||
the checkpoint; fresh verifier and security review.
|
||
- Database: `pnpm db:sandbox` only (`up fresh`, `up upgrade`, `test-db`, `types --check`, `e2e-shell`, `test`,
|
||
`verify-e2e`), in the order `test-db → e2e:shell → test` (LRN-113). Forbidden: `pnpm db:start`, `db:reset`,
|
||
`db:test`, `db:types`, `pnpm supabase …`, `e2e:avatar` and `e2e:sheet-assets` outside their sandbox aliases, any
|
||
command reaching DEV. The CLAUDE.md line « SQL change: db:reset && db:test » does not apply to this plan.
|
||
- The sandbox and the worker image tag are shared with the other checkouts of this machine
|
||
(`scripts/db-sandbox.sh:47-60`): no other checkout runs them during V1-2.6; the owner-trial stack is rebuilt only
|
||
after telling the owner (it wipes trial accounts and data).
|
||
- Owner demos run on a sandbox demo sheet provisioned by the same upload path as `editor-equine.spec.ts:81-104`
|
||
(the equine drawing uploaded through the application), not on the historical working copy, which the missing
|
||
sandbox drawings block (separate track).
|
||
|
||
### U0 · Contract, decisions and amendments (docs only)
|
||
|
||
- State: authorised 2026-11-05 (brief « Autorisation U0 uniquement »), contract
|
||
`.claude/tasks/contracts/2026-11-05-v1-2-6-ux-u0.md`.
|
||
- Objective: record the owner's answers to `V1-2-6_UX_DECISIONS.md` and amend the ratified texts the validated UX
|
||
replaces.
|
||
- Files: `docs/development/V1-2_ANATOMICAL_SHEETS.md` §6.2 (save check, local copy key), §6.4 (withdrawal of draft
|
||
rounds), §6.7 (fixed-category row), §7.4 (new-sheet categories, common text), §8.2 (no coordinate fields, fixed
|
||
categories, colour shown when set, access created with the view), §8.3 (vertex drag and the crop rectangle leave
|
||
level 2; curves per T16), §8.4 (O14 A kept, tablet rule), §12.2 and the §17.1 row (O22 amended for the two SQL
|
||
checks), §16.7 (new state), §16.12 (deferred lots), §17.12 (the decisions); the level-1 contract
|
||
`.claude/tasks/contracts/2026-11-03-v1-2-6-editor-1509.md` (C3, C4, C5, C6, C7, C8, C11 per T15, C13 wording to match
|
||
the code key, C16, C18, C20, C25, C28, C32, C33, C40, and a precedence rule in its header); `docs/design/README.md` (v1-2-6
|
||
boards replace V1-2.4 boards 04 and 05 for editing, board 05's read-only mode kept, BDR-096);
|
||
`.claude/rules/sheet-model.md` (optional keys under T2; rules may also live in `edit.rs` and `sheet_report`) and
|
||
`schemas.md`; the implementer decisions (T7, T8, handle cap, branch policy); `.claude/memory/decisions.md` via
|
||
`memory.sh`. §7.4 records T12 without any normative wording; §8.3 records the curves lot (T16).
|
||
- Dependencies: owner answers (recorded 2026-11-05, BDR-100, BDR-101) and the owner's authorisation to start U0
|
||
(given 2026-11-05).
|
||
- Rust ops: none. Tests: a fresh verifier checks the amendments against the answers.
|
||
- Acceptance: each decision recorded once and cited where it applies; no contradiction left between the contract,
|
||
the level-1 criteria and the boards.
|
||
- Owner demo: read the amended sections. Rollback: revert.
|
||
- Checkpoint: owner approves the amended contract.
|
||
|
||
### U1 · Shell: four tabs, header undo, references panel, tablet layout
|
||
|
||
Status: implemented on `feature/v1-2-anatomical-sheets` (lots A to H; Lot I, gates and checkpoint, in progress); contract
|
||
`.claude/tasks/contracts/2026-11-06-v1-2-6-ux-u1-1123.md`. The tooling below moved to U6 (owner, contract CLARIFICATIONS).
|
||
|
||
- Objective: General, Annotations, Findings, Verification; views, drawings, vertebral regions and categories in
|
||
Annotations; References as a side panel from the header or a finding; Undo and Redo in the header on every tab;
|
||
sidebar hidden in the editor below 1 280 px with the menu one tap away; « Aller à » retargeted.
|
||
- Files: `app/editor/tabs.ts`, `EditorTabs.tsx`, `EditorTabBody.tsx`, `DraftHeader.tsx`, `components/editor/tabs/*`,
|
||
`app/editor/verification.ts:64-131`, `PropertiesPanel.tsx:169`, `components/shell/AppLayout.tsx:72-123`,
|
||
`ToolColumn.tsx`, i18n.
|
||
- Dependencies: U0, T11 (ratified: level-1 trial stopped, level 1 not declared validated, residuals tracked), T15
|
||
(ratified: header undo named « Annuler la dernière modification », C11 relabelled « Abandonner les
|
||
modifications »).
|
||
- Rust ops: none.
|
||
- Tests: `V1-2-6_UX_TESTS.md` U1.
|
||
- Acceptance: four tabs at 1 024 px and wider; every existing editor journey green on the new shell; narrow-width
|
||
read-only unchanged; undo from any tab reverts the last accepted change.
|
||
- Owner demo: on a non-equine sheet created in the UI (`V1-2-6_OWNER_TRIAL.md` 4.9), switch tabs, undo a General change from Annotations, open References from a
|
||
finding, resize to 1 180 px.
|
||
- Risk: broad test rewrite (each removed assertion mapped to its replacement). Rollback: revert, no data change.
|
||
- Checkpoint: owner validates the shell.
|
||
|
||
### U2 · Direct manipulation of points and polygons
|
||
|
||
- Objective: boards 02 to 06 and 13 for points and polygons (curve handles excluded, curves lot): point move and size
|
||
slider snapping to the radii of the view with the red minimum mark; vertex drag; « + » per segment; « − » on the
|
||
chosen vertex; zone drag directly with the mouse once selected, explicit « Déplacer la zone » mode by touch; redraw
|
||
keeping the old shape until accepted; 44 px touch handles; pointer rules and keyboard of §2 G; the toast;
|
||
coordinate fields leave the normal journey.
|
||
- Files: `AnnotationOverlay.tsx` (interactive handle layer), `EditableAnnotations.tsx`, `GeometryGroup.tsx`,
|
||
`PropertiesPanel.tsx`, `TracingBar.tsx`, `ToolColumn.tsx`, `KeyboardAdd.tsx`, `useMoveGesture.ts`, `gesture.ts`,
|
||
`geometryEdit.ts`, `usePlacement.ts`, `useCanvasGestures.ts`, `app/catalogue/useFraming.ts`, a toast in
|
||
`components/ui`; core: `anatomy/frame.rs` and `domain/sheet/preview.rs` (per-view minimum visible radius in
|
||
`PreviewState`), types and wrapper.
|
||
- Dependencies: U1.
|
||
- Rust ops: one read-only value (minimum visible radius per view, from the `marker_too_small` threshold,
|
||
`frame.rs:67`, `220`), so the page draws the mark without a TypeScript size rule (BDR-043, C32).
|
||
- Tests: `V1-2-6_UX_TESTS.md` U2.
|
||
- Acceptance: every listed gesture works with mouse, touch (1 024, 1 180 and 1 280 px) and keyboard; a refused shape
|
||
is restored exactly; no coordinate field in the normal journey; latency under the 500 ms budget.
|
||
- Owner demo: on the demo sheet, move a point, change its size, drag a vertex of « Thoraciques », add and remove a
|
||
vertex, move the zone, redraw it and cancel, undo each step; same on a tablet in landscape.
|
||
- Risk: touch and keyboard conflicts (§2 G). Rollback: revert (the core value is additive and unused once reverted).
|
||
- Checkpoint: owner tries mouse and tablet.
|
||
|
||
### U2b · Annotations et constats
|
||
|
||
- Retained by the owner on 2026-11-06 (brief « Validation de principe U2b et préparation des checkpoints », F1,
|
||
BDR-103); its own contract, tests and owner checkpoint; starts only on a new explicit owner authorisation.
|
||
- Objective: boards 17 to 22 of `docs/design/v1-2-6-constats/` (design proposal): from a selected annotation, its
|
||
zone's findings by family, add (zone preselected, F22), edit, change or create its finding zone; in Constats,
|
||
instant search, result count, « Filtrer sur le schéma » on one or more views, combined filters, reset. Filters are
|
||
interface state, never written to the sheet.
|
||
- Spec, files, risks, tests, acceptance and owner demo: `V1-2-6_UX_FINDINGS_NAV.md` sections 4 to 6; decisions F1 to
|
||
F22 there (section 7): F2, F3, F4, F8 and F22 decided (BDR-104); F5 and F9 to F21 approved as recommended, the F3
|
||
folding and other-language display, the F8 confirmation and the F22 « Changer la zone associée » action decided
|
||
(brief « Ratification finale U1 et autorisation conditionnelle d'implémentation », 2026-11-06, BDR-105). Place
|
||
unchanged: after U2, before U3. Not authorised: its contract and code wait for a new owner authorisation.
|
||
- Dependencies: U1 (navigation, kept-mounted tabs, `folded`), U2 (selection, pointer and keyboard model).
|
||
- Rust ops: none; wasm budget unchanged. No document structure change (request C of the complement).
|
||
- Checkpoint: owner tries the grasset journey, search and drawing filter with mouse, tablet and keyboard.
|
||
|
||
### U3 · Category panel and own colour
|
||
|
||
- Objective: board 07 states A to D without the fixed-role locks (they come at U6): foldable panel in Annotations,
|
||
swatch with the name next to it, 16-colour palette plus hex, staged form with « Appliquer » (the drawing previews
|
||
the candidate document on the preview handle, the store commits one batch on Apply, Cancel restores), delete when
|
||
unused, « Réaffecter à… » when a delete is refused (one batch of annotation updates, one undo entry); own colour of
|
||
an annotation shown only when set, with « Revenir à la couleur de la catégorie »; new annotations inherit.
|
||
- Files: `components/editor/general/CategoriesSection.tsx` (moved), `AnnotationFields.tsx:96-104`,
|
||
`AnnotationList.tsx:53-73`, `editorEdit.ts` (preview without commit), i18n.
|
||
- Dependencies: U1.
|
||
- Rust ops: none.
|
||
- Tests: `V1-2-6_UX_TESTS.md` U3.
|
||
- Acceptance: board 07 A to D minus the locks; board 03 colour behaviour; equine own colours shown and revertible.
|
||
- Owner demo: recolour a category with preview, cancel, apply; reassign and delete a category; revert an own colour.
|
||
- Risk: preview without commit must never leak into history. Rollback: revert.
|
||
- Checkpoint: owner.
|
||
|
||
### U4 · Detail view by rectangle (manual)
|
||
|
||
- Objective: « Créer une vue détaillée » draws a rectangle on the parent drawing (handles, keyboard resize) and sets
|
||
the new view's `view_box`; names typed; the access placed from the view's menu (« Ajouter un accès »), which asks
|
||
the editor for the category until U6 (T10); the toolbar tool « Accès à une vue détaillée » and the numeric crop
|
||
editor leave the normal journey.
|
||
- Files: `CropCanvas.tsx`, `DetailViewForm.tsx`, `CropEditor.tsx`, `DetailViewRow.tsx`, `ToolColumn.tsx`,
|
||
`app/editor/viewBox.ts`, `viewUpdate.ts`, i18n.
|
||
- Dependencies: U2.
|
||
- Rust ops: none (the core refuses an unusable frame: `view.frame.unknown`).
|
||
- Tests: `V1-2-6_UX_TESTS.md` U4.
|
||
- Acceptance: a detail view created and opened without typing a number; `view.unreachable` shown until its access
|
||
exists.
|
||
- Owner demo: create « Coude » on the main view, place its access, open it in the preview.
|
||
- Rollback: revert.
|
||
- Checkpoint: owner.
|
||
|
||
### U5 · Detail view assisted: `annotations_in_rect`, `remap_view`, name, specific SVG
|
||
|
||
- Objective: the two core queries, consumed in the same sub-step: proposed FR/EN name and the overlap list; explicit
|
||
access placement (automatic access moves to U6, T10); « Remplacer par un SVG spécifique » with the three-action
|
||
dialog of §2 E (T9).
|
||
- Files: core `anatomy/frame.rs` (`from_numbers`, `holds` to `pub(crate)`), new `domain/sheet/rect.rs` and
|
||
`domain/sheet/remap.rs`, `ops.rs` (`call_with_preview`), types, `packages/core-wasm/src`, `app/core/*`,
|
||
`DetailViewForm.tsx`, `CropCanvas.tsx`, `drawingUpload.ts:184-192`, `ViewDrawing.tsx`, `RepairDialog.tsx`, i18n,
|
||
`RUST.md` §12.
|
||
- Dependencies: U4; T9 (ratified); T1 if the measure exceeds the budget.
|
||
- Rust ops: `sheet.annotations_in_rect`, the replacement offer (name fixed at U5, before upload, from the candidate
|
||
text) and `sheet.remap_view` (the batch after hold) (§2 E, F; the offer is a small read, inside the U5 size measure). Order: `annotations_in_rect` first, size
|
||
measured; then `remap_view`, size measured; a budget excess stops the sub-step for T1.
|
||
- Tests: `V1-2-6_UX_TESTS.md` U5.
|
||
- Acceptance: board 08 with explicit placement; the replacement dialog on every replacement, « Conserver les
|
||
positions », « Repositionner les annotations » and « Annuler » each proven on fixtures, a different aspect ratio
|
||
refused, « Annuler » sending no request; one undo entry per remap; size within budget or T1 applied.
|
||
- Owner demo: board 08 on the demo sheet; attach the seed head drawing to a crop whose rectangle equals its `viewBox` `60 100 500 380` (keep offered); attach a re-based
|
||
fixture drawing (reposition offered); cancel a replacement.
|
||
- Risk: size; bounds over-report. Rollback: revert (documents written are plain v2).
|
||
- Checkpoint: owner.
|
||
|
||
### U6 · Category model: fixed categories, fill opacity, vertebral regions from the category
|
||
|
||
- Objective: route A (§2 A) under the owner's conditions (T2, T3); `sheet.empty` creates the three categories; the
|
||
T4 checks (absolute verdict rule, edit refusals with the repair path, the U6 migration with round withdrawal,
|
||
core gate, publication check, rules epoch and the save check) live before any key is written (write
|
||
lock); the layer applies `fill_opacity`; snapshot and export
|
||
gate strip both keys; the snapshot reader widened only as bounded in §2 C; the panel locks the fixed categories
|
||
(no delete, name read-only, role badge, « Couleur d'origine » from T5) and gains the opacity slider and field;
|
||
automatic access with the navigation category `cat-access` (T10 option B, ratified), built on the U5 overlap
|
||
list and created only when it is empty; board 09: regions open from the
|
||
vertebra-role category, the region picker of a zone filtered to the vertebra-role category's annotations (page
|
||
filter, no rule), staged « Appliquer » with the error count; fallback « Régions vertébrales » entry per T17 (ratified 2026-11-06) when no category has the role (the
|
||
equine copy before V1-2.8). `docs/ANNOTATION-RENDERING.md` amended first. Tooling moved from U1 (owner, U1 contract
|
||
CLARIFICATIONS): the sandbox `verify-e2e` refuses a worker image whose commit label differs from `HEAD`, and the trial
|
||
command provisions the demo sheet.
|
||
- Files: core `domain/sheet/schema.rs`, `create.rs`, `edit.rs`, `report.rs`, `verdict.rs` (gate marker in
|
||
`verified_with`), `anatomy/layer.rs` (`layer()` 85-102, `Context::point` 242, `zone_visual` 297-304),
|
||
`domain/archive/snapshot_rules.rs:141-165`, `pdf/write/input.rs:174-181`, `export.rs:27-37`, types; app
|
||
`refusal.ts`, the category panel, the repair action, the regions dialog (`components/editor/vertebrae/*`),
|
||
`DetailViewForm.tsx` (automatic access), i18n; SQL `supabase/migrations/<timestamp>_sheet_rounds_withdraw_v1_2_6.sql`
|
||
(name provisional: round withdrawal, core gate, rules epoch, publication check, save check); docs `ANNOTATION-RENDERING.md`, `ANATOMICAL_SHEET_MODEL.md`
|
||
(spec table), `RUST.md`, `DEPLOY.md` (order, write lock); `scripts/db-sandbox.sh` (image check, demo sheet),
|
||
`crates/worker/Dockerfile` (commit label), both moved from U1.
|
||
- Dependencies: U3, U5 (U5 brings `annotations_in_rect`, the overlap list the automatic access needs, after U4's
|
||
rectangle); T2 and T3 (ratified with conditions), T4 (ratified with both SQL checks), T5 (ratified), T10 option B
|
||
(ratified), T17 (ratified 2026-11-06, BDR-102).
|
||
- Rust ops: schema fields, edit refusal kinds, verdict-tier issues, layer reading, snapshot stripping, verdict
|
||
marker.
|
||
- Tests: `V1-2-6_UX_TESTS.md` U6; each row of `V1-2-6_UX_COMPATIBILITY.md` is an acceptance line, and §8 lists the
|
||
proofs the owner required before the write lock is lifted.
|
||
- Acceptance: compatibility matrix proven row by row and §8 green; oracles, goldens and seed unchanged; N-1 reads
|
||
New-present PDFs; worker verdict on the three kinds of draft (role-less fails, repaired passes, New-present
|
||
passes); the contract §16.7 journey on a non-equine sheet with the new UX reaches `open` after the worker verdict;
|
||
a role-stripped draft never reaches a round; a stale worker image is refused (moved from U1).
|
||
- Owner demo: new species sheet with its three categories, custom opacity, regions from Vertèbres, automatic access,
|
||
PDF exported and reopened; a role-stripped direct save refused at save.
|
||
- Deploy order, write lock and rollback: `V1-2-6_UX_COMPATIBILITY.md` §7. Returning to the old application is
|
||
impossible once a document with the keys exists (point of no return; sandbox only until the owner decides
|
||
otherwise).
|
||
- Checkpoint: owner.
|
||
|
||
### U7 · Scope and limits: one-time copy of a versioned common text
|
||
|
||
- Starts only when the owner has supplied the FR and EN text, its source and its validation record (T12); no
|
||
normative text is written or invented by the implementer, and tests use a fixture text kept under `tests/`.
|
||
- Objective: when both disclaimer fields are empty, « Insérer le texte commun (version n) » copies FR and EN once;
|
||
afterwards the fields are free text; a read-only comparison shows the current version; no automatic change ever
|
||
reaches a draft or a published version.
|
||
- Files: a versioned template module in `apps/app/src`, `components/editor/general/TextsSection.tsx`, i18n; the
|
||
change note records the template id and version.
|
||
- Rust ops: none (one `update` of the sheet texts).
|
||
- Tests: `V1-2-6_UX_TESTS.md` U7.
|
||
- Acceptance: board 10; contract §7.4 as amended at U0 (no normative wording until the owner's text exists).
|
||
- Owner demo: insert, edit, compare. Rollback: revert.
|
||
- Checkpoint: owner and the person responsible for the wording.
|
||
|
||
### U8 · Closure
|
||
|
||
- Objective: recovery and conflict journeys re-run on the new UX; the contract §16.7 acceptance on the sandbox;
|
||
the level-1 residuals tracked under T11 re-checked one by one (level 1 still not declared validated as a whole);
|
||
the T16 path count recorded before the new model is activated on an environment and before U6 or U8 reaches
|
||
any environment beyond the sandbox; documents and TODO closed;
|
||
`V1-2-6_OWNER_TRIAL.md` updated.
|
||
- Dependencies: U1 to U6 (U7 when its text exists; curves in their own lot, T16).
|
||
- Tests: `V1-2-6_UX_TESTS.md` U8.
|
||
- Checkpoint: owner trial of the redesigned editor; V1-2.7 stays closed until the owner opens it.
|
||
|
||
### Curves lot (ex-U9, deferred out of V1-2.6, decision T16)
|
||
|
||
- Out of V1-2.6 by the owner's conditional decision; recorded in TODO.md as a future lot that precedes any feature
|
||
letting a path enter a document. Kept here so it can start without a new study.
|
||
- Objective: board 05 curve handles (§2 D), curved zone move, remap of paths, the C45 refusal replaced by real
|
||
correction (with the path point-correction proposal `.claude/tasks/plans/2026-11-04-v1-2-6-path-repair-core-proposal.md`).
|
||
- Files: core `anatomy/path.rs`, `ops.rs`, types, wrappers; app `AnnotationOverlay.tsx`, `useMoveGesture.ts`,
|
||
`repair.ts:60-100`; SQL round-withdrawal migration (the path reader feeds the frame and interior verdict rules,
|
||
`frame.rs:25`, `interior.rs:23`); `RUST.md`.
|
||
- Dependencies: U2, U5; T1 (a lever is certain); its own owner authorisation.
|
||
- Rust ops: `sheet.path_points`, `sheet.path_move_points`, `sheet.path_translate`.
|
||
- Tests: `V1-2-6_UX_TESTS.md` « Curves lot », including a frozen oracle of `number_list`, `path_bounds` and
|
||
`path_outline` on a corpus taken before the change, compared byte for byte after it.
|
||
- Acceptance: a path of a fixture sheet (never the seed) edited point by point, saved, reloaded with every untouched
|
||
number byte-identical.
|
||
- Rollback: revert; paths go back to display only.
|
||
- Checkpoint: owner.
|
||
|
||
---
|
||
|
||
## 4. Frontend-only versus model and core
|
||
|
||
| Sub-step | App | Rust core | Schema | SQL | Worker image |
|
||
|---|---|---|---|---|---|
|
||
| U0 | no | no | no | no | no |
|
||
| U1 | yes | no | no | no | no (the label moved to U6) |
|
||
| U2 | yes | one read-only value | no | no | no |
|
||
| U3, U4 | yes | no | no | no | no |
|
||
| U5 | yes | two queries | no | no | no (the worker calls neither) |
|
||
| U6 | yes | yes | optional keys | round withdrawal, core gate, rules epoch, publication check, save check (T4) | rebuilt, deployed before the app |
|
||
| U7 | yes | no | no | no | no |
|
||
| U8 | no | no | no | no | rebuilt for the final run |
|
||
| Curves lot (out of V1-2.6) | yes | path ops | no | round withdrawal | rebuilt, deployed before the app |
|
||
|
||
## 5. Out of scope, tracked separately
|
||
|
||
- TOTP asked at sign-in for accounts with a factor.
|
||
- The historical equine drawings missing on the sandbox, which block the working copy.
|
||
- Full touch editing on the phone (boards 14 to 16 kept as the reference of that future lot); O14 A stays.
|
||
- A multi-tab notice (not in the validated boards; the server revision check and the conflict dialog already guard
|
||
against lost writes): proposed as a follow-up, decision T14.
|
||
- The curves lot (ex-U9, T16), a prerequisite of any feature that lets a path enter a document.
|
||
|
||
All five are in `.claude/tasks/TODO.md` (V1-2 section); T14 stays a follow-up candidate until the owner answers.
|
||
|
||
## 6. Independent review record (2026-11-05)
|
||
|
||
Three fresh plan challengers, one lens each, on the first version of the five files: correctness CONCERNS(5),
|
||
robustness CONCERNS(9), simplicity CONCERNS(6); no BLOCKER. Integrated:
|
||
|
||
- The U7a/U7b expand-then-write split did not hold (`sheet.empty` writes the keys from the first new sheet) and
|
||
protected no environment: one model sub-step (U6) with the rollback limit stated.
|
||
- M9 dropped: report issues map to the existing `verification.validation.rules` (`verdict.rs:277-296`); the
|
||
round-withdrawal migration of contract §6.4 added to U6 and U9, with a frozen pre-U9 reader oracle.
|
||
- Sub-branches dropped (the gitflow lib branches only from develop): commit in place, rollback by revert.
|
||
- Curves: no document holds a path; U9 proposed for deferral (T16); the size lever becomes a fallback measured op by
|
||
op (T1), the PDF split a separate track.
|
||
- Remap: the seed head drawing has the crop's exact `viewBox`, so the remap is an explicit choice, never automatic;
|
||
returned as a command batch through `commitBatch`; descendant crops and paths refused with closed codes.
|
||
- Pointer and keyboard: second pointer cancels the drag; pending previews cancelled before undo, redo, replacement
|
||
or tab change; toast dismissed on any commit; sliders commit on release; `touch-action` on handle targets; roving
|
||
focus, Backspace, live region; touch tests at 1 024, 1 180 and 1 280 px; handle cap.
|
||
- Sandbox safety: forbidden DEV-reaching SQL commands listed; image checked against `HEAD`; shared sandbox and
|
||
owner-trial stack rules; owner demos on a provisioned demo sheet.
|
||
- Missing UX elements added: board 09 (regions from the vertebra-role category), board 07 « Réaffecter à… »,
|
||
« Couleur d'origine » and staged Apply, the red minimum mark (one core value), removal of the access tool.
|
||
- Corrections of fact: equine names (only `zone-colonne` differs), the ts-rs/N-1 test is an assignability test, the
|
||
N-1 runtime proof needs a New-present fixture, C32 and C33 added to the U0 amendments, the reader-of-user-data
|
||
agreement added to T2.
|
||
- Duplication reduced: one decision table (DECISIONS), one deploy-order statement (COMPATIBILITY §7); T7, T8, T13
|
||
turned into implementer decisions; the multi-tab notice moved to a follow-up (T14); U7 (common text) starts only
|
||
when the wording exists.
|
||
|
||
Not adopted: the simplicity lens recommended `edit.rs` refusals only (T4 option a). The plan keeps report issues
|
||
because they cost no SQL code once mapped to the existing verdict code and keep the core as the authority (O22);
|
||
the owner decides under T4. No second review was run on the corrected version.
|
||
|
||
## 7. Owner answers recorded (2026-11-05)
|
||
|
||
Dated record; the items still open here (T4 SQL checks, T5 defaults, T10 option B) and the T16 count wording were
|
||
answered or refined by the U0 brief and are superseded by §9 and DECISIONS.
|
||
|
||
Brief « FAUNOSTEO — V1-2.6 UX — Ratification des décisions techniques ». The UX choices are not reopened. Changes
|
||
to this plan and its companions:
|
||
|
||
- T11 approved: level-1 trial stopped, level 1 not declared validated, residuals tracked (DECISIONS T11, TODO.md).
|
||
- T16 conditional deferral: audit recorded, path guarantee written, curves lot out of V1-2.6, database count before
|
||
U6 or U8 reaches any environment beyond the throwaway sandbox.
|
||
- T2/T3 agreement in principle with conditions: proof list (COMPATIBILITY §8), one-way compatibility and point of
|
||
no return stated (COMPATIBILITY §0, §7), bounded widening of the snapshot reader, BDR-068 effects.
|
||
- T4 without residual gap: absolute verdict-tier rule replaces the base-relative one; repairable editor rules;
|
||
core gate, declared publication check and functional write lock added; save non-regression check recommended,
|
||
confirmation requested (revised after the second independent review, §8).
|
||
- T5 historical preservation: history untouched, conversion tested on a copy; new-sheet defaults still to ratify.
|
||
- T9 three explicit actions on every replacement; exact same-aspect repositioning only.
|
||
- T10 navigation type: constraints checked; internal navigation category recommended, to confirm; automatic
|
||
access moved to U6.
|
||
- T12 principle kept; U7 blocked until the text, its source and its validation exist.
|
||
- Wasm measuring rule recorded as LRN-118; the decisions as BDR-100.
|
||
|
||
## 8. Second independent review (2026-11-05, after the owner's answers)
|
||
|
||
A fresh correctness challenger on the revised docs: CONCERNS(5) MAJOR and 7 MINOR, all integrated: a declared SQL
|
||
check of the fixed model at approval and publication (a worker defect can no longer publish); editor rules made
|
||
repairable (a role brings its fixed names, repairs for names and duplicate roles, `navigation` never assignable);
|
||
a functional write lock (rules epoch read by the application) and the statement that only SQL-first orders fail
|
||
closed; T9 split into an offer call before the upload and a batch call after it, keep limited to V equal to R,
|
||
premises stated in the dialog, a candidate without `viewBox` refused; withdrawal limited to draft rounds; the
|
||
`category.fixed.*` family filtered by the release replay; the flipped suites listed; single-component rollback
|
||
rows; the save non-regression variant offered under O22. A fresh verifier on the contract
|
||
`.claude/tasks/contracts/2026-11-05-v1-2-6-ux-ratification.md`: ECARTS(2) (tests and cross-references still on the
|
||
older T4 scope, BDR-100 superseded on T4 and T9), fixed, then a targeted re-check (ECARTS(2): one U6 test and the deploy-order line still assumed a permissive save and an all-rounds withdrawal), fixed. A third, independent check
|
||
before the commit (2026-11-05): ECARTS(2) on K10 and K11 (the R-3 mitigation and the U6 objective still on the
|
||
older T4 scope, the write-lock test assuming a stripping save succeeds, two forms of the T16 count scope), fixed,
|
||
then a fresh targeted re-check: CONFORME 12/12, committed at `bd444d6` and `a505b24`.
|
||
|
||
## 9. Owner answers of the U0 brief (2026-11-05)
|
||
|
||
Brief « FAUNOSTEO — V1-2.6 UX — Autorisation U0 uniquement » (BDR-101), then « Finalisation de U0 uniquement »:
|
||
U0 authorised alone; the 16 boards and 11 choices approved for good. Recorded in `V1-2-6_UX_DECISIONS.md` and
|
||
contract §17.12: both T4 SQL checks approved (save; approval and publication), O22 amended strictly for these
|
||
invariants (contract §12.2); T5 new-sheet ids, names and colours from the existing data; T10 option B; T15 wording;
|
||
T16 deferral kept with the path count before any activation of the new model and before U6 or U8 reaches any
|
||
environment beyond the throwaway sandbox; « Remplacer par un polygone » as an
|
||
explicit, validated, undoable replacement; T12 and T17 open (U7 and U6), T1 and T6 unchanged. U0 amended the V1-2
|
||
contract, the level-1 contract, `docs/design/README.md` and the rules `sheet-model.md` and `schemas.md`.
|