Skip to content

🐛 Fix | Correct mismatched muscle ids and clarify trapezius/hand naming in body map SVGs - #36

Open
davidgaspardev wants to merge 3 commits into
developfrom
feature/muscle-feature-module
Open

🐛 Fix | Correct mismatched muscle ids and clarify trapezius/hand naming in body map SVGs#36
davidgaspardev wants to merge 3 commits into
developfrom
feature/muscle-feature-module

Conversation

@davidgaspardev

Copy link
Copy Markdown
Member

🎯 Why?

An anatomical audit of the 4 body map SVGs (male/female × front/back in assets/image/svg/) found that several muscle_* 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

  • 🐞 Bugfix (non-breaking change that fixes an issue)
  • 💚 Improvement (non-breaking change that adds/modifies features to existing functionality)
  • ⚡️ New feature (non-breaking change that adds functionality)
  • ⚠️ Breaking change (change that is not backwards compatible and/or changes current functionality)

📦 What Changed?

Asset-only changes across the 4 body map SVGs — only id attributes were renamed, no path geometry (d) was touched, and no Dart code changes were needed since MuscleRegionData.id is read directly from the SVG at runtime with no hardcoded id references anywhere in lib/ or test/ (verified via grep).

39ba19d — Fixed swapped ids on the front view: pectoralis pointed at the serratus anterior shape and trapezius_front pointed at the actual pectoralis major shape; renamed accordingly and introduced serratus_anterior. On the back view, erector_spinae actually pointed at the lower fiber of the trapezius (the piece that completes the "kite" shape with trapezius_upper/trapezius) — renamed to trapezius_lower. Also renamed female_muscle_front.svg/female_muscle_back.svgfemale_muscle_map_front.svg/female_muscle_map_back.svg to match the naming pattern BodyMapAssetDatasource already expected for the male assets (this was silently broken for the female flow, masked today because sex is hardcoded to male in 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. Renamed muscle_left/right_handoutline_left/right_hand across all 4 assets so BodyMapAssetDatasource (which only treats muscle_*-prefixed ids as tappable stress regions) stops treating it as an interactive muscle region.

9848e77 — Renamed the unqualified back-view trapezius (lateral wing) to trapezius_mid, making the naming scheme self-consistent as upper/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's trapezius_shouldertrapezius_upper: bbox confirmed it's the front-visible sliver of the same upper trapezius fibers (sits in the gap between neck, pectoralis and anterior_deltoid), not a separate muscle — reusing the back view's id lets both map to a single MuscleGroup later, since front/back are never loaded together.

🧪 Testing (required for code changes)

📱 Platforms Tested

  • 🤖 Android
  • 🍎 iOS
  • 🌐 Web
  • 🖥️ Desktop

✔️ Verification

  • Unit tests pass
  • Widget tests pass
  • Integration tests pass
  • Manual testing completed

📝 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.
  • Geometric validation: parsed each renamed path with 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.
  • Did not run on a physical device/simulator — no BodySide/BodySex selector is wired to the UI yet, so these ids aren't currently reachable from a running screen.

🔗 Reference Links (optional)

🔄 Dependencies (optional)

None.


✅ Checklist

  • Self-review completed
  • Tests added/updated
  • Documentation updated (if needed)
  • Labels added
  • Reviewers assigned

🔀 Merge Rules

Pull Request Merge Type
feature/fix/etc → develop SQUASH MERGE
feature/hotfix/fix/etc → release SQUASH MERGE
hotfix → main SQUASH MERGE
release → main MERGE COMMIT
backport → develop MERGE COMMIT

davidgaspardev and others added 3 commits July 29, 2026 08:50
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>
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (4)
  • assets/image/svg/female_muscle_map_back.svg is excluded by !**/*.svg
  • assets/image/svg/female_muscle_map_front.svg is excluded by !**/*.svg
  • assets/image/svg/male_muscle_map_back.svg is excluded by !**/*.svg
  • assets/image/svg/male_muscle_map_front.svg is excluded by !**/*.svg

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f0691d00-d3ce-46e5-a783-4a2555d4bb15

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key: "instructions"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Comment @coderabbitai help to get the list of available commands.

@davidgaspardev

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant