From 3bb229331e772283aa60a2e2961dc982473eb900 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Tue, 19 May 2026 05:32:38 +0200 Subject: [PATCH] =?UTF-8?q?chore(memory):=20capitalize=20PDF=20bugfix=20?= =?UTF-8?q?=E2=80=94=20BLK-004,=20LRN-006,=20LRN-007?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- .claude/memory/blockers.md | 9 +++++++++ .claude/memory/journal.md | 1 + .claude/memory/learnings.md | 15 +++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/.claude/memory/blockers.md b/.claude/memory/blockers.md index f4a3ef30..1aea2d69 100644 --- a/.claude/memory/blockers.md +++ b/.claude/memory/blockers.md @@ -27,3 +27,12 @@ Friction: clicks on head detail SVG zones did nothing. Root: EditorRoute.onZoneClick looked up id in main-SVG bones map only → detail ids (point-*) undefined → early return. Fix: parse detail SVG on detail open, store detailBones, fallback lookup `bones.get(id) ?? detailBones.get(id)`. Status: resolved. + +--- + +## BLK-004 | 2026-05-19 | PDF text loop assumed one line per array entry + +Friction: long zone string collided with following lines (pathologies, sévérité, commentaire). +Root: pdf-lib maxWidth wraps glyph drawing but caller advanced cursor by `i * 14` based on block index — wrapped lines invisible to layout. +Fix: explicit wrapLines + per-line cursor advance + per-block gap. +Status: resolved. diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 6a63e5ae..4d237df9 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -22,3 +22,4 @@ Parser reads data-anno-special; convention doc updated. - BLK-003 resolved. LRN-004, LRN-005 captured. 91 tests green, lint clean, build OK. - VertebraPicker preselects region tab inferred from zone label (b3bd75d). +5 tests. - Hotfix: detailBones now accumulate across popup opens; merged allBones passed to ObservationList so detail-popup zone labels survive after modal close. +- PDF rendering bugfix: titles cleared the header rule, zone-line wrap respects following blocks, non-selected zones hidden + data-anno-* stripped before raster, main SVG skipped when every zone lives in details. BLK-004, LRN-006, LRN-007 captured. diff --git a/.claude/memory/learnings.md b/.claude/memory/learnings.md index 007c0186..0d68a1bd 100644 --- a/.claude/memory/learnings.md +++ b/.claude/memory/learnings.md @@ -42,3 +42,18 @@ Apply: any SVG-driven UI where authors add new annotation types regularly — us When a popup loads a separate SVG, its annotation ids are not in the parent's bones map. Parse detail SVG on popup open and keep a `detailBones` map; fall back lookup `bones.get(id) ?? detailBones.get(id)` in shared click handler. Apply: any nested/zoom-popup pattern where the child SVG has independent ids. + +--- + +## LRN-006 | 2026-05-19 | Strip authoring annotations before rasterizing for print + +Source SVGs carry interaction-only artifacts (data-anno-*, transparent hitboxes, faint default fills) that are invisible in-app via CSS but leak into PDF rasterization. +Before raster: walk `[data-anno-id]`, hide non-selected via display="none", strip data-anno-* attributes, recolor selected. +Apply: any "screen → print" pipeline where the screen SVG has interaction layers. + +--- + +## LRN-007 | 2026-05-19 | pdf-lib maxWidth wraps glyphs, not your cursor + +pdf-lib's drawText({ maxWidth }) wraps the visible glyph run but the returned y is unchanged — caller must measure with widthOfTextAtSize and advance the cursor per wrapped line. Otherwise subsequent text blocks overlap the wrapped tail. +Apply: any pdf-lib layout with variable-length user text. Always wrap explicitly + advance per line.