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
@@ -52,6 +52,7 @@ export function parseSvgBones(svgRoot: SVGSVGElement): Map<string, Bone> {
|
||||
const category = el.getAttribute('data-anno-category') as BoneCategory
|
||||
const opensDetail =
|
||||
el.getAttribute('data-anno-opens-detail') ?? undefined
|
||||
const special = el.getAttribute('data-anno-special') ?? undefined
|
||||
|
||||
const existing = map.get(id)
|
||||
if (existing) {
|
||||
@@ -59,6 +60,9 @@ export function parseSvgBones(svgRoot: SVGSVGElement): Map<string, Bone> {
|
||||
if (opensDetail && !existing.opensDetail) {
|
||||
existing.opensDetail = opensDetail
|
||||
}
|
||||
if (special && !existing.special) {
|
||||
existing.special = special
|
||||
}
|
||||
if (!existing.fr && fr) existing.fr = fr
|
||||
if (!existing.en && en) existing.en = en
|
||||
} else {
|
||||
@@ -68,6 +72,7 @@ export function parseSvgBones(svgRoot: SVGSVGElement): Map<string, Bone> {
|
||||
en,
|
||||
category,
|
||||
opensDetail,
|
||||
special,
|
||||
els: [el],
|
||||
})
|
||||
}
|
||||
|
||||
@@ -24,6 +24,15 @@ export interface Bone {
|
||||
category: BoneCategory
|
||||
/** Detail popup id from data-anno-opens-detail, if present */
|
||||
opensDetail?: string
|
||||
/**
|
||||
* Free-form behavior hint from `data-anno-special`.
|
||||
*
|
||||
* Known values consumed by the application:
|
||||
* - `vertebral-precision`: clicking the zone opens VertebraPicker.
|
||||
*
|
||||
* Opaque to the parser; new values are accepted without code changes.
|
||||
*/
|
||||
special?: string
|
||||
/** All DOM elements carrying this annotation (used for colorization) */
|
||||
els: Element[]
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user