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
@@ -187,18 +187,22 @@ export default function ObservationCard({
|
||||
<ul className="flex flex-wrap gap-2">
|
||||
{observation.zones.map((z, i) => {
|
||||
const b = bones.get(z.boneId)
|
||||
const supportsVertebrae =
|
||||
b?.special === 'vertebral-precision'
|
||||
return (
|
||||
<li key={`${z.boneId}-${i}`}>
|
||||
<Badge tone="accent" className="gap-2">
|
||||
{describeZone(z, bones)}
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onOpenVertebraPicker(i)}
|
||||
className="underline text-xs text-[var(--color-accent-strong)]"
|
||||
title="Préciser les vertèbres pour cette zone"
|
||||
>
|
||||
Vertèbres…
|
||||
</button>
|
||||
{supportsVertebrae && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onOpenVertebraPicker(i)}
|
||||
className="underline text-xs text-[var(--color-accent-strong)]"
|
||||
title="Préciser les vertèbres pour cette zone"
|
||||
>
|
||||
Vertèbres…
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
type="button"
|
||||
aria-label={`Retirer ${b?.fr ?? z.boneId}`}
|
||||
|
||||
Reference in new issue
Block a user