Commit Graph
133 Commits
Author SHA1 Message Date
Bastien ChanotandClaude Opus 4.8 6e2285250e i18n(lateral): rename 'Impair'/'Unpaired' to 'Unilatéral'/'Unilateral'
Practitioner-facing copy only — the displayed term for a zone with no left/right side. Internal token 'unpaired', data-anno-lateral attribute, and types are unchanged. Affects the SVG editor laterality dropdown and the lateral.unpaired key (FR + EN).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 00:28:58 +02:00
Bastien ChanotandClaude Opus 4.8 d9cf2fa393 feat(pdf): show Paws in Harmony logo in report footer
Rasterize Paws_in_harmony.svg via canvg and embed it as the partnership credit in the PDF footer, replacing the text handle. Falls back to the '@paws.iin.harmony' text if rasterization or fetch fails.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 02:46:35 +02:00
Bastien ChanotandClaude Opus 4.8 3a67da73e7 feat(ui): show Paws in Harmony logo in site footer
Replace the 'Paws iin Harmony' text credit in the partnership row with the Paws_in_harmony.svg logo served from public/, mirroring the ZenQuality logo treatment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 02:46:33 +02:00
Bastien ChanotandClaude Opus 4.7 38888cb3d1 feat(editor): unified spine picker — show all regions, click opens own tab
The vertebra picker now edits the whole spine at once instead of a single
zone. Seed it with the union of vertebrae across every spine zone of the
observation (collectSpineVertebrae) so switching tabs reveals selections made
on other zones. Clicking a zone always opens its own region tab (initialRegion
now takes priority over the first existing selection).

On confirm, syncSpineZones reconciles authoritatively per region: replace each
region's vertebrae (deselection sticks), prune a spine zone whose region drops
to zero, spawn a zone for a newly picked region. Non-spine zones and their
order are preserved untouched. Supersedes the additive distribute model.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 19:22:42 +02:00
Bastien ChanotandClaude Opus 4.7 9544924165 feat(editor): cross-region vertebra picks spawn their spine zone
Picking vertebrae in a region tab other than the clicked zone now creates
(or additively merges) the matching spine zone, so the SVG highlights it,
it appears in the observation's selected zones, and its findings picker shows.

Extract distributeVertebraeToZones + findSpineZoneId + regionFromLabel into
src/lib/spineZones.ts (regionFromLabel re-exported from VertebraPicker for
back-compat). Target region replaces (deselection sticks); other regions union
(side-tab picks never wipe a pre-existing zone). Unmapped regions fall back to
the target zone.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 18:14:01 +02:00
Bastien ChanotandClaude Opus 4.6 09be33fd84 fix(pdf): use plain logo in header, -com in footer, enlarge footer logos
- Header: faunosteo_logo_horizontal (no .com)
- Footer: faunosteo-horizontal-com (with .com branding)
- Footer Faunosteo logo: 60x23 → 80x30
- Footer ZenQuality logo: 50x12 → 70x16

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-27 07:12:46 +02:00
Bastien ChanotandClaude Opus 4.6 f1c639d93e feat(pdf): generate PNG assets from SVG logos, use -com variant in footer
- Generated 24 PNGs (128/256/512/1024) from 6 SVG logos into public/assets/
- PDF footer now uses faunosteo-horizontal-com (with .com branding)
- Simplified logo.ts: both logos are pre-rasterized PNGs, removed SVG
  rasterization code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-27 07:02:40 +02:00
Bastien ChanotandClaude Opus 4.6 710171afda fix(pdf): use French ZenQuality logo in PDF footer
Swapped logo-horizontal-1024.png (dark) for logo-horizontal-fr-1024.png.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-27 06:30:30 +02:00
Bastien ChanotandClaude Opus 4.6 d0fdd3f157 fix(pdf): restore partnership label before Instagram handle in footer
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-27 05:36:20 +02:00
Bastien ChanotandClaude Opus 4.6 d5e0ec531e fix(pdf): remove ineffective NewWindow flag from link annotations
Browser PDF viewers control link target behavior, not the PDF spec.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-27 05:32:01 +02:00
Bastien ChanotandClaude Opus 4.6 d313015950 fix(pdf): add NewWindow flag to link annotations
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-27 05:25:35 +02:00
Bastien ChanotandClaude Opus 4.6 cae585b564 fix(pdf): simplify footer to single line, use dark ZQ PNG logo
- Removed "faunosteo.com" text (logo alone is clickable)
- Replaced "In partnership with Paws iin Harmony" + separate handle
  with single "@paws.iin.harmony" link
