🐛 Fix | Correct mismatched muscle ids and clarify trapezius/hand naming in body map SVGs - #36
🐛 Fix | Correct mismatched muscle ids and clarify trapezius/hand naming in body map SVGs#36davidgaspardev wants to merge 3 commits into
Conversation
Corrected geometry-to-id mismatches found by isolating each path and cross-checking against human anatomy references: the front-view pectoralis/trapezius_front ids were swapped (pectoralis pointed at the serratus anterior shape, trapezius_front at the actual pectoralis major shape), and the back-view erector_spinae id pointed at what is actually the lower fiber of the trapezius. Only ids changed, no path geometry was touched. Also renamed female_muscle_front.svg/female_muscle_back.svg to female_muscle_map_front.svg/female_muscle_map_back.svg to match the naming pattern BodyMapAssetDatasource already expects for the male assets. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
BodyMapAssetDatasource only turns muscle_* ids into tappable stress regions. The hand paths are a thin sliver on the fingers with no real muscle mass, and no fitness exercise plan tracks "hand muscle" stress, so keeping the muscle_ prefix implied a workout-trackable region that doesn't exist. Renamed muscle_left/right_hand to outline_left/right_hand across all 4 assets (male/female x front/back) so the datasource skips them entirely — no code change needed since MuscleRegionData.id is read directly from the SVG. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…trapezius id Renamed the unqualified back-view "trapezius" (lateral wing piece) to trapezius_mid, making the naming scheme self-consistent as upper/mid/lower — matching how strength training already treats these as semi-independently trainable fiber regions (shrugs bias upper traps, rows bias mid, face-pulls/Y-raises bias lower), so keeping them as 3 distinct regions instead of merging into one is intentional. Renamed female_front's trapezius_shoulder to trapezius_upper: geometry confirmed (bbox check) it sits in the gap between neck, pectoralis and anterior_deltoid — it's the front-visible sliver of the same upper trapezius fibers already named trapezius_upper in the back view, not a separate muscle. Since front/back are loaded as separate asset sets depending on BodySide, reusing the same id across both views is safe and lets both map to a single MuscleGroup. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (4)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
🎯 Why?
An anatomical audit of the 4 body map SVGs (
male/female×front/backinassets/image/svg/) found that severalmuscle_*path ids didn't match the actual geometry they were attached to — meaning taps/stress on those regions would visually highlight the wrong muscle. Full validation (isolating each path and cross-checking bbox/shape against anatomy references) is documented in issue #35.🏷️ Type of Change
📦 What Changed?
Asset-only changes across the 4 body map SVGs — only
idattributes were renamed, no path geometry (d) was touched, and no Dart code changes were needed sinceMuscleRegionData.idis read directly from the SVG at runtime with no hardcoded id references anywhere inlib/ortest/(verified viagrep).39ba19d— Fixed swapped ids on the front view:pectoralispointed at the serratus anterior shape andtrapezius_frontpointed at the actual pectoralis major shape; renamed accordingly and introducedserratus_anterior. On the back view,erector_spinaeactually pointed at the lower fiber of the trapezius (the piece that completes the "kite" shape withtrapezius_upper/trapezius) — renamed totrapezius_lower. Also renamedfemale_muscle_front.svg/female_muscle_back.svg→female_muscle_map_front.svg/female_muscle_map_back.svgto match the naming patternBodyMapAssetDatasourcealready expected for the male assets (this was silently broken for the female flow, masked today becausesexis hardcoded tomalein the viewmodel).4b8f6a8— The hand paths are a thin sliver on the fingers with no real muscle mass, and no workout plan tracks "hand muscle" stress. Renamedmuscle_left/right_hand→outline_left/right_handacross all 4 assets soBodyMapAssetDatasource(which only treatsmuscle_*-prefixed ids as tappable stress regions) stops treating it as an interactive muscle region.9848e77— Renamed the unqualified back-viewtrapezius(lateral wing) totrapezius_mid, making the naming scheme self-consistent asupper/mid/lower— these are kept as 3 distinct regions (not merged into one) since strength training already treats these trapezius fibers as semi-independently trainable (shrugs bias upper, rows bias mid, face-pulls/Y-raises bias lower). Also renamed female_front'strapezius_shoulder→trapezius_upper: bbox confirmed it's the front-visible sliver of the same upper trapezius fibers (sits in the gap betweenneck,pectoralisandanterior_deltoid), not a separate muscle — reusing the back view's id lets both map to a singleMuscleGrouplater, since front/back are never loaded together.🧪 Testing (required for code changes)
📱 Platforms Tested
✔️ Verification
📝 Test Scenarios
flutter test test/features/muscle_map/— all 9 existing tests pass (they use fake region ids unrelated to the real SVG assets, so unaffected by the renames).flutter analyze lib/features/muscle_map/— no issues found.svgpathtools, computed exact bounding boxes, and rendered each region isolated (no z-order overlap) to visually confirm the new id matches the anatomical position/shape, cross-referenced against anatomy sources (NCBI, Kenhub, TeachMeAnatomy). Full methodology and before/after renders in issue ♻️ Refactor | Corrigir bounded context muscle_map → body_map e definir MuscleGroup compartilhado com workout #35.BodySide/BodySexselector is wired to the UI yet, so these ids aren't currently reachable from a running screen.🔗 Reference Links (optional)
🔄 Dependencies (optional)
None.
✅ Checklist
🔀 Merge Rules