bchanot 4d2c64f57f feat(editor): creation on the drawing then the creation dialog
U2 Task 7 (A2, A4, A5, A7, A12, A15; R-3, R-4, R-12, R-13, R-14).
The work store's `creation` owns the new shape, its form, its view and
F: a click with the point tool, a closed tracing or a keyboard
« Ajouter … » opens « Nouveau point / zone / accès », a modal without
a history layer over the right column, mounted beside EditOnly so a
read-only flip keeps it (« Créer », « Replacer », « Reprendre » off).
A new zone or link is a creation from its first vertex. The ghost
takes the form's category colour; the point tool previews under a
mouse; the canvas carries data-creating (other markers dimmed,
unselectable). « Replacer le point » / « Reprendre le tracé » hide the
dialog and keep the form; the strip offers « Revenir aux propriétés »,
« Retirer le dernier sommet », « Abandonner ». « Créer »: one insert,
tool back to « Sélectionner », the new element selected, « Point
créé · Défaire », focus on its row. ✕, Échap, « Abandonner » and Back
always ask « Abandonner la création ? » (DiscardConfirm inside the
dialog; DrawingGuardDialog elsewhere); answerDrawing drops the
creation. Undo, its shortcuts and the line's « Défaire » are inactive
during a creation. missingFields replaces formProblem (MissingSummary
shared with the edit form); the C26 notice has no numbers.
CreationPanel, formProblem, withGeometry and the keys required.fields,
required.names and create_cancel are gone; GeometryGroup is imported
by RepairDialog only.

Removed or rewritten assertions:
- tab « holds a point at the frame centre »: « Centre x » = 50 ->
  the ghost circle cx = 50; plus tool back to Sélectionner, « Point
  créé », one undo step.
- tab « refuses a creation without laterality »: the general line
  « Choisissez la catégorie et la latéralité » -> only « Choisissez
  une latéralité. » and « À compléter : Latéralité. », focus on it.
- tab « applies the geometry group to a pending zone »: removed (A8,
  no coordinate field) -> « places a triangle at the centre: the ghost
  shows it, Créer inserts it »; vertex edits after Créer are the e2e
  keyboard test.
- tab C26 « proposes C »: « x = 15, y = 15 » in the notice -> the R-4
  text, the notice inside the dialog; cancel test « Centre x » = 0 ->
  ghost cx = 0.
- tab « offers the correction when the core refuses a pending point »
  (typed cx 98): removed, no typed coordinate is possible; the verdict
  path stays covered by the C26 click tests and correctionFor units.
- tab H5 « a typed radius shows the core issue »: removed (A8); the
  size refusal is the slider's (Task 4 tests).
- tab H6 « a second click moves the pending point »: -> « Replacer le
  point », then the click moves the ghost, the form kept.
- tab H7 « Centre x/y » = 30/50 -> ghost cx/cy.
- tab tracing Enter: « x du sommet 3 » -> ghost points; « drops the
  tracing on Escape » -> Escape asks first (board 32 row 3), Continuer
  keeps, Abandonner drops; new « Annuler le tracé acts at once ».
- keep-alive « a pending creation is kept and focused » and « a
  tracing … is kept and focused »: the tab now asks first (R-12) ->
  « Continuer » keeps the tracing / the form, « Abandonner » goes.
- sections « its panel takes the focus » -> its dialog's
  [data-creation-focus] takes it.
- no-loss « pending creation with its name » (hidden with the body) ->
  the dialog stays across the crossing, read-only, Créer off (R-14).
- point-edit A5 « Rayon » = 7 / 9 -> ghost r = 7 / 9.
- e2e editor-annotations keyboard test « numeric position » (cx field
  250) -> UX_TESTS Keyboard: zone added, vertex added and removed,
  moved by the move mode, validated, saved. The « Fermer le tracé »
  step runs under expectNoShift again (shortcut removed).
- e2e editor-geometry C26: the proposed x, y read from the notice
  text -> from the overlay's correction circle; the R-4 text checked
  in the dialog.
- e2e editor-deselect « Escape cancels the tracing only » -> Escape
  asks, « Abandonner » cancels it, the selection kept.
- e2e editor-shell-crossing « keeps its tool and its pending
  creation » (field hidden) -> the dialog stays read-only, Créer off,
  then editable on widening.
2026-11-17 23:32:42 +01:00

Faunosteo

Web app for veterinary osteopaths to write session bilans on animal anatomy SVGs — click zones, build observations, export a self-contained PDF with the full report JSON embedded as a native PDF attachment. Re-importing that PDF restores the state for a follow-up.

Multi-species by design. The MVP ships the horse sheet: a canonical anatomical sheet document (drawing + annotations + findings catalog, crates/core/src/domain/sheet) generated and curated under supabase/seed/anatomical-sheets/equine/. Another species is another sheet document, no code change. See docs/development/ANATOMICAL_SHEET_MODEL.md §6 for how a sheet is produced.


Versions: what is public, what is in development