- Swapped ZenQuality SVG for dark PNG (logo-horizontal-1024.png)
  which renders better on white pages
- Footer now: [Faunosteo logo] | [Powered by ZQ logo] | [@paws.iin.harmony]
  with page numbers below center

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-27 05:19:54 +02:00
Bastien ChanotandClaude Opus 4.6 4075945668 fix(pdf): logo on all pages, clickable links, ZenQuality logo, higher separator
- Header logo centered between practitioner/animal text on every page
- Added clickable link annotations (faunosteo.com, zenquality.fr, Instagram)
- Bundled ZenQuality SVG logo at public/brand/zenquality-logo.svg
- Footer separator moved above logo area
- Removed isFirstPage gating on header logo

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-27 05:13:35 +02:00
Bastien ChanotandClaude Opus 4.6 33a7f47fdf feat(pdf): add branding to PDF exports (header logo + footer links)
Header: centered Faunosteo logo on first page.
Footer: Faunosteo logo + faunosteo.com, ZenQuality logo + "Powered by",
Paws iin Harmony + @instagram handle, page numbers. Removed export date
and plain-text site name from footer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-27 05:03:15 +02:00
Bastien ChanotandClaude Opus 4.6 c853c681f9 feat(ui): separate findings pickers per side for bilateral zones
Bilateral zones now get distinct findings pickers (e.g. "Épaule (Gauche)"
and "Épaule (Droite)") instead of one shared picker. Finding schema gains
optional `side` field so pathologies are tracked per-side. PDF export
groups findings by zone+side with side label in section headers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-27 04:22:35 +02:00
Bastien ChanotandClaude 2273602da9 feat(editor): add tabbed welcome screen with project SVG picker
Welcome screen now offers two tabs: "Project SVGs" with species and view
dropdowns that load anatomy SVGs from the species registry, and "Upload
a file" with the existing file import flow. Download filename dynamically
tracks the loaded file instead of hardcoded horse_anatomy_edited.svg.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-25 05:47:22 +02:00
Bastien ChanotandClaude Opus 4.6 c4ab6f60e4 fix(editor): use const for nextZones in lateral picker callback
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-23 22:23:58 +02:00
Bastien ChanotandClaude a4739df538 feat(editor): add laterality dropdown to SVG editor
Adds a Latéralité/Laterality select (unpaired / bilateral) to the SVG
editor edit panel. Value is persisted as data-anno-lateral on all
sibling elements via applyEdit and restored on selection via showEditPanel.
i18n keys added to both fr/en dicts.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-23 22:21:26 +02:00
Bastien ChanotandClaude 773b00282f feat(pdf): include laterality side in zone labels
Append side suffix (e.g. "(Gauche)" / "(Left)") after each zone label
in the PDF observation page, using the existing lateral.left/lateral.right
i18n keys.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-23 22:19:44 +02:00
Bastien ChanotandClaude 3323d4e45d feat(ui): display laterality side in zone badges
Pass t() into describeZone and append (G/D or L/R) when z.side is set.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-23 22:18:37 +02:00
Bastien ChanotandClaude 5a19ae1f32 feat(editor): integrate LateralityPicker in zone click flow
Insert bilateral check in onZoneClick between vertebral-precision
and unpaired toggle logic. Both-sides-present clears all matching
zones; otherwise opens LateralityPicker to let user pick L/R/both.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-23 22:18:25 +02:00
Bastien ChanotandClaude 20d60b939a feat(ui): add LateralityPicker modal component
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-23 22:17:42 +02:00
Bastien ChanotandClaude e0abb1efa1 feat(schema): add LateralSideSchema and Bone.lateral for laterality support
Exports LateralSideSchema (z.enum left/right) and LateralSide type.
Adds optional side field to ObservationZoneSchema for bilateral zone distinction.
Covers new schema with 6 dedicated tests (accepts/rejects for both types).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-23 22:15:33 +02:00
Bastien ChanotandClaude db50c67bb6 feat(anatomy): parse data-anno-lateral attribute from SVG
Read data-anno-lateral from annotated SVG elements and expose it as
Bone.lateral ('bilateral' | 'unpaired' | undefined). Follows the same
merge logic used for data-anno-special.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-23 22:15:02 +02:00
Bastien ChanotandClaude 2d5ff54b69 feat(i18n): add laterality translation keys (FR/EN)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-23 22:14:57 +02:00
Bastien ChanotandClaude Opus 4.6 a73d8da263 fix(ui): responsive mobile — full phone/tablet adaptation across all components
Surgical CSS/className-only changes, zero behavior impact. 155/155 tests green.

