Commit Graph
221 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 b7e6371f8a chore(memory): capitalize tour 2026-07-12 — LRN-030/031, EVAL-004, journal 2026-07-12 13:03:24 +02:00
Bastien Chanot 716b1a2be1 docs(tour): report — 2026-07-12 run, converged, 11 commits 2026-07-12 12:50:56 +02:00
Bastien Chanot 1078f74793 docs: sync README, DEPLOY, CHANGELOG with tour fixes (canvg drop, non-root container, base pin) 2026-07-12 11:57:19 +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 c55da07697 fix(docker): pin runner base image to nginx:1.31-alpine
Unpinned nginx:alpine made builds non-reproducible across releases.
Minor-version pin keeps patch updates. Verified: build + HTTP 200.
2026-07-12 03:48:05 +02:00
Bastien Chanot a2bd884bb1 fix(config): add minimum-release-age supply-chain guard
semgrep MEDIUM: pnpm installs now skip package versions published
less than 24h ago (npm supply-chain attack window).
2026-07-12 03:46:59 +02:00
Bastien Chanot d8e478a104 fix(docker): run container fully as non-root nginx user
semgrep HIGH: no USER directive before ENTRYPOINT (container ran as
root). Runtime dirs, conf.d and html dir chowned to nginx so the
entrypoint (env.js write + PORT envsubst) and nginx master both run
as uid 101. Verified: docker build + run, HTTP 200, SPA fallback,
env override OK, ps shows master+workers as nginx.
CONSTRAINT: PORT env var must now be >=1024 (default 8080 unaffected).
2026-07-12 03:46:59 +02:00
Bastien Chanot 187dfb5371 fix(config): move build toolchain to devDependencies
vite, @vitejs/plugin-react-swc, @tailwindcss/vite are build-time only;
they were inflating the production dependency audit surface.
Build + tests verified green after the move.
2026-07-12 03:34:00 +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 Chanot 18865def06 fix(config): patch CVE-affected deps (vite, vitest, happy-dom)
- vite 7.3.3 -> 7.3.6 (GHSA-fx2h-pf6j-xcff HIGH, GHSA-v6wh-96g9-6wx3 MED)
- vitest 3.2.4 -> 3.2.7 (GHSA-5xrq-8626-4rwp CRITICAL, dev-only)
- happy-dom 16.8.1 -> 20.10.6 (GHSA-37j7-fg3j-429f CRITICAL, dev-only)
- esbuild -> 0.28.1 within vite range, js-yaml lockfile refresh
pnpm audit: 0 known vulnerabilities; typecheck + 174/174 tests green
2026-07-12 03:25:51 +02:00
Bastien Chanot 605ee7cd74 Merge feature/doc-sync into develop 2026-07-01 14:31:37 +02:00
Bastien ChanotandClaude Opus 4.8 744b9e6759 docs: 0.1.0 changelog + 174 tests + features + PDF fonts (no tag)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNaYKPEkjH1jbgoX1TwKMX
2026-07-01 14:31:37 +02:00
Bastien Chanot 2c501c310d Merge chore/reconcile-memory into develop 2026-07-01 14:27:49 +02:00
Bastien ChanotandClaude Opus 4.8 60119c6dcb chore(memory): reconcile TODO with main +41 commits (174 tests, version 0.1.0)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNaYKPEkjH1jbgoX1TwKMX
2026-07-01 00:20:23 +02:00
Bastien Chanot 4991c10ef7 chore: adopt gitflow socle + pre-commit hook 2026-06-29 01:47:14 +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 3f239d18d5 docs(memory): capitalize BDR-022 (keep pathology-editor standalone)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 23:55:05 +02:00
Bastien ChanotandClaude Opus 4.8 97f8a92906 docs(memory): capitalize LRN-029 (Vite public/ for standalone HTML)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 23:46:22 +02:00
Bastien ChanotandClaude Opus 4.8 2803cf7c7d fix(editor): serve pathology-editor.html from public/ so it ships to dist
The file lived at the repo root, where Vite never bundles it (only index.html is the build entry). In production nginx fell through to the SPA index.html and React showed 'Page introuvable' at /pathology-editor.html. Moving it under public/ makes Vite copy it verbatim into dist/, so nginx serves it as a real static file. The /editors link (href=/pathology-editor.html) is unchanged — public/ is the web root.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 23:41:53 +02:00
Bastien ChanotandClaude Opus 4.8 b7fd2fbbc0 docs(memory): log footer Paws logo feat in journal
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 03:07:30 +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 4c196bbd08 docs: supersede BDR-018 with BDR-019 (unified spine picker)
Record the pivot from additive distribution to an authoritative full-spine
editor, the click-opens-own-tab precedence change, and the accepted
orphan-findings wart on prune.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 19:23:12 +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 fc7069c2cb docs: capitalize BDR-018 + LRN-028, sync lib folder map
Record vertebra picker distribution decision (target replaces, others union)
and the "drive derived UI by spawning the source-of-truth row" learning.
Add spineZones.ts to the CLAUDE.md src/lib folder map.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 18:58:31 +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 8e94196e5a chore(logos): add -com SVG variants and size generation script
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-27 07:15:44 +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 Opus 4.6 53f62f7bf6 fix(docker): add no-cache header for species assets
SVG/JSON files under /species/ have no content hash in their filename,
so browsers could serve stale cached versions after updates. Adding
Cache-Control: no-cache forces revalidation on every request while
still allowing 304 Not Modified for unchanged files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-27 03:55:06 +02:00
Bastien Chanot 0c170bd349 added bilaterality 2026-05-27 02:49:42 +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 Opus 4.6 93503b7ce5 docs(anatomy): document data-anno-lateral attribute
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-23 22:22:33 +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