Where What it is
Public, on faunosteo.com: 0.1.0 (2026-05-21) The local tool alone, open to every praticien: a static application with no account, no backend and no central server. The exported PDF is the long-term record.
develop (not released, not deployed) The local tool on the canonical anatomical sheet and Report v3, the PDF archive envelope, the Rust migration R0 to R5 (domain rules, SVG reader, PDF reader and writer, curation pipeline and files worker in crates/), and the SaaS foundations: Supabase schema under RLS, accounts, the /app space, the profile photo.
release/0.2.0 Cut on 2026-10-11 from plan Steps 3 to 6, never finished or deployed; its fate is TODO RR-9.

Available only in a development environment (they need the local Supabase stack, pnpm db:start, and for the photo the worker container; no production Supabase exists and hosting is undecided, docs/development/OPEN_QUESTIONS.md Q2):

  • sign-up with email confirmation, sign-in, password recovery, OAuth buttons behind configuration;
  • the /app space: dashboard and Mon compte (personal, professional, preferences, security sections);
  • the profile photo, processed by the Rust worker;
  • the curated equine sheet DRAFT in the editor, bundled only with SHEET_BUNDLE=draft (pnpm dev, pnpm build:preview): not medically validated, not published; a default build carries no sheet;
  • the anatomical pipeline and archive tools (pnpm import:equine, pnpm assets:upload, pnpm report:compare).

Planned, not implemented (roadmap in docs/development/IMPLEMENTATION_PLAN.md §0): V1-1 clients and animals (its business decisions ratified, technical design awaiting validation), V1-2 sheets served from Supabase, V1-3 bilans stored in the cloud with history, V1-4 stored PDFs and authorised sharing, V1-5 mobile and accessibility pass; then professional verification, cabinets, entitlements, agenda, public site and the rest of the plan. Nothing on develop authorises a release: the release readiness track (TODO RR-1 to RR-10) comes first.


Features