- Dialog: tighter mobile padding (p-3/px-4), reduced max-height to 85vh
- Button: sm size h-8→h-9 (36px touch target), responsive text sizing
- VertebraPicker: 44px min-height touch targets on mobile region tabs
- SVG editor: sidebar stacks below canvas <768px, full-width mobile,
  zoom controls 40px, canvas min-height 40vh
- AnatomyCanvas: SVG child constrained to fit container
- EditorRoute: responsive gap/padding, canvas max-h-[55vh] on mobile
- ObservationList + ConclusionPanel: responsive section heading typography

Target: 375px+ (iPhone SE) usable, 768px+ (iPad) polished, desktop no regressions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-23 20:01:50 +02:00
Bastien ChanotandClaude Opus 4.6 1f30280762 feat(ui): unified AppHeader, logo brand, tagline update, and header simplification
- Brand component now renders horizontal SVG logo instead of text
- New AppHeader shared component replaces per-route header boilerplate
- Tagline updated to "Outils pour ostéopathes animaliers"
- All routes use AppHeader (HomeRoute, EditorsRoute, NewReportRoute, SvgEditorRoute)
- ReportHeader and Footer simplified
- DEPLOY.md URLs updated zoosteo.fr → faunosteo.com
- Logo assets added (favicon.svg, logo-horizontal.svg, apple-touch-icon.png)
- Removed unused eslint-disable directive in SvgEditorRoute

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-23 20:01:33 +02:00
Bastien ChanotandClaude Opus 4.6 2d6ed809e2 chore: rename Zoosteo → Faunosteo across entire project
Brand strings, config defaults, i18n dicts, PDF attachment metadata,
HTML titles, Docker container name, package name, repo URLs, deploy
paths, and all documentation updated. Git remote switched to
faunosteo.git. Domain URLs (zoosteo.fr) preserved — DNS update is
separate. 155/155 tests green.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-22 21:44:21 +02:00
Bastien ChanotandClaude 89e010cc5d fix(ui): vertical centering — h-full → flex-1 on route containers
h-full (height:100%) doesn't resolve when the parent only has flex-1
without an explicit height. flex-1 (flex-grow) works because the
parent App.tsx <main> IS a flex container — no explicit height needed.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-22 06:38:28 +02:00
Bastien ChanotandClaude 43fdb7e189 fix(ui): vertical centering — make app main a flex column
App.tsx <main> was flex-1 but not a flex container itself, so child
routes with h-full + grid place-items-center couldn't resolve their
height for vertical centering.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-22 06:33:27 +02:00
Bastien ChanotandClaude 66c737188b fix(ui): center editor cards and remove redundant title
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>
2026-05-22 06:30:34 +02:00
Bastien ChanotandClaude 08fbf093a8 fix(ui): home and editors pages fit viewport without scroll
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>
2026-05-22 06:26:50 +02:00
Bastien ChanotandClaude 1673302b09 feat(i18n): SVG editor header navbar + full FR/EN translation
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>
2026-05-22 06:16:49 +02:00
Bastien ChanotandClaude 5e24c2f3d7 feat(ui): editors listing page, footer links, and i18n keys
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>
2026-05-22 06:16:37 +02:00
Bastien ChanotandClaude 569e57197f feat(editor): locale-aware hover tooltip on anatomy zones
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>
2026-05-22 06:16:17 +02:00
Bastien ChanotandClaude Opus 4.6 9e60131de7 fix(editor): hide footer on SVG editor, contain SVG to viewport
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>
2026-05-22 03:10:51 +02:00
Bastien ChanotandClaude Opus 4.6 ce84caea04 fix(editor): SVG editor UX — AbortController cleanup, icons, labels
AbortController on all addEventListener calls fixes React StrictMode
double-mount causing duplicate listeners, stale "Upload SVG first"
alerts, and double file dialogs. Mode buttons get icons (☝●▬), file
button shows context-aware label, polygon validate/cancel get
green/red styling. Inline SVG style overrides removed (CSS-only now).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-22 03:10:46 +02:00
Bastien ChanotandClaude Opus 4.6 ea81d8cfa3 feat(editor): integrate SVG anatomy editor as /svg-editor route
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>
2026-05-22 02:14:01 +02:00
Bastien ChanotandClaude Opus 4.7 4dd6432ed6 fix(editor): boost findings-tree slide to be perceptible on mobile
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>
2026-05-21 07:28:28 +02:00
Bastien ChanotandClaude Opus 4.7 adbab1bc87 feat(editor): directional slide transition between findings-tree levels
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>
2026-05-21 07:22:55 +02:00
Bastien ChanotandClaude Opus 4.7 1b01744efc fix(editor): scroll to top on mount instead of restoring prior position
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>
2026-05-21 07:08:59 +02:00
Bastien ChanotandClaude Opus 4.7 06a22aec11 feat(ui): unify page header — tagline left, lang switcher far right
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>
2026-05-21 07:08:56 +02:00
Bastien ChanotandClaude Opus 4.7 caac14904d feat(ui): global footer with copyright + Powered by ZenQuality
Adds a single Footer component mounted in App.tsx via a flex-column
layout so it sticks to the bottom of every route (Home, NewReport,
Editor, NotFound).

