Enhance exercise tracking with metrics structure#9
Merged
Conversation
…or improved tracking
…r improved data organization and migration support
…data structure and migration support
… selectors for better reliability
…on in workout page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8
This pull request includes significant updates to the workout history and workout item components, as well as database schema changes to support nested metrics for completed exercises. The most important changes include updating end-to-end tests, adding new Svelte components, and modifying the database schema and related functions.
End-to-End Test Improvements:
app/e2e/workout-history.test.ts: Enhanced the test flow for workout generation and history validation by increasing timeouts, using more specific selectors, and adding checks for newly introduced metrics fields.Svelte Component:
app/src/lib/components/WorkoutItem.svelte: Introduced a new Svelte component for rendering workout items, including support for various exercise metrics and completion states.Database Schema and Migration:
app/src/lib/database.ts: Updated the database schema to version 2, migrating from flat fields to a nestedmetricsstructure for completed exercises. Added a migration function to convert existing records. [1] [2] [3]Database Tests:
app/src/lib/database.test.ts: Updated tests to reflect the new nested metrics structure, added tests for handling additional and optional metric fields. [1] [2] [3] [4]Migration Tests:
app/src/lib/database.migration.test.ts: Added tests to verify the migration from version 1 to version 2 of the completed exercises schema.Introduce a new metrics object for exercises to improve tracking of attributes like sets, reps, weight, and time. Refactor existing data structures to support this new organization and ensure migration from the old format.