The local tool as it stands on develop. The public 0.1.0 has the canvas, the detail view, the vertebra picker, the findings tree, PDF export and re-import (report v2), the bilingual UI, the configurable identity and the practitioner cache; laterality, the footer branding, Report v3 with the v2 migration, the sheet document and the rescue copy came after it (CHANGELOG Unreleased).

  • Anatomy canvas — inline SVG drawing with markers rendered from the sheet document (hitbox + visible twin, delegated click listener)
  • Observation builder — group zones into clinical observations with severity and free-text notes
  • Hierarchical findings tree — per-zone picker with breadcrumb drill-down through the expert-authored catalog (26 zones for the horse), vet-referral badges on sensitive leaves, scope-disclaimer modal once per session
  • Vertebra picker — region tabs (C/T/L/S/Cd) with multi-select chip grid for precise vertebral notation
  • Detail views — click the head trigger to open the head view (a crop of the same drawing, or a view's own asset)
  • PDF export — A4 portrait with rasterized views, structured observations, and the full Report v3 JSON as a native PDF attachment; older v2 PDFs import through a generated migration map
  • PDF re-import — open a previously exported PDF to restore the session for a follow-up
  • Rescue copy (JSON): when the tab cannot save the report (storage full) or the computation engine stops, "Télécharger une copie" saves the report in progress as a .json file. To restore it, open the home page, "Choisir un fichier", and pick that file: the report reopens in the editor. The copy holds the report only. It does not replace the original PDF, which stays the archive of record for past reports (the frozen sheet snapshot, logos and labels it was produced with).
  • Bilingual UI — full FR/EN interface with a one-click language switcher; default locale auto-detected from the browser, then persisted
  • Configurable identity — site name, brand, footer, tagline all come from env vars; nothing hardcoded
  • Practitioner cache — last-used practitioner block prefilled via localStorage
  • Laterality — left/right side selection on bilateral zones, reflected in badges and the PDF
  • Footer branding — global footer (copyright, "Powered by ZenQuality", partner logo), on site + PDF

Stack

  • Node.js 24 LTS + pnpm 10.13 (corepack)
  • React 19 + TypeScript 5 (strict)
  • Vite 7 + @vitejs/plugin-react-swc
  • Tailwind CSS v4 (CSS-first, no postcss config)
  • Zustand 5 (state)
  • Zod 3 (schema + runtime validation)
  • PDF reader and writer in the Rust core (crates/core/src/pdf, WebAssembly in the app; no pdf-lib since R4.8)
  • motion 11 (animations)
  • vitest 3 + happy-dom + @testing-library/react
  • Supabase (PostgreSQL 17, Auth, RLS) via the pinned CLI; @supabase/supabase-js 2; PGlite for Dockerless SQL tests

Quick start (dev)

Single process, no Docker:

# Node 24 (see .nvmrc) + pnpm 10.13.1 via corepack, no global install:
corepack enable

pnpm install
cp .env.example .env   # edit APP_* vars if desired
pnpm dev               # http://<FAUNOSTEO_DEV_HOST>:5173 (the DEV origin, never localhost)

Development server on the private network (the DEV origin is the machine's LAN address, scripts/dev-env.sh): pnpm db:start, then pnpm dev and open http://<lan-address>:5173 from any device of the network; Mailpit for the sign-up mails through the DEV gateway on :54325 behind basic auth, pnpm dev:gateway (docs/development/ENVIRONMENTS.md).

Rust (core, browser module, worker): a user-level rustup installs the pinned toolchain from rust-toolchain.toml on first use; see docs/development/RUST.md §1 for the three cargo install / rustup target add lines and the Docker alternative. The files worker (profile photos, Step 8) runs as a container beside the local Supabase stack: pnpm worker:image, then pnpm e2e:avatar (= pnpm db:sandbox avatar-e2e) for the real-stack end-to-end run on the throwaway stack, or docker compose --profile worker up worker with a .env.worker (docs/development/STORAGE.md).

Docker Compose (matches production topology):

cp .env.example .env   # set APP_* identity vars
docker compose up --build
# app at http://localhost:8080

Verifying a change

pnpm typecheck    # TypeScript strict, no emit
pnpm lint         # ESLint 9 flat config, 0 warnings
pnpm test:run     # vitest run (core-wasm, supabase/PGlite, app)
pnpm build        # tsc + vite build → apps/app/dist/
pnpm report:compare <pdf|dir>...   # archive PDF vs its v3 reading, unresolved items flagged (the core's binary; first run compiles)
pnpm rust:check   # native: fmt, clippy -D warnings, cargo test, ts-rs export, cargo deny
pnpm wasm:build   # native: browser module → packages/core-wasm/pkg (the core-wasm proofs run on it)
pnpm check:all    # everything a branch must pass before a merge, in one command (needs Docker for the image stages)

No CI/CD runs on the forge yet: the workflow files under .gitea/workflows/ are prepared for a future runner and call these same scripts.


Build & deploy

pnpm build                  # production build → apps/app/dist/
docker build -t faunosteo .   # multi-stage Docker image
docker compose up --build   # run with env_file: .env

For production deployment (VPS provisioning, firewall, TLS, nginx reverse proxy, backups, hardening) — see DEPLOY.md. It describes the static 0.1.0 deployment; read its status notice before deploying anything built from develop.


Documentation


Project layout

faunosteo/                  pnpm workspace (see docs/development/WORKSPACE.md)
├─ apps/app/                the private application (@faunosteo/app):
├─ vite/sheet-bundle.ts     Vite plugin bundling the reference sheet (SHEET_BUNDLE=draft|none)
├─ src/app/                 routes + ConfigProvider
├─ src/config/              runtime env config resolution
├─ src/sheets/              SheetProvider (bundled implementation) + useSheet hook
├─ src/services/            sheet index (lookups by id) + zone interaction service (pure)
├─ src/i18n/                translation dicts (fr/en) + useT() hook
├─ src/state/               Zustand store (Report v3) + persistence adapter + locale store
├─ src/anatomy/             drawing: sanitised asset + annotation layer → inline SVG per view
├─ src/components/          UI primitives, canvas, observation, report
├─ src/pdf/                 app side of the PDF: snapshot + branding + labels + browser rasterizer → the core's export session
├─ src/lib/                 id, dates, assert utilities
├─ src/styles/              Tailwind v4 CSS + design tokens
├─ tests/unit/              vitest tests on the bundled sheet (+ frozen v2 fixtures)
├─ packages/core-wasm/      @faunosteo/core-wasm: the Rust core in the browser (runtime, generated types, frozen N-1 reader)
├─ crates/                  Rust: core (contracts, rules, SVG, PDF, anatomical pipeline), wasm facade, worker
├─ packages/supabase/       @faunosteo/supabase: typed client, generated types, PGlite SQL test harness
├─ supabase/                CLI config, SQL migrations, local seed (incl. the equine sheet), pgTAP tests
├─ docker/                  entrypoint.sh + nginx.conf
├─ docs/                    conventions, sheet model, PDF spec, development plan
└─ index.html               SPA entry point

Status

Public: 0.1.0 (2026-05-21), the local tool with no backend. develop: plan Steps 0 to 8 and the Rust migration R0 to R5, merged, not released. The merge gate is pnpm check:all (see "Verifying a change"); no CI runs on the forge.

The first species ships as the equine anatomical sheet: the historical Horse.svg, Horse_head.svg and findings catalog (26 zones, 792 nodes) imported, then audited and curated (supabase/seed/anatomical-sheets/equine/, 45 traced changes, 48 references). The application bundles that curated draft in development (SHEET_BUNDLE=draft); it is not medically validated and a production build carries no sheet unless asked. Another species is another sheet document produced the same way.

Manual QA checklist: .claude/audits/MVP-QA.md — walk it through pnpm dev before delivery.

License: MIT.

S
Languages
TypeScript 78.6%
HTML 14.6%
CSS 3.7%
JavaScript 2.2%
Shell 0.7%
Other 0.2%