Commit Graph
142 Commits
Author SHA1 Message Date
Bastien Chanot f58a49f7fc feat(store): restore sessionStorage draft on store init
B-3: the osteo:draft mirror was write-only — a page refresh at
/editor bounced to home and lost the session despite the advertised
auto-save. Store now initializes report from readPersistedDraft()
(per-tab sessionStorage: refresh keeps the session, closing the tab
drops it; reset still clears). TDD: 4 new tests incl. refresh
simulation via module re-import — 178/178 green.
2026-07-12 16:25:21 +02:00
Bastien Chanot b047d352c1 feat(species): locale-aware species labels via labelEn
B-6: SpeciesManifest only carried labelFr — EN users saw 'Cheval'.
labelEn required on the manifest, speciesLabel(s, locale) helper in
registry; AnimalForm dropdown + SvgEditor picker localized (locale
passed into initSvgEditor, re-inits on locale change). Scaffolder
template + ADDING-A-SPECIES.md + registry test updated.
2026-07-12 16:23:07 +02:00
Bastien Chanot 74e1623135 fix(i18n): localize SvgEditor input placeholders
B-5: 'head', 'ex: Hanche', 'ex: Hip joint' were hardcoded on an
otherwise localized page. Three new svg_editor.*_placeholder keys,
parity kept; FR output unchanged.
2026-07-12 13:23:56 +02:00
Bastien Chanot 255ab96668 fix(i18n): EN PDF title prefix matches FR document-type semantics
B-4: FR titled exports 'Bilan ostéo — <name>' but EN used the brand
('Faunosteo — '). EN now 'Osteo report — ' — also removes a hardcoded
brand string from the dict (identity rule).
2026-07-12 13:21:45 +02:00
Bastien Chanot 83f02c8fa8 fix(ui): localize Dialog close and LanguageSwitcher group aria-labels
B-1: Dialog close button exposed French 'Fermer' to EN screen-reader
users; B-2: switcher group label was English-only. New dict keys
common.close + lang.group_label in both dicts (parity kept).
2026-07-12 13:21:07 +02:00
Bastien Chanot 86ac366136 chore(ui): read Brand logo alt text from config
alt="Faunosteo" hardcoded — identity strings must come from
useConfig() (CLAUDE.md identity rule). Output identical under
default config; custom APP_BRAND_NAME now honored.
2026-07-12 04:48:04 +02:00
Bastien Chanot 4ea8c90c7f chore(i18n): drop dead dict keys, wire LanguageSwitcher through dict
6 keys unused in both dicts removed (common.back, common.none,
editors.title, lateral.bilateral, lateral.unpaired,
pdf.export_date_prefix). LanguageSwitcher hardcoded strings identical
to existing lang.* keys — now reads them via t(); rendered output
unchanged (values identical in both dicts).
2026-07-12 04:48:04 +02:00
Bastien Chanot bbdc0e851a chore: remove dead code and duplicate logic
- drop unused assertNever, canvg dependency (never imported),
  readonly re-export shim in VertebraPicker, stale equine named export
- unexport validateBoneElement (internal only)
- getBoneIdFromEvent now delegates to getAnnotatedElement (dup walk-up)
- rasterizeSvg: drop ignored _scale param (2 call sites + tests)
- extract byte-identical word-wrap into pdf/render/text.ts
- extract mergeBones helper in EditorRoute (block duplicated twice)
- fix stale canvg comment in observationPage
Checks: typecheck, lint, 174/174 tests, build all green
2026-07-12 04:47:54 +02:00
Bastien Chanot 3f91a45660 fix(editor): sanitize user-imported SVGs before DOM insertion
SvgEditorRoute.loadSVG inserted dropped SVG files with no stripping;
pathology-editor stripped descendants but missed the root element's
on* attributes and javascript: hrefs. Both now remove script/
foreignObject nodes, on* handlers (root included) and javascript:
hrefs before appendChild. Impact bounded (no auth/backend), MEDIUM.
2026-07-12 03:32:50 +02:00
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