Skip to content

Move the variation to a field in the exercise#1174

Merged
rolandgeider merged 3 commits intomasterfrom
feature/exercise-variations
Apr 14, 2026
Merged

Move the variation to a field in the exercise#1174
rolandgeider merged 3 commits intomasterfrom
feature/exercise-variations

Conversation

@rolandgeider
Copy link
Copy Markdown
Member

Proposed Changes

Implement changes from the backend and move the variation to a field in the exercise.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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) with variationGroup/variation_group (String UUID) across exercise models, providers, and widgets.
  • Update add-exercise flow to set/send variation_group and remove the now-unused Variation model/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.

Comment thread lib/widgets/add_exercise/steps/step_6_overview.dart
Comment thread lib/widgets/add_exercise/steps/step_2_variations.dart
Comment thread lib/providers/add_exercise.dart
@rolandgeider rolandgeider added the next version Incompatible changes that will be merged for the next version label Apr 13, 2026
@github-project-automation github-project-automation bot moved this to Backlog in Release 2.5 Apr 13, 2026
@rolandgeider rolandgeider moved this from Backlog to In review in Release 2.5 Apr 13, 2026
@rolandgeider rolandgeider mentioned this pull request Apr 13, 2026
@rolandgeider rolandgeider merged commit 44af2ec into master Apr 14, 2026
4 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Release 2.5 Apr 14, 2026
@rolandgeider rolandgeider deleted the feature/exercise-variations branch April 14, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

next version Incompatible changes that will be merged for the next version

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants