Skip to content

fix: fix bodyweight import source, docker compose build path, PR calculation, and add .gitignore - #33

Open
AmaLS367 wants to merge 1 commit into
arvids-unavailable:mainfrom
AmaLS367:fix/csv-source-docker-gitignore
Open

fix: fix bodyweight import source, docker compose build path, PR calculation, and add .gitignore#33
AmaLS367 wants to merge 1 commit into
arvids-unavailable:mainfrom
AmaLS367:fix/csv-source-docker-gitignore

Conversation

@AmaLS367

Copy link
Copy Markdown

Summary

  • Bodyweight import source: parseBodyweight now dynamically detects whether the input was an Apple Health XML export or a CSV file, returning 'CSV' instead of hardcoded 'Apple Health' for CSV imports.
  • Docker Compose build path: Fixed dockerfile: web/Dockerfile to dockerfile: Dockerfile in docker-compose.yml (web service).
  • PR calculation safeguard: Added s.w || 0 in doFinishWorkout (sheets.jsx:942) to prevent undefined set weights (such as bodyweight/cardio sets) from generating NaN in Math.max and causing new personal records to be skipped.
  • Git hygiene: Added standard .gitignore covering node_modules/, data/, media/img/, media/gif/, dist/, .env, and OS/editor files.
  • Unit tests: Added test suite in import-effort.test.js verifying bodyweight source detection for both CSV and XML.

Test plan

  • npm test — all 194 unit tests passing (including 2 new tests)
  • node frontend/scripts/check-locales.mjs — 11 locales, 628 keys each in sync
  • npm run build — Vite build succeeds cleanly
  • Browser testing: Started workout, verified set logging with weight adjustments, confirmed workout finish modal correctly displays PR and workout stats, verified Settings view.

Copilot AI lite review requested due to automatic review settings August 25, 2026 14:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are small, targeted, and include unit tests for the updated bodyweight import behavior while reducing the risk of NaN affecting PR detection.

Pull request overview

This PR tightens up import attribution for bodyweight files, fixes a Docker Compose build path, and hardens PR detection logic so undefined set weights don’t suppress new personal records. It also adds repo hygiene via a standard .gitignore, plus unit tests covering the updated bodyweight source detection.

Changes:

  • Fix PR (personal record) max-weight calculation to avoid NaN when some completed sets have no weight.
  • Update parseBodyweight to label imports as Apple Health (XML) vs CSV (tabular) and add tests for both cases.
  • Correct the docker-compose.yml web service to build from the repo-root Dockerfile and add a standard .gitignore.
File summaries
File Description
frontend/src/sheets.jsx Prevents Math.max from producing NaN when completed sets have undefined weights, ensuring PR detection works for bodyweight/cardio-style sets.
frontend/src/lib/import-effort.test.js Adds unit tests confirming bodyweight import source detection for CSV vs Apple Health XML.
frontend/src/lib/import-csv.js Implements dynamic detection of Apple Health XML vs CSV for bodyweight imports and sets source accordingly.
docker-compose.yml Fixes the Dockerfile path for the web service build configuration.
.gitignore Adds common ignores for dependencies, build output, env files, and local/runtime data directories.
Review details
  • Files reviewed: 4/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@SunriseDuarte

Copy link
Copy Markdown

Heads up: openGym has moved to GitLab.
-> GitLab

The GitHub repo is no longer maintained (the account was suspended, so it's out of my hands). Please re-open this issue/PR on GitLab so it doesn't get lost, I'll pick it up there. Questions, help and roadmap discussion now happen in Discord:
-> Discord

Sorry for the noise, and thanks for sticking around.
more infos here: openGym

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.

3 participants