Remove h1 heading from editors page, use same centered grid layout
as home page — cards vertically and horizontally centered in viewport.
Co-Authored-By: Claude <noreply@anthropic.com>
Replaced min-h-screen with h-full on both routes — App.tsx flex layout
already provides min-h-screen + flex-1, so the inner min-h-screen was
doubling the minimum height and pushing the footer off-screen.
Co-Authored-By: Claude <noreply@anthropic.com>
Header with brand link + FR/EN segmented toggle reading/writing
osteo:locale localStorage key. 76 translation keys covering all
UI strings. View state tracked for re-render on locale switch.
Co-Authored-By: Claude <noreply@anthropic.com>
Compact header (Brand + LanguageSwitcher) above the SVG editor.
All 58 hardcoded strings in JSX template and vanilla JS replaced with
t() calls via TFn passed to initSvgEditor. Editor re-inits on locale
change. CSS drop overlay uses data-drop-label attr for translated text.
Co-Authored-By: Claude <noreply@anthropic.com>
New /editors route listing SVG editor and pathology editor with
descriptions and CTAs. Footer gains Éditeurs link, Paws iin Harmony
credit, and pipe-separated layout. 69 i18n keys added (editors.*,
footer.*, svg_editor.*) in both FR and EN dicts.
Co-Authored-By: Claude <noreply@anthropic.com>
Custom floating tooltip replaces native SVG <title> — follows cursor,
shows zone name in active locale (FR/EN), dark pill style with 120ms
fade. getAnnotatedElement() helper added to svgConvention.ts.
Co-Authored-By: Claude <noreply@anthropic.com>
Add pathology-editor.html to folder structure, specs listing, and
README feature list.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Standalone HTML page for editing species pathology JSON via SVG-based
zone selection. Supports pre-wired species list and manual SVG+JSON
upload. Features fuzzy zone matching (ported from zoneMatch.ts),
recursive tree editor with full CRUD, auto ID generation, and safe
JSON export preserving all zones and root fields.
Includes SVG sanitization (script/foreignObject/on* stripping),
unsaved changes protection, and French error messages.
Also copies pathologies.json to public/ for HTTP access from the editor.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract AppShell with useLocation to conditionally hide Footer on
/svg-editor. Add max-height: 100% + width: auto to SVG canvas CSS
so loaded SVGs fill available space without overflowing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wrap standalone vanilla JS SVG annotation editor (~1630 lines) into
React via useRef+useEffect. CSS restyled to Zoosteo design tokens.
Route registered at /svg-editor with noindex meta tag and back-to-home
link. DOMParser used for safe SVG file loading. Zero behavior loss
from original editor.html.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previous 16px / 180ms transition was barely visible on a 360-420px
wide mobile viewport. Adjustments:
- Slide distance 16px → 32px so the off-position is clearly off-axis
on small screens.
- Duration 180ms → 220ms — slightly longer keeps the slide visible
through the iOS/Android touch-event paint cycle.
- Hint with willChange: 'transform, opacity' so mobile Safari
promotes the ul to its own compositor layer up front, avoiding a
first-frame flicker on weaker GPUs.
No behavioural change to direction logic; tests still 155/155.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Opening a finding category (e.g. "Dysfonction ostéopathique") and
backing out felt abrupt — list content swapped instantly with no
visual continuity. Now the list animates a short slide+fade between
levels:
- Drill down → new list enters from the right (+16px → 0).
- Back / breadcrumb up → new list enters from the left (-16px → 0).
Implementation:
- Wrap the list in `motion.ul` keyed by the path string so React
remounts when the level changes; motion's `initial`/`animate`
variants then play on every remount.
- A direction state (1 | -1) feeds the `enter` variant via `custom`
so forward vs. back have opposite slide directions.
- All path mutations go through `goInto` / `goBack` / `goToDepth`
helpers that set direction before calling `setPath`.
- 180ms ease-out — perceptible but does not block interaction.
AnimatePresence was deliberately omitted: it defers DOM swap, which
broke the existing synchronous `getByLabelText` assertions in
components.FindingsTreePicker.test.tsx. The key-based remount keeps
the new content reachable immediately while still providing a
direction-aware entrance.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Navigating to /editor (either from /new or by re-importing a PDF)
landed the user at the bottom of the page because the browser
restored its previous scroll position on a long route. Force a
one-shot scroll to (0,0) on mount with an empty-deps effect so the
report opens at the header.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Make the header consistent across Home, New report, and Editor:
- Tagline (cfg.tagline) now sits next to the brand on the left for
every page, instead of right-aligned on Home only.
- LanguageSwitcher moved to the far right of the action group on
every page (previously sandwiched between brand and report info on
Editor).
- Dropped the redundant "← Accueil" ghost button on New report and
Editor headers; the brand itself is already a link to "/", so two
controls were doing the same job. Aria label preserved on the
brand link.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`listen ${PORT:-8080};` in docker/nginx.conf used bash-style default
expansion. envsubst (GNU gettext) does not implement `:-default`; it
either leaves the token literal or substitutes only `${PORT}` and
keeps `:-8080`, producing `listen 8080:-8080;`. Either way nginx
errors with "invalid port in '${PORT:-8080}' of the listen
directive" and the container restart-loops.
entrypoint.sh already exports PORT with a bash default
(`PORT="${PORT:-8080}"`) before calling envsubst, so the template
only needs `${PORT}`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Docker Compose v2 always appends a replica index (-1) to container
names by default. Single-instance service doesn't need scaling →
pin container_name for stable references in scripts and docs.
DEPLOY.md log-prune command updated to match.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Initial hypothesis ("pnpm@latest pulled a newer 11.4+ with new Node
floor") was wrong. Investigation after the second VPS crash showed
the whole pnpm 11.0+ line imports node:sqlite from its store-index
module. Local dev was misleading because pnpm install never re-ran
on the Node 20 host (lockfile already resolved, child scripts don't
load the store module).
Updates:
- BLK-005: replace single-fix line with iteration log
(@latest → @11.1.3 → @10.13.1, last one resolved).
- LRN-022: rewrite headline + body to reflect pnpm 11 ↔ Node 22.13
coupling, not just pnpm 11.4. Add pnpm/Node compat matrix.
- journal 2026-05-21: append v2 fix entry referencing commit 990c8e7.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Prior pin pnpm@11.1.3 was insufficient — pnpm 11.x itself imports
`node:sqlite` and requires Node 22.13+, not just 11.4 as the previous
blocker entry assumed. Local builds passed only because no `pnpm
install` ran on Node 20 (lockfile already resolved). VPS cold build
still crashes `ERR_UNKNOWN_BUILTIN_MODULE: node:sqlite`.
Switch to pnpm 10.13.1 — already cached on the dev host via corepack,
last major before the node:sqlite cache backend, reads lockfile v9.0
unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- BLK-005: VPS Docker build crash on pnpm@latest pulling pnpm >=11.4
needing Node 22.13 (node:sqlite import) against node:20-alpine image.
Resolved by pinning pnpm@11.1.3.
- LRN-022: never use floating pnpm@latest (or any unpinned upstream
tag) in Dockerfiles — pnpm minor bumps can silently raise Node floor.
Fix paths: pin exact + mirror in packageManager field; audit CI too.
- journal 2026-05-21: two lines for the rename commit and the Docker
pin commit.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`corepack prepare pnpm@latest` now resolves to pnpm >=11.4, which
imports `node:sqlite` and requires Node 22.13+. The builder stage
runs `node:20-alpine`, so the install crashes with
`ERR_UNKNOWN_BUILTIN_MODULE: node:sqlite`. Pinning to the same
version the host already uses (pnpm 11.1.3) restores a reproducible,
Node-20-safe build.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Remote moved to git.bchanot.fr/bchanot/zoosteo.git; brand strings
and production URL updated to match new identity.
- package.json: name → zoosteo
- src/config/env.ts: AppConfig DEFAULTS → "Zoosteo"
- docker/entrypoint.sh: APP_*_NAME fallbacks → "Zoosteo"
- src/i18n/{fr,en}.ts: import error message + PDF title prefix
- src/pdf/attachment.ts: embedded description metadata "state v2"
- index.html: <title> fallback
- scripts/scaffold-species.mjs: console banner
- tests/unit/components.Brand.test.tsx: regex
- README.md, CLAUDE.md, CHANGELOG.md, docs/ADDING-A-SPECIES.md:
brand headings + intro lines
- DEPLOY.md: env defaults table + osteo.example.com → zoosteo.fr
(clone URL, paths, certbot, curl, container name references)
PDF attachment FILENAME 'osteo-report.json' and the startsWith
contract in src/pdf/attachment.ts:35,40 are preserved — changing
them would break PDF import for every PDF already exported by the
app. docs/superpowers/** and .claude/audits/** left unchanged as
historical records.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
First versioned changelog for the project. v1.0.0 entry covers the
shipped state on master at this commit: scaffold + B0..B3 (findings
schema, Report v2, FindingsTreePicker, i18n FR/EN), catalog v2.0
adoption, WinAnsi PDF hotfix, docs refresh, branch rename main →
master, push to https://git.bchanot.fr/bchanot/osteo-report.git.
Added / Changed / Fixed sections + Known limitations + a "Pre-1.0
milestones" appendix referencing git history for the un-tagged
scaffold / editor-polish / findings-tree-pivot / catalog-v2.0
sessions.
Note: package.json `version` field is still 0.1.0 — bump to 1.0.0
deliberately deferred until you're ready to tag the release on the
Gitea remote.
- LRN-021: pdf-lib StandardFonts use WinAnsi (cp1252) — any non-Latin-1
codepoint throws on measure or draw. Fix paths: ASCII surrogate
(quick) or embed TTF via pdfDoc.embedFont (right). CLAUDE.md spec
prescribed TTF; current StandardFonts is a documented drift.
- EVAL-003: bug slipped past 154/154 CI because roundtrip tests had no
observation with a requires_vet_referral leaf. Regression test now
measures a prefixed label via widthOfTextAtSize to canary any future
non-WinAnsi marker reintroduction.
- journal 2026-05-21 appended with the hotfix note and the
TTF-migration follow-up.
Root cause: src/pdf/fonts.ts embeds StandardFonts.Helvetica /
HelveticaBold / TimesRoman, which use WinAnsi encoding (Latin-1
only). PDF export threw `WinAnsi cannot encode "⚠" (0x26a0)` the
moment the text-height estimator measured a vet-flagged leaf
label (countSegmentedLines → widthOfTextAtSize).
Fix: replace the PDF prefix "⚠ " with WinAnsi-safe "(!) ". The
picker DOM keeps the original "⚠" since browsers render U+26A0
natively — the limitation is purely on the PDF side.
Regression test exercises embedFonts + widthOfTextAtSize on a
realistic prefixed label; would catch any future non-WinAnsi
marker re-introduction.
Follow-up (not in scope): switch the PDF body to embedded TTF
(Inter / Fraunces per CLAUDE.md spec) so the catalog can carry
arbitrary glyphs. CLAUDE.md states TTFs should be used; current
StandardFonts is a drift from intent.
155/155 tests green, typecheck clean.
- schema_version "2.0" everywhere; new Changelog section with
v1.0 → v2.0 entries highlighting the breaking change.
- New Scope (legal périmètre) section listing inclusions / exclusions
and the two flag mechanisms (root scope_disclaimer + leaf boolean).
- Clarified SVG ↔ JSON link via strict label equality (not data-anno-id)
and cranio-caudal zone ordering rule.
- Documented the 3 standardized categories per zone
(*-dysfunctions / *-observations / anamnesis) and the 5 dysfunctions
taxonomy patterns (head SSB / head peripheral / articular /
vertebral hinge / vertebral region).
- Documented structural authoring rules (depth ≤ 4, ≥ 2 children per
intermediate, sibling-scoped ID uniqueness).
- Spelled out the v2.0 requires_vet_referral / description_fr policy
(boolean = source of truth; description_fr survives only on
differential leaves) and the breaking-change notice for any consumer
relying on description_fr.includes('vétérinaire').
- Rewrote the minimal example using v2.0 contract (boolean only,
description_fr only when it adds a differential).
- Noted Zod's silent strip of unknown fields (e.g. species.notes,
per-leaf metadata).
- Added current horse.json stats table (26 zones / 792 nodes /
612 leaves / 41 vet leaves).
Catalog bumped v1.2 → v2.0 by domain expert.
- schema_version "2.0"; 26 zones (9 head + 17 body), 792 nodes,
612 leaves, 41 requires_vet_referral leaves.
- requires_vet_referral becomes the sole source of truth for the
vet-orientation flag. Generic "orienter vers vétérinaire" wording
purged from description_fr on 25 leaves; the 16 leaves carrying a
clinical differential keep their description_fr.
- Existing Zod schema (findings.ts) and consumers (FindingsTreePicker,
PDF observationPage) already key off the boolean — zero code change
required.
- Aligns SVG Horse_head.svg "hyoïde" → "Hyoïde" so all 26
data-anno-name-fr / -en values match zone.name_fr / name_en
strictly (v2.0 authoring rule prescribes exact equality;
src/lib/zoneMatch.ts fuzzy fallback retained as safety net).
154/154 tests green, typecheck clean.
- localeStore.readInitial now consults navigator.language(s) when
localStorage is empty (first fr/en hit, FR fallback). Persisted user
choice still wins.
- New helper src/anatomy/labels.ts (boneLabel(b, locale, fallback))
with cross-language fallback so missing labels never render blank.
- AnatomyCanvas rewrites native SVG <title> tooltips per locale on
mount and on locale change (upstream SVG ships titles as "FR / EN"
concat; we replace with the active-locale label only). Detail-popup
trigger titles ("🔍 Zoom: …") left intact.
- DetailModal + EditorRoute detail title prefix + vertebra picker
title now route through useT()/boneLabel.
- ObservationCard.describeZone takes locale, picks bone.fr / bone.en.
- PDF: buildZoneLabels returns Map<id, { fr, en }> instead of FR-only;
observationPage picks per locale with cross-language fallback.
- Tests: FindingsTreePicker + VertebraPicker reset locale to 'fr' in
beforeEach (navigator-detect may land on EN in happy-dom).
- pdf.zoneLabels test updated to assert the new pair shape.
154/154 tests pass, lint clean, typecheck clean, build OK.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Review surfaced 3 critical paths where hardcoded French leaked into
the EN UI:
- src/pdf/import.ts ImportError default message
- src/pdf/attachment.ts IncompatibleReportVersionError message
- src/app/routes/HomeRoute.tsx propagated err.message verbatim
Refactor:
- ImportError carries a typed `kind` discriminant
('invalid_pdf' | 'incompatible_version' | 'no_attachment') plus
optional `foundVersion`. Removes hardcoded localized strings.
- IncompatibleReportVersionError keeps `foundVersion` only; message
collapses to an internal sentinel.
- HomeRoute resolves the user-facing message via the active i18n
dict using `err.kind`, with `{version}` template substitution for
the incompatible-version case.
- 3 new dict keys (fr+en): home.import.error_invalid_pdf,
home.import.error_no_attachment, home.import.error_incompatible_version
- pdf.roundtrip v1 case asserts ImportError instance + kind +
foundVersion instead of grepping the message text.
154/154 tests pass, lint clean, typecheck clean, build OK.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
3 new cases:
- exports with locale=fr roundtrips
- exports with locale=en roundtrips
- both produce non-empty byte streams and the imported JSON payloads
match (locale lives outside the Report, so finding labelFr/EnSnapshot
are byte-identical between exports — only the static dict labels
rendered into the PDF differ, verified manually since pdf-lib font
subsets make byte-grep unreliable per LRN-016)
154/154 tests pass.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
12 tasks, TDD per task, file paths + full code shape + verification.
Locale store + dicts + useT separate green commits; PDF + route
migrations land as one atomic green-build commit (formatDate +
exportReportToPdf signature change cross the boundary).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Capture the second-session findings-tree iteration learnings before
they fade:
Decisions
- BDR-012 species auto-discovery via Vite import.meta.glob default-export
contract (alternatives: hardcoded registry, runtime registerSpecies()).
- BDR-013 SVG↔JSON zone bridge via fuzzy FR/EN label match (alternatives:
rename SVG ids, add new data-anno-finding-zone attribute).
Learnings
- LRN-013 import.meta.glob + default-export as a plugin-discovery pattern.
- LRN-014 normalize + Levenshtein recipe for human-string cross-walk.
- LRN-015 per-source try/catch beats wrapping a loop with one outer catch.
- LRN-016 pdf-lib subset-font output: latin1/utf-8 bytes-grep won't find
user-visible text — extract the JSON attachment or test through a
refactored helper instead.
Journal
- Logs the 11 commits between b7b0945 and 70f21cc with one-line summaries
+ cross-refs to the new registry entries.
Co-Authored-By: Claude <noreply@anthropic.com>
Documents the canonical pathologies.json shape next to the existing
ANATOMY-SVG-CONVENTION and PDF-FORMAT guides. Mirrors the Zod
contract in src/domain/schema/findings.ts:
- Top-level frame (schema_version, scope_disclaimer, species, zones).
- ZoneFindings shape and how name_fr/name_en bridge to SVG labels.
- Recursive FindingNode (leaf vs intermediate, optional description,
vet-referral flag, sources).
- SourceRef enum + URL validation.
- A minimal worked example.
- How leaf selections become persisted Findings, with the labelFr/En
snapshot contract that protects already-exported reports from
retroactive catalog edits.
- Authoring workflow that defers to `pnpm scaffold:species` and Vite
HMR-driven validation.
Co-Authored-By: Claude <noreply@anthropic.com>
Registry
--------
src/domain/species/registry.ts previously hard-coded the species list,
which meant adding a new animal forced an edit in two places. The
registry now uses Vite's `import.meta.glob('./*/index.ts', { eager: true })`
and registers every manifest that default-exports a SpeciesManifest.
Duplicate ids log a warn and the first wins. Existing named imports
keep working — equine/index.ts adds `export default equine` next to the
named export.
The species dropdown is also now sorted alphabetically by labelFr (FR
locale) instead of insertion order, so two species don't shuffle
position based on glob ordering.
Scaffold script
---------------
`pnpm scaffold:species` (scripts/scaffold-species.mjs) is an
interactive Node ESM prompt that asks for the id, FR/EN labels, asset
folder, main SVG filename, detail SVG mappings, and the vertebral
formula, then writes:
src/domain/species/<id>/index.ts (with `export default`)
src/domain/species/<id>/vertebrae.ts
src/domain/species/<id>/pathologies.ts (Zod-parses the JSON)
src/domain/species/<id>/pathologies.json (minimal valid skeleton)
public/species/<assetFolder>/ (directory placeholder)
The script refuses to overwrite existing files, so it's safe to rerun
after typos. SVG assets are not generated — drop them in the public
folder yourself.
Findings JSON updates
---------------------
No runtime hot-reload mechanism is needed in dev: `pathologies.ts`
imports `pathologies.json` and runs `SpeciesFindingsSchema.parse(data)`
at module load, so a JSON edit triggers Vite HMR + an immediate Zod
validation pass. In prod, rebuild and redeploy.
Docs
----
docs/ADDING-A-SPECIES.md rewritten around the new flow: quick start via
the scaffold script first, manual instructions second, and removed the
stale references to the flat `Pathology[]` model and the no-longer-
required registry edit step.
Co-Authored-By: Claude <noreply@anthropic.com>
ZONES and CONSTATS sections previously joined their entries with a tiny
mid-dot in the same body font. At print scale the separator collapsed
into the surrounding text and made dense lists hard to scan.
Sections that contain " · " are now drawn segment-by-segment:
- Items keep the existing body-regular @10pt ink color.
- The separator is rendered as a heavier "•" in body-bold @14pt in the
accent color, with 5pt of clear space on either side.
- The bullet's baseline is nudged down 30% of the size delta so it
visually centers on the surrounding text x-height.
Wrapping is handled per-item: an item that won't fit on the current
line jumps to the next; the separator never lands at the start of a
new line. The height estimator was updated to count the same wrapping
the renderer uses, so the image-area / text-area budget stays
balanced for both single-line and multi-line section values.
Co-Authored-By: Claude <noreply@anthropic.com>
Single 6px Gaussian blur was being attenuated to near-invisible by the
SVG → canvas → PNG → pdf-lib pipeline (each stage loses some alpha).
The halo is now built from two stacked passes:
- a wide pass (stdDeviation=18) merged three times for the outer glow,
- a tighter pass (stdDeviation=8) merged twice to keep the selection
anchored to the original point instead of dissolving into a fog.
Result: zone highlights stay obvious at print scale and from a couple
of feet away. Detail-view rendering is unchanged.
Co-Authored-By: Claude <noreply@anthropic.com>