Skip to content

Commit 8657914

Browse files
committed
feat: Allow more progressive overload strategies
This change introduces more progressive overload strategies. Many times, people have asked about disabling progressive overload and the answer has always been "just set it to zero". With this change, there is now an explicit "None" option. Additionally more complex behaviours can now be encoded. The existing behaviour was this: If all sets have hit their min reps then: - Increase all set's weight by the amount specified The action that gets completed is now more configurable: Type: None If all sets have hit their min reps then: - Leave weight alone Type: Evenly If all sets have hit their min reps then: - Increase all set's weight by the amount specified (this is the original behaviour) Type: Lowest set/s Increase strategy: Every lowest If all sets have hit their min reps then: - Find the lowest weight in all the sets, and increase all sets with this weight by the amount Type: Lowest set/s Increase strategy: First lowest If all sets have hit their min reps then: - Find the lowest weight in all the sets, and increase the first set which has this weight by the amount Type: Lowest set/s Increase strategy: Last lowest If all sets have hit their min reps then: - Find the lowest weight in all the sets, and increase the last set which has this weight by the amount Type: Lowest set/s Increase strategy: Middle lowest If all sets have hit their min reps then: - Find the lowest weight in all the sets, and increase the set closest to the middle which has this weight by the amount These new types and strategies are useful for when you generally don't increase all your sets when you overload, for instance with dumbbell shoulder press where the increase is a bit much. I would use the Middle Lowest strategy where if I succeed it will increase a single set by the amount, starting with the middle set.
1 parent 2af0d77 commit 8657914

74 files changed

Lines changed: 4212 additions & 1850 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/android-build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ jobs:
3030
- name: Install
3131
run: npm ci
3232
working-directory: ./app
33+
- name: Prebuild
34+
run: npm run prebuild
35+
working-directory: ./app
3336

3437
- name: Build Android
3538
run: ./gradlew build

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ service-account.json
2020
# Mono auto generated files
2121
mono_crash.*
2222

23-
scratch
2423

2524

2625
# Build results
@@ -389,3 +388,5 @@ backend/LiftLog.Api/appsettings.Development.json
389388
LiftLog.Web/wwwroot/crypto-utils.js
390389
LiftLog.Ui/wwwroot/app-utils.js
391390
tests/LiftLog.Tests.Api/appsettings.Development.json
391+
392+
temp/

app/eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ module.exports = defineConfig([
119119
'**/expo-env.d.ts',
120120
'**/dist',
121121
'**/node_modules',
122+
'src/drizzle/migrations.js',
122123
'src/types/dom.slim.d.ts',
123124
'scripts',
124125
]),

app/models/storage/versions/v1/exercise-descriptor.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

app/modules/workout-worker/android/src/main/java/expo/modules/workoutworker/utils/Json.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import com.limajuice.liftlog.CardioTarget
55
import com.limajuice.liftlog.DistanceCardioTarget
66
import com.limajuice.liftlog.ExerciseBlueprint
77
import com.limajuice.liftlog.FinishWorkoutCommand
8+
import com.limajuice.liftlog.IncreaseAllEvenlyProgressiveOverload
9+
import com.limajuice.liftlog.IncreaseLowestSetProgressiveOverload
10+
import com.limajuice.liftlog.NoProgressiveOverload
11+
import com.limajuice.liftlog.ProgressiveOverload
812
import com.limajuice.liftlog.RecordedCardioExercise
913
import com.limajuice.liftlog.RecordedExercise
1014
import com.limajuice.liftlog.RecordedWeightedExercise
@@ -80,6 +84,12 @@ object Json {
8084
.withSubtype(DistanceCardioTarget::class.java, "distance")
8185
.withSubtype(TimeCardioTarget::class.java, "time")
8286
)
87+
.add(
88+
PolymorphicJsonAdapterFactory.of(ProgressiveOverload::class.java, "type")
89+
.withSubtype(NoProgressiveOverload::class.java, "NoProgressiveOverload")
90+
.withSubtype(IncreaseAllEvenlyProgressiveOverload::class.java, "IncreaseAllEvenlyProgressiveOverload")
91+
.withSubtype(IncreaseLowestSetProgressiveOverload::class.java, "IncreaseLowestSetProgressiveOverload")
92+
)
8393
.add(Duration::class.java, DurationAdapter())
8494
.add(Instant::class.java, InstantAdapter())
8595
.add(BigDecimal::class.java, BigDecimalAdapter())

app/package-lock.json

Lines changed: 96 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"expo-status-bar": "~56.0.4",
6161
"linq": "^4.0.3",
6262
"material-symbols-react-native": "^1.0.3",
63-
"protobufjs": "^7.5.5",
63+
"protobufjs": "^7.6.2",
6464
"react": "19.2.3",
6565
"react-compiler-runtime": "^1.0.0",
6666
"react-native": "0.85.3",
@@ -99,6 +99,7 @@
9999
"@types/node": "^24.3.3",
100100
"@types/react": "~19.2.10",
101101
"@typescript/native-preview": "^7.0.0-dev.20251121.1",
102+
"ajv": "^8.20.0",
102103
"babel-plugin-inline-import": "^3.0.0",
103104
"drizzle-kit": "^0.31.10",
104105
"eslint": "^9.39.2",

app/scripts/generate-json-schemas.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,15 @@ const fs = require('fs');
55
const { join } = require('node:path');
66

77
const modelsDir = join(__dirname, '../src/models');
8-
const storageVersionsDir = join(modelsDir, 'storage/versions');
98
const docsSchemasPath = join(__dirname, '../../docs/schemas/');
109
// Create schemas for storage
11-
for (const currentVersionVal of fs
12-
.readdirSync(storageVersionsDir)
13-
.filter((f) => /^v\d+/.test(f))) {
14-
const outputPath = join(docsSchemasPath, currentVersionVal, 'schema.json');
15-
16-
createSchema(
17-
join(storageVersionsDir, currentVersionVal, 'index.ts'),
18-
outputPath,
19-
);
20-
}
2110

2211
// Create schema for workout-worker — one file per definition
2312
createSplitSchemas(
2413
join(modelsDir, 'workout-worker-messages.ts'),
2514
join(docsSchemasPath, 'workout-worker'),
2615
);
2716

28-
function createSchema(inputFile, outputPath) {
29-
const schema = buildSchema(inputFile);
30-
31-
fs.mkdirSync(require('path').dirname(outputPath), { recursive: true });
32-
fs.writeFileSync(outputPath, JSON.stringify(schema, null, 2));
33-
console.log(`Wrote schema to ${outputPath}`);
34-
}
35-
3617
/**
3718
* Write one JSON Schema file per top-level definition.
3819
* Each file is named `<DefinitionName>.json` and lives in `outputDir`.
@@ -106,6 +87,7 @@ function buildSchema(inputFile) {
10687
type: '*',
10788
additionalProperties: true,
10889
discriminatorType: 'open-api',
90+
skipTypeCheck: true,
10991
};
11092

11193
const schema = tsj.createGenerator(config).createSchema(config.type);

0 commit comments

Comments
 (0)