fix(anatomy,editor): detail-popup clicks + spine zones open VertebraPicker via data-anno-special
Three coupled bugs in zone interaction: 1. Clicks inside the head detail popup were ignored — EditorRoute looked up the clicked id in the main-SVG bones map only, so detail-only ids (point-mpbykomv et al.) returned undefined. 2. Spine zones did not open VertebraPicker on click; the picker was only reachable via the per-zone "Vertèbres…" button. 3. The new SVG hint data-anno-special="vertebral-precision" was present in Horse.svg but unread by the parser/UI. Parser now reads data-anno-special into Bone.special. EditorRoute parses the detail SVG on open and falls back to detailBones for id lookups. When bone.special === 'vertebral-precision', clicking adds the zone (if absent) and opens VertebraPicker for that zone index; toggle-off via main click is disabled for these zones (use ✕). The "Vertèbres…" button in ObservationCard is now shown only on zones that support it. Convention doc updated. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
21b678c3d5
commit
b9da4fa04a
7 files changed
+86
-22
No files matched your search
@@ -17,7 +17,8 @@ const FIXTURE = `
|
||||
<circle data-anno-id="point-shoulder" data-anno-name-fr="Épaule" data-anno-name-en="Shoulder"
|
||||
data-anno-category="articulations" />
|
||||
<polygon data-anno-id="zone-cervical" data-anno-name-fr="Vertèbres cervicales"
|
||||
data-anno-name-en="Cervical Vertebrae" data-anno-category="zone-colonne" />
|
||||
data-anno-name-en="Cervical Vertebrae" data-anno-category="zone-colonne"
|
||||
data-anno-special="vertebral-precision" />
|
||||
<polygon data-anno-id="zone-head" data-anno-category="os" data-anno-opens-detail="head" />
|
||||
<polygon data-anno-id="zone-future" data-anno-name-fr="Catégorie inédite"
|
||||
data-anno-category="something-new-the-parser-has-never-seen" />
|
||||
@@ -39,6 +40,12 @@ describe('parseSvgBones', () => {
|
||||
expect(map.get('zone-head')?.opensDetail).toBe('head')
|
||||
})
|
||||
|
||||
it('captures data-anno-special when present', () => {
|
||||
const map = parseSvgBones(svgFromString(FIXTURE))
|
||||
expect(map.get('zone-cervical')?.special).toBe('vertebral-precision')
|
||||
expect(map.get('point-shoulder')?.special).toBeUndefined()
|
||||
})
|
||||
|
||||
it('allows annotations without data-anno-name-fr/en (trigger-only zones)', () => {
|
||||
const map = parseSvgBones(svgFromString(FIXTURE))
|
||||
const trigger = map.get('zone-head')
|
||||
|
||||
Reference in new issue
Block a user