Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RNaYKPEkjH1jbgoX1TwKMX
171 lines
9.5 KiB
Markdown
171 lines
9.5 KiB
Markdown
# TODO — Osteo Report MVP
|
|
|
|
## Status (2026-05-21): catalog v2.0 + full 26-zone horse coverage in place — B4 polish + ship gate next
|
|
|
|
Domain pivot bundle (B0 schema, B1 report v2, B2 UI/PDF, B3 i18n) shipped on
|
|
`feat/findings-tree-v2`. Catalog upgraded v1.2→v2.0 by domain expert: 26 zones
|
|
(was 3), 792 nodes, 612 leaves, 41 vet-referral leaves. Zero code change needed
|
|
— schema was forward-compat since B0 (BDR-016, LRN-020).
|
|
|
|
154/154 tests green, lint 0, typecheck clean, vite build OK.
|
|
|
|
---
|
|
|
|
## DONE since 2026-05-21 (main +41 commits — the frozen Status block above is the 2026-05-21 snapshot)
|
|
|
|
Current main @ 4991c10: 174/174 tests green (30 files), lint 0, typecheck clean, vite build OK.
|
|
feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work below landed on main. No git tags yet (see CHANGELOG version note).
|
|
|
|
### Laterality + bilaterality
|
|
- [x] LateralSideSchema (left/right) + Bone.lateral; data-anno-lateral parsed from SVG (e0abb1e, db50c67)
|
|
- [x] LateralityPicker modal + zone-click integration; side in zone badges + PDF labels (20d60b9, 5a19ae1, 3323d4e, 773b002)
|
|
- [x] Bilateral zones: separate findings picker per side (c853c68, 0c170bd)
|
|
|
|
### Editors
|
|
- [x] SVG anatomy editor at /svg-editor — vanilla JS tool wrapped in React (ea81d8c, BDR-017)
|
|
- [x] Standalone public/pathology-editor.html JSON tree editor (9cca51c, BDR-020/021/022)
|
|
- [x] Tabbed welcome screen with project SVG picker (2273602)
|
|
- [x] /editors listing page + footer links + locale-aware zone hover tooltip (5e24c2f, 569e571)
|
|
|
|
### Branding + UI
|
|
- [x] Global footer: copyright + "Powered by ZenQuality" + "Paws in Harmony" logo, site + PDF (caac149, 3a67da7, d9cf2fa, 33a7f47)
|
|
- [x] Unified AppHeader (logo brand + tagline) across routes (1f30280)
|
|
- [x] Responsive mobile — full phone/tablet adaptation (a73d8da)
|
|
- [x] Project renamed Zoosteo → Faunosteo across the codebase (2d6ed80)
|
|
|
|
### Infra
|
|
- [x] Docker: no-cache header for species assets (53f62f7)
|
|
- [x] pathology-editor.html prod 404 fixed — served from public/ so it ships to dist (2803cf7, LRN-029)
|
|
- [x] gitflow socle + pre-commit hook adopted (4991c10)
|
|
|
|
---
|
|
|
|
## Phase A — DONE (kept for reference)
|
|
|
|
- [x] Scaffold (deps, configs, Docker, schemas, stubs)
|
|
- [x] Lib: id, dates, assert
|
|
- [x] Anatomy: parseSvgBones, loadSvg, svgToPng raster
|
|
- [x] Zustand store: full action set (initReport, hydrateReport, observation CRUD,
|
|
conclusion/recommendations/nextAppointment setters, identity setters)
|
|
- [x] sessionStorage draft mirror + localStorage practitioner cache
|
|
- [x] UI primitives: Button, Card, Dialog, Input, Label, Select, Textarea, Badge, Chip
|
|
- [x] Canvas: AnatomyCanvas (data-state highlighting, async-mount safe), DetailModal
|
|
- [x] Observation chain: ObservationList, ObservationCard, PathologyPicker (flat — REMOVED, replaced by FindingsTreePicker B2),
|
|
VertebraPicker, SeveritySelector, FreeTextPathologyInput
|
|
- [x] Report forms + edit-infos dialog + home nav
|
|
- [x] Routes: Home, NewReport, Editor (split layout + dialog), NotFound
|
|
- [x] PDF pipeline: fonts, header, observationPage (2-col SVG grid),
|
|
conclusionPage, attachment.ts, export, import
|
|
- [x] Docker: Dockerfile, compose, entrypoint.sh runtime env, nginx SPA fallback
|
|
- [x] Brand identity via env (ConfigProvider)
|
|
- [x] Tests: 100/100 pass
|
|
- [x] **Pathology JSON sample dropped** at `src/domain/species/equine/pathologies.json`
|
|
(schema v1.1, 3 zones: sphenoid/ssb/atm — placeholder before full-body)
|
|
|
|
---
|
|
|
|
## Phase B — V1 REFACTOR (hierarchical findings + i18n)
|
|
|
|
### B0. Domain model — Findings tree (DONE 2026-05-20)
|
|
|
|
- [x] **Schema**: `src/domain/schema/findings.ts` — `FindingNodeSchema` (recursive via `z.lazy`), `ZoneFindingsSchema`, `SpeciesFindingsSchema`, `SourceRefSchema`
|
|
- [x] **Loader**: `src/domain/species/equine/pathologies.ts` parses the JSON via `SpeciesFindingsSchema.parse(data)` at boot (fail-fast)
|
|
- [x] **Species manifest**: `findings: FindingsLoader` replaces `pathologies` in `SpeciesManifest`
|
|
- [x] **JSON fix**: `species.id` set to `"equine"` to match registry
|
|
- [x] **Tests**: `tests/unit/species.equineFindings.test.ts` (5 cases) replaces deleted `species.equinePathologies.test.ts`
|
|
|
|
### B1. Report schema v2 — observation findings (DONE 2026-05-20)
|
|
|
|
- [x] `ObservationSchema` carries `findings: Finding[]` + `freeTextFindings: string[]`; old `pathologyIds`/`freeTextPathologies` removed
|
|
- [x] `ReportSchema.version` literal bumped `1` → `2`
|
|
- [x] Store `emptyObservation` + `initReport` updated to the v2 shape
|
|
- [x] PDF import surfaces a distinct French-language `IncompatibleReportVersionError` message on v1 attachments (detected before Zod parse)
|
|
- [x] Schema + store + PDF tests updated; `pathology.ts` schema + test deleted
|
|
|
|
### B2. UI — Findings tree picker (DONE 2026-05-20)
|
|
|
|
- [x] `src/components/observation/FindingsTreePicker.tsx` (breadcrumb, drill-down, leaf toggle, retour button, vet-referral ⚠ badge, description_fr surfacing)
|
|
- [x] `scope_disclaimer` modal shown once per session via `osteo:disclaimer-shown` sessionStorage flag
|
|
- [x] `ObservationCard` migrated — one picker per zone with a catalog entry, single `FreeTextFindingInput` below
|
|
- [x] `PathologyPicker` + `FreeTextPathologyInput` + their tests deleted; `FreeTextFindingInput` renamed equivalent kept
|
|
- [x] `tests/unit/components.FindingsTreePicker.test.tsx` covers navigation, leaf select, vet-referral flag, retour, deselect
|
|
|
|
### B3. i18n FR/EN — site + PDF (DONE 2026-05-20)
|
|
|
|
- [x] **Locale state**: `src/state/localeStore.ts` Zustand `'fr' | 'en'`, persisted `osteo:locale`
|
|
- [x] **i18n dicts**: `src/i18n/{fr,en}.ts` (~90 keys each, parity-tested), `index.ts`, `useT.ts` hook
|
|
- [x] **Language switcher**: `src/components/brand/LanguageSwitcher.tsx` segmented FR | EN toggle, integrated in ReportHeader + HomeRoute + NewReportRoute headers
|
|
- [x] **Findings rendering**: FindingsTreePicker + ObservationCard read `name_fr`/`name_en` per locale; finding snapshots already dual (BDR-010)
|
|
- [x] **PDF render**: `exportReportToPdf(report, { locale })` explicit option; static labels via dict snapshot; `formatDate(iso, locale)` replaces `formatDateFr`; finding leaf labels via `labelFr/EnSnapshot`
|
|
- [x] **PDF import error i18n**: typed ImportError(kind + foundVersion); UI resolves message via dict (BDR-015) — caught by review (EVAL-002)
|
|
- [x] **Out of scope (per design)**: `description_fr` + `scope_disclaimer` stay FR-only — vet-expert authoring needed for EN copy
|
|
- [x] **Tests**: localeStore (3), useT (3), dict parity (2), LanguageSwitcher (2), formatDate FR+EN (7), PDF roundtrip per locale (3). 154/154 green.
|
|
|
|
### B4. PDF observationPage updates
|
|
|
|
- [x] Render `findings` instead of `pathologyIds` (per-zone sections "CONSTATS — <ZONE>" + "CONSTATS LIBRES", joined `·` segmented)
|
|
- [x] Show vet-referral icon (⚠) next to flagged findings (observationPage.ts:407)
|
|
- [ ] `scope_disclaimer` footer on each obs page or first page only — decide
|
|
- [x] Update `LRN-009`-style layout still applies (text-area reservation kept)
|
|
|
|
### B5. Stub cleanup (DONE 2026-05-20)
|
|
|
|
- [x] `ZoneTooltip.tsx` deleted (unused stub)
|
|
- [x] `Toast.tsx` deleted (unused stub — re-introduce later if notifications needed)
|
|
- [x] CLAUDE.md folder map updated — `ObservationEditor`/`Toast`/`ZoneTooltip` removed, `FindingsTreePicker`/`FreeTextFindingInput`/`findings.ts` added
|
|
|
|
---
|
|
|
|
## Phase C — V1 SHIP gate
|
|
|
|
- [x] Author full `horse.json` (placeholder → v2.0, 26 zones, 792 nodes, 612 leaves — done 2026-05-21)
|
|
- [x] Fix SVG case `data-anno-name-fr="hyoïde"` → `"Hyoïde"` in `public/species/equine/Horse_head.svg` (done by user 2026-05-21; 26 JSON names ≡ 26 SVG names strict)
|
|
- [ ] PDF QA manual pass: full flow → export → re-import roundtrip
|
|
- Fonts embed, JSON attached, multi-SVG grid OK, locale FR + EN exports
|
|
- [x] Docker build + compose up smoke test (VPS cold build validated — BLK-005, 990c8e7; local smoke not separately logged)
|
|
- [ ] env-var brand identity verified
|
|
- [x] README finalize (install, dev, Docker, env vars, locale, MIT)
|
|
- [x] CHANGELOG 0.1.0 entry
|
|
- [x] docs/PATHOLOGIES-FORMAT.md — schema doc + authoring guide (initial shipped 70f21cc 2026-05-20; refreshed for v2.0 boolean-only contract 2026-05-21 — scope section, 5 taxonomy patterns, structural rules, breaking-change notice, horse stats, changelog v1.0→v2.0)
|
|
- [x] Scaleway VPS deploy (TLS + live faunosteo.com — 2803cf7 fixed prod 404). CI build/push/deploy UNVERIFIED — no .github/workflows or Gitea CI in repo.
|
|
|
|
---
|
|
|
|
## Phase D — POST-V1 (not in MVP scope)
|
|
|
|
- Capacitor wrap (iOS + Android)
|
|
- Accounts + cloud sync (Supabase or self-host)
|
|
- Multi-praticien (move localStorage cache to server profile)
|
|
- RDV booking + push reminders
|
|
- Other species (dog, cat, cow, goat, pig, chicken JSONs)
|
|
- Pathology DB community contributions
|
|
|
|
---
|
|
|
|
## Memory cross-refs
|
|
|
|
- BDR-001..BDR-008 — decisions registry
|
|
- LRN-001..LRN-010 — learnings registry
|
|
- BLK-001..BLK-004 — blockers (all resolved)
|
|
|
|
Apply when implementing B-phase:
|
|
- LRN-004 (data-anno-special opaque to parser) — zone IDs in JSON must match SVG `data-anno-id`
|
|
- LRN-009 (pre-rasterize → reserve → grid) — keep applied in PDF observationPage
|
|
- LRN-010 (gate DOM-mutate on async-mount) — relevant for any new SVG-mutating effect
|
|
|
|
---
|
|
|
|
## Estimated effort
|
|
|
|
| Phase | Hours |
|
|
|---|---|
|
|
| B0. Findings schema + loader + tests | 3 |
|
|
| B1. ReportSchema v2 + store + PDF import | 3 |
|
|
| B2. FindingsTreePicker + disclaimer + integration | 6 |
|
|
| B3. i18n FR/EN site + PDF | 5 |
|
|
| B4. PDF observationPage update | 2 |
|
|
| B5. Stub cleanup | 0.5 |
|
|
| C. Full horse.json authoring (user) | external |
|
|
| C. QA + docs + deploy | 4 |
|
|
| **Total dev** | **~23h** |
|