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>
This commit is contained in:
1 parent
9544924165
commit
fc7069c2cb
4 files changed
+29
-1
No files matched your search
@@ -216,3 +216,11 @@ When standalone .html tools (no build step) need logic from TS modules (zoneMatc
|
||||
`height: 100%` (Tailwind `h-full`) resolves to `auto` when parent has `flex-1` but no explicit `height`. Caused 3 failed centering attempts on route containers inside App.tsx flex layout. Fix: use `flex-1` (flex-grow) on child instead — works because parent IS a flex container, no explicit height needed.
|
||||
**Why:** nested flex layout: App wrapper (min-h-screen flex-col) → main (flex-1) → route (h-full broke here) → section (flex-1 grid place-items-center). The section's `place-items-center` needs actual height to center within.
|
||||
**How to apply:** any flex-nested layout where child needs to fill parent — use `flex-1`, not `h-full`, unless parent has explicit `height` or is viewport-sized (`h-screen`).
|
||||
|
||||
---
|
||||
|
||||
## LRN-028 | 2026-05-27 | Drive derived UI by spawning the source-of-truth row, not patching each consumer
|
||||
|
||||
SVG highlight (boneStates) AND findings picker both derive from observation.zones. So making a cross-region vertebra pick "highlight + add zone + add findings" = ONE lever: spawn the spine zone in observation.zones. No separate highlight call, no separate findings wiring — both consumers already react to zones. Keep distribution logic pure (`distributeVertebraeToZones(zones, targetIndex, verts, bones)` → new zones[]) so it unit-tests without React; component handler stays a one-liner.
|
||||
Inverse-map region→zone via reusing the same label heuristic (`regionFromLabel`) that maps zone→region — store the function once, scan bones for `special==='vertebral-precision'` whose label matches.
|
||||
Apply: any feature where "select X in modal → reflect in N places". Find the single derived-from state; mutate that; let existing selectors fan out. Avoids drift between the highlight path and the data path.
|
||||
Reference in new issue
Block a user