Move the variation to a field in the exercise#1174
Merged
rolandgeider merged 3 commits intomasterfrom Apr 14, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the app to match backend changes by replacing the old numeric exercise “variation” identifier with a new variation_group field stored directly on Exercise (UUID string), and propagates this through providers, widgets, and test fixtures/mocks.
Changes:
- Replace
variationId/variations(int) withvariationGroup/variation_group(String UUID) across exercise models, providers, and widgets. - Update add-exercise flow to set/send
variation_groupand remove the now-unusedVariationmodel/converter. - Regenerate/adjust mocks, fixtures, and tests to align with updated provider/model APIs.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/widgets/routines/gym_mode/log_page_test.mocks.dart | Updates mocked ExercisesProvider APIs/types to use variation group strings. |
| test/routine/routines_provider_test.mocks.dart | Updates mocked ExercisesProvider APIs/types to use variation group strings. |
| test/routine/gym_mode/gym_mode_test.mocks.dart | Updates mocked ExercisesProvider APIs/types to use variation group strings. |
| test/routine/gym_mode/gym_mode_test.dart | Updates test stubs to call findExercisesByVariationGroup. |
| test/nutrition/nutritional_plans_screen_test.mocks.dart | Updates AuthProvider mock with new serverUpdateRequired API. |
| test/nutrition/nutritional_plan_screen_test.mocks.dart | Updates AuthProvider mock with new serverUpdateRequired API. |
| test/fixtures/exercises/exerciseinfo_response.json | Replaces variations with variation_group in fixture payload. |
| test/exercises/model_exercise_test.dart | Updates assertions to check variationGroup instead of variationId. |
| test/exercises/exercises_detail_widget_test.mocks.dart | Updates mocked ExercisesProvider APIs/types to use variation group strings. |
| test/exercises/exercises_detail_widget_test.dart | Updates test stubs to call findExercisesByVariationGroup. |
| test/exercises/contribute_exercise_test.mocks.dart | Regenerates mocks to remove Variation usage and switch to variationGroup. |
| test/exercises/contribute_exercise_test.dart | Updates stubs to use variationGroup getter. |
| test/exercises/contribute_exercise_image_test.mocks.dart | Regenerates mocks to remove Variation usage and switch to variationGroup. |
| test/core/validators_test.mocks.dart | Updates AppLocalizations mock with newly added localization keys. |
| test/core/settings_test.mocks.dart | Updates mocked ExercisesProvider APIs/types to use variation group strings. |
| lib/widgets/exercises/exercises.dart | Uses variationGroup and findExercisesByVariationGroup to render variations. |
| lib/widgets/add_exercise/steps/step_6_overview.dart | Displays selected variation group/connection in the overview step. |
| lib/widgets/add_exercise/steps/step_2_variations.dart | Switches selection logic from variationId to variationGroup. |
| lib/providers/nutrition_ingredient_filters_riverpod.g.dart | Regenerated Riverpod code (hash change). |
| lib/providers/exercises.dart | Changes variation grouping/indexing to be keyed by variationGroup (String). |
| lib/providers/add_exercise.dart | Replaces variationId with variationGroup and sends it in submission payload. |
| lib/models/exercises/variation.g.dart | Removes generated JSON serializer for deprecated Variation model. |
| lib/models/exercises/variation.dart | Removes deprecated Variation model. |
| lib/models/exercises/exercise.g.dart | Updates JSON (de)serialization to read/write variation_group. |
| lib/models/exercises/exercise.dart | Renames/retargets exercise field to variationGroup mapped to variation_group. |
| lib/models/exercises/exercise_submission.g.dart | Updates submission JSON (de)serialization to use variation_group. |
| lib/models/exercises/exercise_submission.freezed.dart | Regenerates Freezed code for renamed submission field (variationGroup). |
| lib/models/exercises/exercise_submission.dart | Updates Freezed model to expose variationGroup JSON key. |
| lib/models/exercises/exercise_api.g.dart | Updates exercise API DTO JSON mapping to variation_group. |
| lib/models/exercises/exercise_api.freezed.dart | Regenerates Freezed code for renamed API DTO field (variationGroup). |
| lib/models/exercises/exercise_api.dart | Updates API DTO to use variationGroup mapped to variation_group. |
| lib/database/exercises/type_converters.dart | Removes unused VariationConverter import and implementation. |
| lib/database/exercises/exercise_database.dart | Bumps Drift schema version to clear cached exercise JSON after response shape change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merged
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.
Proposed Changes
Implement changes from the backend and move the variation to a field in the exercise.