feat(train): strength plans and sessions (ADR 0035)

Strength plans of exercises from a catalogue or the person's own, in
blocks of one exercise or several done in turn (supersets, circuits),
each with its sets, reps or seconds, weights and rests; each a sealed
`strength_plan` row. Plans are marked with what the place chosen lacks,
and a session offers swaps moving the same way that the place allows.

A session runs on every device, set by set with the rest counted down,
each weight made up from the place's plates, bars and fixed weights with
the plate changes between sets, kept in strength_session.json after each
change so one cut off is carried on, and saved as a workout of the new
activity Strength with its sets, listed on its page; strength training
in Health Connect and FIT, no GPX.

Migration 20261102113104496-strength-plans is purely additive: it
creates the table strength_plan (id uuid v7, spaceId, keyId, the sealed
payload and its nonce), its index on spaceId, and a foreign key to
offline_sync_spaces with ON DELETE CASCADE, so deleting a person's sync
spaces deletes their plans; then the modules' version rows. The
gen_random_uuid_v7 function is created or replaced as in every
migration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-02 13:18:12 +01:00
commit 508994be3a
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -22,6 +22,7 @@
"activityWalking": "Walking",
"activityHiking": "Hiking",
"activityCycling": "Cycling",
"activityStrength": "Strength training",
"activityIndoorRowing": "Rowing indoors",
"activityOther": "Other workout",
"recordAutoPause": "Pause by itself",
@ -75,7 +76,7 @@
"recordingNotificationPaused": "{activity} · paused",
"@recordingNotificationPaused": {"description": "The notification's title while paused.", "placeholders": {"activity": {"type": "String", "example": "Running"}}},
"workoutName": "{when, select, morning_running{Morning run} morning_walking{Morning walk} morning_hiking{Morning hike} morning_cycling{Morning ride} morning_indoorRowing{Morning row} afternoon_running{Afternoon run} afternoon_walking{Afternoon walk} afternoon_hiking{Afternoon hike} afternoon_cycling{Afternoon ride} afternoon_indoorRowing{Afternoon row} evening_running{Evening run} evening_walking{Evening walk} evening_hiking{Evening hike} evening_cycling{Evening ride} evening_indoorRowing{Evening row} night_running{Night run} night_walking{Night walk} night_hiking{Night hike} night_cycling{Night ride} night_indoorRowing{Night row} other{Workout}}",
"workoutName": "{when, select, morning_strength{Morning strength} afternoon_strength{Afternoon strength} evening_strength{Evening strength} night_strength{Night strength} morning_running{Morning run} morning_walking{Morning walk} morning_hiking{Morning hike} morning_cycling{Morning ride} morning_indoorRowing{Morning row} afternoon_running{Afternoon run} afternoon_walking{Afternoon walk} afternoon_hiking{Afternoon hike} afternoon_cycling{Afternoon ride} afternoon_indoorRowing{Afternoon row} evening_running{Evening run} evening_walking{Evening walk} evening_hiking{Evening hike} evening_cycling{Evening ride} evening_indoorRowing{Evening row} night_running{Night run} night_walking{Night walk} night_hiking{Night hike} night_cycling{Night ride} night_indoorRowing{Night row} other{Workout}}",
"@workoutName": {"description": "A workout's name where the person gave none: the time of day it started (morning 5–12, afternoon 12–17, evening 17–22, night) and its activity, as Strava names them.", "placeholders": {"when": {"type": "String"}}},
"workoutLocked": "Locked workout",
"workoutLockedHint": "This device doesn't hold the key it's sealed with.",
@ -801,5 +802,93 @@
"plateMoves": "{count, plural, =0{No plate moves} =1{1 plate moves on each side} other{{count} plates move on each side}}",
"@plateMoves": {"placeholders": {"count": {"type": "int"}}},
"plateSet": "Set {number}",
"@plateSet": {"placeholders": {"number": {"type": "int"}}}
"@plateSet": {"placeholders": {"number": {"type": "int"}}},
"exerciseName": "{id, select, backSquat{Back squat} frontSquat{Front squat} gobletSquat{Goblet squat} kettlebellGobletSquat{Kettlebell goblet squat} bodyweightSquat{Bodyweight squat} lunge{Lunge} bulgarianSplitSquat{Bulgarian split squat} bodyweightLunge{Bodyweight lunge} deadlift{Deadlift} romanianDeadlift{Romanian deadlift} trapBarDeadlift{Trap bar deadlift} dumbbellRomanianDeadlift{Dumbbell Romanian deadlift} kettlebellSwing{Kettlebell swing} hipThrust{Hip thrust} gluteBridge{Glute bridge} benchPress{Bench press} inclineBenchPress{Incline bench press} dumbbellBenchPress{Dumbbell bench press} pushUp{Push-up} dip{Dip} overheadPress{Overhead press} dumbbellShoulderPress{Dumbbell shoulder press} pikePushUp{Pike push-up} barbellRow{Barbell row} dumbbellRow{One-arm dumbbell row} cableRow{Seated cable row} invertedRow{Inverted row} bandPullApart{Band pull-apart} facePull{Face pull} pullUp{Pull-up} chinUp{Chin-up} latPulldown{Lat pulldown} bandPulldown{Band pulldown} barbellCurl{Barbell curl} ezBarCurl{EZ bar curl} dumbbellCurl{Dumbbell curl} hammerCurl{Hammer curl} tricepsPushdown{Triceps pushdown} skullCrusher{Skull crusher} overheadTricepsExtension{Overhead triceps extension} benchDip{Bench dip} lateralRaise{Lateral raise} cableLateralRaise{Cable lateral raise} calfRaise{Calf raise} plank{Plank} sidePlank{Side plank} hangingLegRaise{Hanging leg raise} crunch{Crunch} farmersCarry{Farmer's carry} other{Exercise}}",
"@exerciseName": {"placeholders": {"id": {"type": "String"}}, "description": "A catalogue exercise's name, by its id (ADR 0035, D1)."},
"exerciseNeed": "{need, select, barbell{a barbell} ezBar{an EZ bar} trapBar{a trap bar} dumbbells{dumbbells} kettlebell{a kettlebell} bench{a bench} rack{a rack} pullUpBar{a pull-up bar} dipBars{dip bars} cableMachine{a cable machine} bands{bands} other{something}}",
"@exerciseNeed": {"placeholders": {"need": {"type": "String"}}, "description": "What an exercise needs, as in \"Missing here: a rack, dip bars\"."},
"exercisePattern": "{pattern, select, squat{Squats} lunge{Lunges} hinge{Hinges} horizontalPush{Pushes} verticalPush{Pushes overhead} horizontalPull{Rows} verticalPull{Pull-ups and pulldowns} curl{Curls} extension{Triceps} raise{Raises} calf{Calves} core{Core} carry{Carries} other{Other}}",
"@exercisePattern": {"placeholders": {"pattern": {"type": "String"}}},
"exerciseLoad": "{load, select, barbell{Barbell with plates} ezBar{EZ bar with plates} trapBar{Trap bar with plates} dumbbellPair{A dumbbell in each hand} dumbbell{One dumbbell} kettlebell{Kettlebell} cable{Cable stack} band{Band} body{Body weight} other{Other}}",
"@exerciseLoad": {"placeholders": {"load": {"type": "String"}}},
"activityStrengthCard": "Strength",
"strengthPlansHeading": "Strength plans",
"strengthPlansNew": "New strength plan",
"strengthPlansEmpty": "Strength plans list exercises with their sets, repetitions, weights and rests, alone or as supersets and circuits.",
"strengthPlanLocked": "Can't be opened on this device",
"strengthPlanDeleted": "Strength plan deleted",
"strengthStart": "Start",
"strengthChoosePlan": "Which plan?",
"strengthNoPlans": "Make a strength plan first: the list below has New strength plan.",
"strengthPlanTitle": "Strength plan",
"strengthPlanName": "Name",
"strengthPlanSave": "Save",
"strengthPlanDelete": "Delete",
"strengthAddExercise": "Add exercise",
"strengthAddToBlock": "Add an exercise to do in turn",
"strengthOwnExercise": "Your own exercise",
"strengthOwnExercises": "Your own",
"strengthExerciseName": "What it is",
"strengthExerciseNeeds": "What it needs",
"strengthExerciseLoad": "What it is done with",
"strengthExercisePattern": "How it moves",
"strengthExerciseTimed": "Held for a time",
"strengthExerciseDone": "Done",
"strengthAddSet": "Add a set",
"strengthReps": "Reps",
"strengthSeconds": "Seconds",
"strengthKg": "kg",
"strengthRemoveExercise": "Remove exercise",
"strengthRemoveSet": "Remove set",
"strengthMoveUp": "Move up",
"strengthMoveDown": "Move down",
"strengthRest": "Rest",
"strengthRestBetween": "Rest between exercises",
"strengthDiscardTitle": "Discard changes?",
"strengthDiscard": "Discard",
"strengthDiscardMessage": "What you changed in this plan is not kept.",
"strengthAbandon": "End without saving",
"strengthAbandonMessage": "The sets done so far are deleted from this device. This can't be undone.",
"strengthFinish": "Finish and save",
"strengthAllDone": "Every set is through.",
"strengthSetDone": "Done",
"strengthSkip": "Skip set",
"strengthSwap": "Swap exercise",
"strengthSwapTitle": "Do instead",
"strengthNoSwaps": "Nothing else here moves this way.",
"strengthRestSkip": "Skip rest",
"strengthResting": "Rest",
"strengthCarryOn": "A session is under way",
"strengthCarryOnAction": "Carry on",
"strengthWeightNotMadeUp": "Nothing here makes this weight up.",
"strengthFixed": "{weight} kg, nearest at or below",
"strengthNoPlace": "No place chosen: weights as planned.",
"strengthTrainsAt": "At {place}",
"strengthWorkoutVolume": "{weight} kg moved",
"strengthWorkoutSets": "{count, plural, =1{1 set} other{{count} sets}}",
"strengthMissing": "Missing here: {needs}",
"@strengthMissing": {"placeholders": {"needs": {"type": "String"}}},
"strengthPlanSummary": "{exercises, plural, =1{1 exercise} other{{exercises} exercises}} · {sets, plural, =1{1 set} other{{sets} sets}}",
"@strengthPlanSummary": {"placeholders": {"exercises": {"type": "int"}, "sets": {"type": "int"}}},
"strengthBlockKind": "{kind, select, superset{Superset} circuit{Circuit} other{Exercise}}",
"@strengthBlockKind": {"placeholders": {"kind": {"type": "String"}}},
"strengthSetOf": "Set {set} of {sets}",
"@strengthSetOf": {"placeholders": {"set": {"type": "int"}, "sets": {"type": "int"}}},
"strengthRoundOf": "Round {round} of {rounds}",
"@strengthRoundOf": {"placeholders": {"round": {"type": "int"}, "rounds": {"type": "int"}}},
"strengthTarget": "{reps} × {weight} kg",
"@strengthTarget": {"placeholders": {"reps": {"type": "int"}, "weight": {"type": "String"}}},
"strengthTargetReps": "{reps, plural, =1{1 rep} other{{reps} reps}}",
"@strengthTargetReps": {"placeholders": {"reps": {"type": "int"}}},
"strengthTargetSeconds": "{seconds} s",
"@strengthTargetSeconds": {"placeholders": {"seconds": {"type": "int"}}},
"strengthNextUp": "Next: {exercise}",
"@strengthNextUp": {"placeholders": {"exercise": {"type": "String"}}},
"strengthBarAndPlates": "{bar} kg bar, each side: {plates}",
"@strengthBarAndPlates": {"placeholders": {"bar": {"type": "String"}, "plates": {"type": "String"}}},
"strengthHandlesAndPlates": "{bar} kg handles, each side: {plates}",
"@strengthHandlesAndPlates": {"placeholders": {"bar": {"type": "String"}, "plates": {"type": "String"}}},
"strengthWeightShort": "{weight} kg below what was planned",
"@strengthWeightShort": {"placeholders": {"weight": {"type": "String"}}}
}