Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b0d82eb
Added nested sets, tokenizer instead of regex, issue with timer and n…
Apr 8, 2026
8845b09
Replaced regex matching with tokenizer for better maintainability
Apr 8, 2026
a970620
Merge pull request #1 from erikparra/tokenizer-replace-regex
erikparra Apr 8, 2026
4a5275b
fixed issue with next button
Apr 8, 2026
7b477a9
added function to save to properties
Apr 9, 2026
9c39a79
added unit tests
Apr 9, 2026
0afc218
fixed issue with totals on header row of exercise
Apr 9, 2026
2b78934
fixed styling on main exercise header
Apr 9, 2026
42f8577
added css to fix spacing between params
Apr 10, 2026
978f252
refactored and added comments to main.ts
Apr 10, 2026
8e96ea0
added saving ~time and ~rest to each set
Apr 10, 2026
9859408
added comments
Apr 11, 2026
63e2919
changed symbol name from recordedDuration to recordedTime in exercise
Apr 11, 2026
969a1de
added comments
Apr 11, 2026
8cafc29
fixed skipping rest on last set of exercise
Apr 11, 2026
0ce57d4
refactored handleSetFinish for better flow and maintainability
Apr 11, 2026
8180236
updated unit tests
Apr 11, 2026
d13554e
moved function
Apr 11, 2026
92746cd
fixed exercise header row render issues
Apr 12, 2026
b081215
removed extra left aligned rest value
Apr 12, 2026
c9e9141
fixed render exercise timerm, set timer needs work
Apr 12, 2026
2096340
changed rest and duration to only render non-editable
Apr 12, 2026
fb8d68a
changed style to light up items better
Apr 12, 2026
8e42155
fixed typo
Apr 12, 2026
8516218
updated timer logic for set row
Apr 12, 2026
9dc2dcd
changes to render and parsing, updated unit tests
Apr 13, 2026
a48987d
fixed render issue with rest
Apr 13, 2026
808316d
comment change
Apr 13, 2026
61a8f2b
added targetRest value to exercise and set
Apr 13, 2026
b38aa6e
fixed comment
Apr 13, 2026
997b0f7
fixed timer rendering duration
Apr 14, 2026
3e7bd7c
changed logic, only display duration from set row, ignore exercise row
Apr 14, 2026
789ca3a
fixed: stale render now unsubscribe
Apr 14, 2026
03c0644
added write to file after parsing and single set exercise is found
Apr 14, 2026
a8c3a90
fixed timer issues, pending colors
Apr 15, 2026
2c9c3a0
fixed timer rest and overtime
Apr 15, 2026
0388674
changed controls text for next button
Apr 15, 2026
08eb407
fixed unit tests
Apr 15, 2026
3965f37
Revert "Replaced regex matching with tokenizer for better maintainabi…
erikparra Apr 15, 2026
f1d87b1
Merge pull request #3 from erikparra/revert-1-tokenizer-replace-regex
erikparra Apr 15, 2026
67c9bed
Merge pull request #4 from erikparra/feature/multi-set-exercise-v3
erikparra Apr 15, 2026
8e6e039
fixed mobile style (#5)
erikparra Apr 18, 2026
67512bf
fixed mobile sty le and updated readme with multiset exercise format …
erikparra Apr 19, 2026
cb29b5d
updated version to 1.1.2 (#7)
erikparra Apr 19, 2026
aad5e7f
Fix/workout stop after rest auto advance (#8)
erikparra Apr 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ node_modules/

# OS
.DS_Store

# Test coverage files
coverage/
72 changes: 72 additions & 0 deletions NESTED_SETS_FORMAT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# New Nested Sets Format

The workout format now supports multiple sets per exercise with indented set items. Each set can have its own rep and weight values.

## Format

```
title: Workout Name
state: planned|started|completed
startDate: 2026-01-08 15:45
duration: 11m 33s
---
- [ ] Exercise Name | Duration: [180s]
- [ ] Reps: [10] | Weight: [185] lbs
- [ ] Reps: [8] | Weight: [185] lbs
- [ ] Reps: [6] | Weight: [185] lbs
```

## Example: Upper Body Workout

```
title: Upper Body Strength
state: planned
startDate:
duration:
---
- [ ] Bench Press | Duration: [300s]
- [ ] Reps: [10] | Weight: [225] lbs
- [ ] Reps: [8] | Weight: [235] lbs
- [ ] Reps: [6] | Weight: [245] lbs

- [ ] Barbell Rows | Duration: [300s]
- [ ] Reps: [10] | Weight: [225] lbs
- [ ] Reps: [8] | Weight: [235] lbs
- [ ] Reps: [6] | Weight: [245] lbs

- [ ] Rest | Duration: [60s]
- [ ] Duration: [60s]

- [ ] Overhead Press | Duration: [180s]
- [ ] Reps: [8] | Weight: [155] lbs
- [ ] Reps: [6] | Weight: [165] lbs

- [ ] Lat Pulldown | Duration: [200s]
- [ ] Reps: [12] | Weight: [180] lbs
- [ ] Reps: [10] | Weight: [200] lbs
- [ ] Reps: [8] | Weight: [220] lbs
```

## Key Features

- **Exercise Header**: Parent item with exercise name and optional duration
- **Indented Sets**: Each set is an indented bulleted item (2 spaces + `- [ ]`)
- **Set Parameters**: Each set can have Reps, Weight, or other parameters
- **State Tracking**: Each set has its own checkbox state (pending, in progress, completed, skipped)
- **Editable Values**: Wrap values in brackets `[value]` to make them editable
- **Units**: Add units after values, e.g., `Weight: [185] lbs` or `Reps: [10] /arm`

## Parse/Serialize Behavior

- When parsing, each exercise automatically creates a default set from any exercise-level params (for backward compatibility)
- Exercise-level params now typically contain `Duration` for timed exercises
- Set-level params contain the actual exercise data (Reps, Weight, etc.)
- When serializing, exercise header comes first, followed by indented sets

## "+ Set" Button

When you click "+ Set" during a workout:
1. The current set is marked as completed
2. A new pending set is added to the same exercise
3. You can modify the reps/weight values for the new set
4. The "+ Next" button will move to the next exercise when all sets are done
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Track your workouts directly in Obsidian with interactive timers, editable value
## Features

- **Timers**: Count-up for exercises, countdown for rest periods with auto-advance
- **Editable values**: Click to edit weight, reps, or duration during workout
- **Editable values**: Click to edit weight or reps during workout
- **Add Set / Add Rest**: Quickly add extra sets or rest periods on the fly
- **Skip / Pause / Resume**: Full control over your workout flow
- **Copy as Template**: Reuse completed workouts as templates
Expand All @@ -25,7 +25,7 @@ The easiest way to install and keep the plugin updated, especially useful for mo
1. Install the [BRAT](https://github.com/TfTHacker/obsidian42-brat) plugin from Obsidian's Community Plugins
2. Open BRAT settings (Settings → BRAT)
3. Click "Add Beta plugin"
4. Enter: `https://github.com/ldomaradzki/obsidian-workout-log`
4. Enter: `https://github.com/erikparra/obsidian-workout-log`
5. Enable the plugin in Settings → Community Plugins

BRAT will automatically check for updates and notify you when new versions are available. Perfect for mobile users who can't manually copy files!
Expand All @@ -51,10 +51,15 @@ startDate:
duration:
restDuration: 45s
---
- [ ] Squats | Weight: [60] kg | Reps: [10]
- [ ] Rest | Duration: [45s]
- [ ] Bench Press | Weight: [40] kg | Reps: [8]
- [ ] Plank | Duration: [60s]
- [ ] Squats
- [ ] Weight: [140] lbs | Reps: [5] | Rest: 45s
- [ ] Weight: [120] lbs | Reps: [8] | Rest: 45s
- [ ] Weight: [100] lbs | Reps: [10] | Rest: 45s
- [ ] Bench Press
- [ ] Weight: [100] lbs | Reps: [10] | Rest: 45s
- [ ] Weight: [100] lbs | Reps: [8] | Rest: 45s
- [ ] Weight: [100] lbs | Reps: [4] | Rest: 45s
- [ ] Plank | Duration: [60s] | Rest: 45s
```
````

Expand All @@ -70,10 +75,17 @@ restDuration: 45s
| `restDuration` | Default duration for "+ Rest" button |

### Exercise Format
#### Single Set Exercise

```
- [ ] Exercise Name | Key: [value] unit | Key: value
```
#### Multi Set Exercise
```
- [ ] Exercise Name
- [ ] Key: [value] unit | Key: value
- [ ] Key: [value] unit | Key: value
```

- `[ ]` pending, `[\]` in progress, `[x]` completed, `[-]` skipped
- `[value]` = editable, `value` = locked
Expand Down
85 changes: 85 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
export default {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/src'],
testMatch: ['**/*.test.ts'],
moduleFileExtensions: ['ts', 'js'],
testPathIgnorePatterns: ['src/timer/manager.test.ts'],
moduleNameMapper: {
'^obsidian$': '<rootDir>/src/__mocks__/obsidian.ts'
},
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/**/*.test.ts',
'!src/main.ts',
'!src/timer/**'
],
coverageThreshold: {
global: {
branches: 75,
functions: 70,
lines: 88,
statements: 88
},
'src/parser/exercise.ts': {
branches: 85,
functions: 100,
lines: 95,
statements: 95
},
'src/parser/metadata.ts': {
branches: 90,
functions: 100,
lines: 100,
statements: 100
},
'src/parser/index.ts': {
branches: 90,
lines: 100,
statements: 100
},
'src/serializer.ts': {
branches: 60,
functions: 85,
lines: 83,
statements: 83
},
'src/file/updater.ts': {
branches: 89,
functions: 100,
lines: 99,
statements: 99
},
'src/renderer/header.ts': {
branches: 80,
functions: 100,
lines: 90,
statements: 90
},
'src/renderer/emptyState.ts': {
branches: 80,
functions: 100,
lines: 90,
statements: 90
},
'src/renderer/controls.ts': {
branches: 75,
functions: 80,
lines: 85,
statements: 85
},
'src/renderer/exercise.ts': {
branches: 80,
functions: 60,
lines: 85,
statements: 85
},
'src/renderer/index.ts': {
branches: 70,
functions: 40,
lines: 85,
statements: 85
}
}
};
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"id": "workout-log",
"name": "Workout Log",
"version": "1.1.1",
"version": "1.1.3",
"minAppVersion": "1.5.0",
"description": "Render workout blocks as interactive trackers with built-in timers.",
"author": "Lukasz",
"author": "erikparra",
"isDesktopOnly": false
}
Loading