Content per locale:
- "© <year> <footerName>. Tous droits réservés. / All rights reserved."
- "Propulsé par / Powered by [ZenQuality logo]" — logo wraps an
  external link to https://zenquality.fr (target=_blank +
  rel=noopener noreferrer).

footerName comes from runtime config (APP_FOOTER_NAME); year is
computed at render time. Two new i18n keys added in parity in
fr.ts + en.ts (footer.all_rights_reserved, footer.powered_by) —
dict parity test stays green (155/155).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 06:56:03 +02:00
Bastien ChanotandClaude Opus 4.7 7dd4f633f8 chore: rename project from osteo-report to zoosteo
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>
2026-05-21 05:53:12 +02:00
Bastien Chanot 143fdc3208 hotfix(pdf): swap vet-referral marker ⚠ → (!) for WinAnsi compatibility
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.
2026-05-21 03:33:59 +02:00
Bastien Chanot 6eda7ebc39 feat(species): adopt horse catalog v2.0 — full 26-zone coverage
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.
2026-05-21 03:23:15 +02:00
Bastien ChanotandClaude Opus 4.7 9cf8a66dad feat(i18n): navigator-detect default locale + locale-aware bone labels
- 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>
2026-05-20 07:56:22 +02:00
Bastien ChanotandClaude Opus 4.7 9916c42484 fix(i18n): localize PDF import error messages
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>
2026-05-20 07:36:34 +02:00
Bastien ChanotandClaude Opus 4.7 d6027266bc feat(i18n): migrate site + PDF to locale-aware rendering
- formatDate(iso, locale) replaces formatDateFr in src/lib/dates.ts
- exportReportToPdf(report, { locale }) takes explicit locale option
- LanguageSwitcher segmented FR | EN toggle added; integrated in
  ReportHeader, HomeRoute, NewReportRoute
- All routes (Home, NewReport, Editor, NotFound) + observation
  components (FindingsTreePicker, ObservationCard, FreeTextFindingInput,
  SeveritySelector, VertebraPicker, ObservationList) + report forms
  (PractitionerForm, AnimalForm, ConclusionPanel, NextAppointmentPicker)
  route hardcoded FR via useT()
- PDF render functions (export.ts, header.ts, footer.ts,
  observationPage.ts, conclusionPage.ts) take a locale arg and read
  static labels from the dict snapshot at call time
- Catalog finding leaf labels rendered via labelFr/EnSnapshot per locale
- description_fr / scope_disclaimer stay FR-only (out of scope —
  vet-expert authoring needed for EN copy)
- LanguageSwitcher unit test (2) + lib.dates locale tests (7) cover
  the new behavior

151/151 tests pass, lint 0, typecheck clean, vite build OK
(902KB main + 15KB lazy pathologies chunk).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 07:11:40 +02:00
Bastien Chanot 359104ce88 feat(i18n): add fr/en dicts + useT hook 2026-05-20 07:00:31 +02:00