Repository navigation
Order preset workouts deliberately instead of randomly (#78) - #81
Merged
Merged
Conversation
Preset-started workouts use balanced rotation by default (based on the order actually performed in previous sessions from the same preset), with optional muscle-group priority and muscle-group alternation. The order and its basis are stored on the session so it is explainable. Preset exercises default to the canonical equipment last used at the gym, as in #22. Closes #78.
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 #78.
What changes
preset-ordering.js. The order and its basis are stored on the session inworkout_sessions.exercise_order_basis. Product rationale:docs/PRESET_EXERCISE_ORDER.md, linked from Literature.Migration
supabase/migrations/20261018120000_order_preset_workouts.sql. It sorts after #22's migrations and stops with an error if #22 isn't applied.user_settingscolumns,user_priority_muscle_groups(RLS),save_preset_order_preference, andworkout_sessions.exercise_order_basis.start_or_resume_workout_sessionbecomes a 4-arg version with defaults, so existing 2-arg calls still resolve.Validation
npm run agent:checkpasses locally against the disposable DB: syntax, 228 node tests, and all pgTAP files. Not yet clicked through in a browser.Follow-up (not in this PR)
Production still has two old August overloads:
start_or_resume_workout_session()and(p_preset_id bigint). They don't clash with this change and could be dropped in a separate cleanup.Deploying
Merging deploys the frontend through GitHub Pages straight away, so apply the migration to production at the same time.