Commit Graph
498 Commits
Author SHA1 Message Date
Duarte Santos 4e27461b7e Effort per set: RIR or RPE, whichever scale you think in
The RIR column becomes a three-way setting (Off / RIR / RPE). Both scales
measure the same judgement from opposite ends — RPE 8 is RIR 2 — so they
share one column and one stepper, but keep their own field on the set.

A set is never silently rewritten into the other scale: switching the
setting changes what new sets ask for, and old sets still read back with
the scale they were logged with.

Profiles carrying the old showRir boolean keep their column (effortOf
falls back to it until the new setting is chosen), so a backup or another
device that still has the flag does not lose the column.

The steppers now know the scale: the first + lands on a typical working
set (RIR 2 / RPE 8) instead of the end of the scale, and typed values are
capped at 10 — there is no RPE 12.
2026-07-30 23:35:47 +02:00
Duarte Santos fa978a1bb4 Merge PR #21: optional RIR column on reps-mode sets
octaviodimarco's RIR (reps in reserve) stepper for reps-mode sets, opt-in under
Settings → Units & timer, plus a fixup for the leftover RIR-0 stamp and the
header alignment.
2026-07-30 19:53:21 +02:00
Duarte Santos c08381e558 RIR: an unlogged RIR stays unlogged, and the header lines up
A set that never had an RIR could still end up carrying one: NumberField mapped an
empty field to 0 and the − button clamped to 0, so one stray tap stamped '(RIR 0)' —
went to failure — on the set for good, in history and in backups, with no way back.
An optional field now clears to null (the key is dropped), and stepping down from
empty leaves it empty. A typed 0 still logs a real 0.

The row's three-stepper sizing also has to reach the header, or the labels sit up
to 5px off the columns they name.
2026-07-30 19:53:14 +02:00
Octavio Di Marco c5172d0633 i18n: add RIR strings to all 11 language packs
t('RIR') and the new Settings toggle label had no entries in
src/locales/ — RIR itself is kept as the acronym across languages
(same treatment as 1RM), only the surrounding label text is translated.
2026-07-30 19:20:00 +02:00
Octavio Di Marco c3929b0a70 Remove RIR auto-check; gate the column behind a setting
Two blockers from review:

- NumberField.commit() fires onChange on every keystroke, so typing
  a decimal RIR (e.g. 1.5) committed the auto-check after the first
  character, before the value was finished — and the same auto-check
  turned a stray tap on an empty field's "−" (or clearing it) into a
  permanent "RIR 0", since 0 is indistinguishable from unset once the
  key exists on the set. Logging RIR is back to a plain field with no
  side effect; the checkbox is the only way to mark a set done, same
  as weight and reps.

- The RIR stepper narrowed every reps-mode row's +/- buttons for
  everyone, including the majority not running an RIR-based program.
  It's now behind a `showRir` setting (Settings → Units & timer,
  default off), so the existing row is untouched unless opted in.
2026-07-30 19:20:00 +02:00
Octavio Di Marco eb582e3c7b Auto-check a set when its RIR is logged
Logging RIR is naturally the last thing you do for a set — by the
time you're rating how many reps you had left, you've already
finished it. Editing the RIR field (typing or the +/- stepper) now
checks the set off itself, same beep/vibrate/rest-timer as tapping
the checkbox by hand, so that's one less tap per set.

Weight and reps are unaffected — those are often set before the set
is performed (pre-filled targets), so editing them shouldn't imply
it's done. Guarded by !s.done so re-editing RIR on an already-done
set (e.g. a correction) doesn't re-fire the toggle side effects.
2026-07-28 22:45:28 +02:00
Octavio Di Marco 6714b16e6a Add optional RIR (reps in reserve) to reps-mode sets
Adds a third stepper column, next to weight and reps, for logging RIR
on strength sets — not shown for cardio or timed holds, where it has
no meaning. RIR is purely a logging/display addition: it never
touches the progression engine (linear/Greyskull/double progression
only ever read weight/reps/seconds), and it round-trips through the
existing whole-object backup export/import with no code changes there.

The set object only gains an `rir` key once the user actually logs a
value (buildSets/addSet don't pre-seed it), matching how missing
fields already read as undefined elsewhere in the store — no schema
version or migration needed for existing logged workouts.

Fitting a third stepper next to weight+reps on narrow phones needed
the same treatment as the exercise-config sheet's three-steppers-in-a-row
(.cfgrow): narrower buttons and a smaller value font just for rows
that show RIR, verified by hand at 360-390px with edge-case values
(2-3 digit weight, double-digit reps, decimal RIR together).

"Last time" summaries now append "(RIR n)" when a set has one logged,
covered by new setLabel tests including the rir: 0 case (0 is a valid
RIR and must not be treated as absent).
2026-07-28 17:10:03 +02:00
Pengboi 6aaf2a3eea Comments: trim to the established cadence
The MCP code came in with 5–8 line file headers, JSDoc on every
one-line wrapper, and inline explanations that referenced the PR
itself ("so the MCP server can reuse it") — none of which matches
api/server.js or frontend/src/lib/, where comments are one-line,
fact-shaped and never mention the change that introduced them.

Trimmed across mcp/src/*.js, i18n-core.js, i18n.js, exercises.js,
format.js, mcp/test/tools.test.js, mcp/vitest.config.js and
mcp/README.md. Tool prefaces lost their numbers; duplicate fs.watch
rationale folded into one; the ASCII import diagram in the README
replaced with a paragraph; the cross-references and self-references
removed. Also fixed two real defects: a corrupted Cyrillic word in a
state.js comment and a missing space in a tools.test.js comment.

No code changes; 92 frontend + 32 MCP tests still pass.
2026-07-26 19:47:52 +01:00
Pengboi 4143ab8676 Tests: Stryker mutation testing on the MCP handlers
Adds Stryker 9.6.1 as a devDep and a .stryker.conf.json scoped to the three MCP-only
modules (src/state.js, src/labels.js, src/tools.js). The reused pure lib in
frontend/src/lib/ is deliberately excluded — it has its own 92-test vitest suite, and
mutating it here would just re-test it under a different label.

Two non-obvious config choices, both learned the hard way:
 · inPlace: true. Stryker's default copies the project to a sandbox, but the MCP test
   file imports "../../frontend/src/lib/*.js" — a relative path that breaks the moment
   the source is moved. inPlace mutates files where they live, keeps a backup in
   .stryker-tmp/backup-*/ during the run, and restores on exit. Verified: after the
   run, `git diff` shows no changes and all 92+32 tests still pass.
 · vitest.related: false. The vitest runner's related-files mode uses static import
   analysis to pick which tests to run per mutant; it can't see the cross-directory
   imports and reported "no tests were found". Disabling it means every mutant runs
   the full suite — slower (~54s for 847 mutants) but accurate.

Baseline first run: 39.32% mutation score (333 killed, 330 survived, 184 no-coverage).
Most of the survivors are zod schema string literals (the unit suite bypasses the SDK's
validation by calling handlers directly), and the bulk of the no-coverage debt lives in
state.js — file watching, multi-user resolution and the mtime fallback paths. The HTML
report at mcp/reports/mutation/mutation.html (gitignored, regenerated per run) shows
each survived mutant inline.

Run with `npm run mutation:test` from mcp/.
2026-07-26 19:34:15 +01:00
Pengboi 92914dea43 MCP: read-only stdio server for LLM apps to query workout history
A Model Context Protocol bridge that lets an external LLM application (Claude Desktop,
Cursor, Cline, Continue, …) read a user's openGym profile directly from ./data — no new
container, no extra auth, no third-party service. The LLM client spawns the server
locally as a stdio process (per the official MCP model); reads the same state-<uid>.json
the api server writes; reuses the pure training helpers from frontend/src/lib/*.js so
the numbers it answers with match what the Stats screen shows exactly.

Eight tools in v1, all read-only:
 · list_routines, get_routine — names + exercise counts + per-exercise targets
 · get_week_plan — Mo/We/Fr assignments and today's routine, accounting for any
   date-specific overrides (a "rest" override cancels the day)
 · list_workouts, get_workout — newest-first session summaries + per-set breakdown
 · get_bodyweight — weigh-ins with the goal line and signed deltas vs goal
 · estimate_1rm — Epley/Brzycki/Lombardi formulas, all-time best + trend per exercise,
   or a PR table across all reps-mode exercises
 · muscle_balance — which muscles are trained vs neglected over a week/month/all window

State is read with fs.watch (mtime fallback for platforms where watchers are flaky) so
the server reflects a session the web UI just finished without a restart. No passkey
material, VAPID keys, or session secrets ever cross the boundary — handlers only ever
serialize fields from the state object plus the user's name from db.json.

The MCP server has exactly one runtime dependency beyond the SDK: none. zod is the SDK's
transitive; vitest and Stryker are devDeps only. Tests run against the demo seed fixture
(demoSeed.js) — 32 cases pinning the JSON shape and the most user-facing edge cases
(empty state, missing routine, rest-day override, zero-workout muscle_balance, three
1RM formulas, superset links, timed/cardio set labels).
2026-07-26 19:34:09 +01:00
Pengboi fadeb17b6c i18n: split the pure core out so the lib is Node-loadable
The pure training helpers (history, progression, onerm, muscles, format, exercises) are
deliberately self-contained — that is what lets them ship with their own vitest suites and
got them reused across the React and mobile builds. They were one Vite-only call away from
being loadable from plain Node too: `import.meta.glob` for the lazy locale packs, run at the
top of i18n.js. Anything that imported `t` or `dateLocale` via the chain (i.e. every helper
in src/lib) inherited the dependency.

Splitting the runtime-agnostic state, constants and readers (t, dateLocale, instrFor, getLang,
LANGS, INSTR_LANGS, DATE_LOCALES) into i18n-core.js lets plain Node require them. i18n.js
keeps the Vite-only bits (the async setLang that lazy-loads locale packs via import.meta.glob
and the React subscription hook useLang) and re-exports everything from core, so none of the
23 existing import sites change.

exercises.js had one direct `import.meta.env` access for IMG_BASE/GIF_BASE — guarded with
`?.` so the module resolves without Vite present. format.js and exercises.js import i18n-core
directly; everything else still imports i18n.js.

No public exports changed. 92/92 vitest tests pass; vite build still code-splits the locale
packs the same way.
2026-07-26 19:34:01 +01:00
Duarte Santos ab0c98ba85 Android: versionCode 3 for the v1.2.2 APK
Same versionName — v1.2.2 was never published, so this is still that release — but the code
has to increase strictly or Android refuses to install over the build already out there.
v1.2.2
2026-07-25 15:05:12 +02:00
Duarte Santos b15f7d9ec4 Release v1.2.2: docs, changelog and website for everything since v1.2.1
v1.2.2 was tagged but never published, so by the versioning rule everything since the last
published release — v1.2.1 — belongs in this one number: the mobile app, the importer, plan
sharing, the QA fix series, and now timed sets, progression rules and estimated 1RM.

The changelog was missing plan sharing and the fix series entirely; both are written up
here rather than left to the git log.
2026-07-25 15:00:43 +02:00
Duarte Santos 5c846b92d5 i18n: the new strings in all 11 language packs
49 keys per pack, 572 in total. The progression rules explain themselves in prose, so most
of these are full sentences rather than labels — a rule you cannot read is one you will
not trust, in any language.
2026-07-25 14:58:48 +02:00
Duarte Santos c248ca3bae The screens for timed sets, progression and estimated 1RM (#16 #17 #18)
Where the three features surface:

 · Routine editor — a progression rule for the whole routine, and per exercise a
   Reps/Time switch, an optional rule of its own and the step it moves in.
 · Workout — timed sets get a start button and the work-timer bar; every exercise says in
   one line why its target is what it is ("every rep last time — 2.5 kg more", "missed
   reps 3 sessions running — reset to 55 kg"). The weights are already right when the
   session opens rather than being suggested afterwards, which is what the old bump-hint
   button did.
 · Stats — the exercise curve switches between top set and estimated 1RM, and names the
   set the estimate came from. Timed exercises chart the longest hold.
 · Exercise detail — an estimated 1RM from your log plus a calculator for a set you have
   not done yet, so the number is reachable before there is any history.
 · Finish summary — a new best estimated 1RM is reported separately from a weight PR.
   Same weight for more reps is progress, but it is not a heavier lift.

Saving an exercise now replaces its config rather than merging into it, so switching back
from time to reps cannot leave a stale duration behind.
2026-07-25 14:58:42 +02:00
Duarte Santos 8e1d3b96a6 Automatic progression: named rules instead of one hard-coded hint (#17)
The old rule was a single line: all reps done, suggest 2.5 kg more. No rep ranges, no
AMRAP, no idea what to do after a bad session. This replaces it with a small set of
policies — linear, Greyskull LP, double progression, and adding time for timed work —
picked per routine and overridable per exercise.

Every function is pure and derives the next target from the log each time it is needed.
Nothing is written back into a finished workout and no counters are stored, so correcting
a mistyped set immediately produces the right next target.

Reading a session honestly is the whole point. Short reps count as a miss even when the
set was checked off; an unchecked set counts as a miss because it was not performed. A
session that fell apart can never advance the load as though it had succeeded.

Two cases the naive version gets badly wrong, both found against real data:

 · Workouts only started recording their prescription in this version. Judged against
   nothing, every past session scores as a miss — the demo history produced "missed reps
   11 sessions running, deload", and every existing user would have been greeted with the
   same on their first session after updating. Targetless history is judged against the
   exercise's current plan instead, which is what the old hint compared against.

 · Bodyweight work has no load to take off. "Reset your push-ups to 2.5 kg" is not advice,
   so with no external weight the rules progress in reps and leave the load alone.
2026-07-25 14:58:31 +02:00
Duarte Santos ec46c7e20d An exercise can be logged by time instead of reps (#16)
Until now the logging model came from the body part alone: cardio meant duration, and
everything else meant weight × reps. A plank, a hang, a wall sit or a loaded carry could
only be timed by filing it under cardio, which then put it in the wrong charts.

A routine entry can now say so itself — reps, time or cardio. Entries without a mode keep
behaving exactly as before, so every existing plan, workout and shared plan file is read
unchanged and nothing needs migrating.

Timed sets get a work timer that counts the set itself, kept deliberately separate from
the rest timer: the two mean opposite things and must never run together. Finishing early
logs the time actually held, not the target, because crediting a full 45 seconds for a
38-second hold would quietly corrupt the log it exists to keep.

Finished workouts now also store what the session prescribed. Without it, history cannot
say whether a session hit its reps, and a timed session reads back as "0 reps".
2026-07-25 14:58:20 +02:00
Duarte Santos a54bad2641 Estimated 1RM: the calculation, and only from sets that can support it (#18)
Working out how strong a set was meant leaving the app. Epley by default, with Brzycki
and Lombardi available and documented.

Two things it deliberately refuses to do:
 · guess above 12 reps, where the formulas disagree by double digits and the answer says
   more about work capacity than about maximal strength;
 · read `topW`, the working weight you confirm after an exercise — it carries no rep
   count, so it cannot produce an estimate at all.

It also knows nothing about the exercise database. An estimate needs a weight AND reps,
and only reps-mode sets carry both, so cardio and timed sets drop out of every scan on
their own rather than through a type check that would need keeping in sync.
2026-07-25 14:58:10 +02:00
Duarte Santos 0818f1b32b Tests: a runner for the pure helpers
The logic that decides what you lift next has no business being verified by hand in a
browser. Vitest is a dev dependency only — the app itself stays dependency-free.
2026-07-25 14:58:01 +02:00
Duarte Santos 62a0b00fbb i18n: the new strings in all 11 language packs
Twelve keys for the plan-import notice, the mixed-unit warning, the
singular counts, the weigh-in button and the error boundary, anchored
next to the strings they belong with. Drops 'Skip today' and
'{0} routines · {1} exercises', which the code no longer uses, and
retunes the German streak line ('13 Wochen in Folge').

All packs stay at the same key count.
2026-07-24 23:45:43 +02:00
Duarte Santos 827c0f8505 UI fixes found while testing the workout flow
· The rest timer floats above the tab bar, so it covered the set rows
  underneath it — during a rest, the next set was behind the bar. The page
  now gets enough bottom padding while a rest runs to scroll clear of it.
· "Skip today", sitting right under "Save & start workout", reads like
  skipping the session rather than the weigh-in. It says "Start without
  weighing in".
· The calendar legend drew "Planned" in blue while planned days have
  always had a grey dot.
· Body weight showed "− 0" when it hadn't moved since the last weigh-in.
· In a superset both exercises are on screen at once, so their animations
  give way: 180px meant scrolling a full screen between two exercises you
  are meant to alternate.
2026-07-24 23:45:36 +02:00
Duarte Santos 43d5495007 Import from other apps: convert weights per row, not per file
The unit was decided once for the whole file: if any row said lb and none
said kg it converted, otherwise it did nothing. FitNotes writes the unit
next to every set, so a history recorded partly in pounds and partly in
kilos hit the 'otherwise' branch — the file was taken over unconverted
and "185 lb" was logged as 185 kg, while the summary claimed the file
does not say which unit it uses.

Each row now carries its own unit through to the conversion (falling back
to the file's, then to the profile's), and a mixed file says so in the
preview.

Also: the "exercises matched" tile counted matched rows, so three
exercises across five sets read as five. It counts distinct exercises
now, which is what the label says.
2026-07-24 23:45:17 +02:00
Duarte Santos 3d5b00cecd A shared plan file can no longer take the app down
Importing a plan whose exercise ids this build doesn't know — a
hand-edited file, an export from a build with a different dataset — put
those ids straight into a routine. The routine editor skipped them
silently (you could neither see nor delete them), and starting the
routine reached for ex.n on undefined: white screen, no tab bar, no way
back. The running workout is persisted, so it came back on every reload.

Three layers, so this class of bug can't reach the screen again:

  · parsePlan() drops ids that resolve to neither the library nor a
    custom exercise carried in the same file, and the import sheet says
    how many were left out.
  · exOr() renders an unresolvable id as a placeholder, so the routine
    editor shows it (and lets you remove it) instead of hiding it, and
    the workout view survives one.
  · an ErrorBoundary around the routes: it keeps the tab bar alive,
    offers a reload, and can discard a running workout that can't be
    drawn. It is keyed on the route, so switching tabs clears it.

Turning the schedule switch on now really replaces Mon–Sun, as the
switch has always claimed. It only wrote the days the shared plan filled,
so days it left empty kept your own routine and you silently ended up
training a mix of two plans.

Also here, because they sit in the same lines: the tags that carry a unit
or a whole sentence opt out of the capitalise rule ("Best: 85 Kg", "Last
Time You Hit All Reps"), and the workout header's "best" now includes the
working weight you confirmed, so it agrees with the sheet that asked for
it.
2026-07-24 23:45:04 +02:00
Duarte Santos c8a68e37e1 Numbers follow the UI language, volume stays in your own unit
fmtNum was pinned to en-CH, so every user in every one of the twelve
languages got Swiss apostrophes: "7'535 kg". It now uses the same locale
as the dates.

fmtVol turned anything over 10 000 into tonnes regardless of the profile's
unit — "18.8t" is meaningless for a pound profile, and inside one history
list "18.8t" next to "7'535 kg" is two numbers you can't compare. Volume
is now always shown in the unit you train in.

The weight slider's ceiling of 300 was a kg number applied to both units;
in pounds it cut off at 136 kg, below plenty of people's body weight and
well below an everyday squat. It now follows the unit.

Also: a shared exCount() so "1 exercises" reads "1 exercise", and
durPart() so imported workouts (which carry no clock) stop claiming
"0 min".
2026-07-24 23:44:20 +02:00
Duarte Santos 238b435c2b i18n: translate plan-sharing strings into all 11 languages
24 new plan-share/PDF strings added to every locale pack (513 keys each),
anchored on each pack's existing terms (routine/exercise/import/week).
2026-07-24 01:22:09 +02:00
Duarte Santos af9289dcd9 Plan sharing: export/import a plan file + printable PDF
New "Share your plan" action in the Plan header (lib/plan-share.js):
- Export plan file: a small JSON with just your routines, the week schedule and any
  custom exercises they use — a friend imports it into their own openGym. Import
  merges (adds routines with fresh ids, dedupes customs by name+body part, optional
  "use this schedule"), so nothing they already have is overwritten.
- Print / Save as PDF: a clean, one-page-per-plan printout rendered in a hidden
  iframe; break-inside:avoid keeps every exercise (and each routine that fits) whole,
  so an exercise never splits across a page.
2026-07-24 01:12:07 +02:00
Duarte Santos 211fb86480 Icons: full-strength glyphs in the routine icon picker
The pickable routine icons were painted at --label-2 (60%), so the whole picker
looked faded when creating/editing a routine. Bring them to full --label; the
selected cell stays accent-on-accent.
2026-07-23 23:28:47 +02:00
Duarte Santos 6f557399b1 Icons: render at full strength everywhere, drop the muted-grey chrome
Follow-up to the opacity removal: the remaining faded icons were muted by colour,
not opacity. Bring list chevrons (.chev) and row icons (.lrow-c) from --label-3 up
to full --label, and lift the empty-state icon to its caption strength (--label-2).
Semantic colours (accent/orange/yellow/green) are left untouched.
2026-07-23 23:23:43 +02:00
Duarte Santos 17c2324f74 Icons: drop the opacity fade on tab-bar and tile icons
The .3/.32 opacity made those icons look washed-out/see-through. Remove it; the
active/inactive tab distinction still reads via colour (label vs accent) and the
heavier stroke on the active tab.
2026-07-23 23:12:49 +02:00
Duarte Santos 41f17934a9 Icons: redraw abs and pullup so strokes stop crossing through each other
The hollow line icons showed overlapping strokes through their transparency:
- abs drew full-width crease lines through a full-height centre line (a see-through #);
  now a six-pack whose centre seam runs the gap between crease pairs, no crossings.
- pullup's head circle sat on the arm-V apex; lifted it clear so the body no longer
  reads as tangled lines behind a transparent head.
2026-07-23 23:08:50 +02:00
Duarte Santos df91727dcf Website: milestones timeline builds itself from published GitHub releases
No more hand-maintained history on the about page — site.js renders one
timeline entry per published release (title, date, first paragraph of
the notes, link). Static entries remain only as an offline fallback.
2026-07-23 15:58:06 +02:00
Duarte Santos ae399cd1dd Website: fix screenshot aspect ratio, embed the live demo, GitHub button in hero
The screenshot img tags carry width/height attributes; with only a CSS
width the height attribute won (240x2532 — stretched). height:auto fixes
it. New #demo section runs the GitHub-Pages demo in a phone frame right
on the page; nav gets a Demo link and the hero a GitHub star button.
2026-07-23 15:54:25 +02:00
Duarte Santos becd2357ff Project website + one icon everywhere
website/ holds the source of opengym.duarte-santos.ch — landing with live
GitHub stats, docs and the story behind the app; no build step. The
native app icons are now generated (capacitor-assets) from the same
blocky dumbbell as the PWA icon, traced into resources/icon.svg, so the
APK, home-screen PWA, and website favicon all match.
2026-07-23 15:49:21 +02:00
Duarte Santos 768dee50ca Release v1.2.2: history import, standalone mobile app, APK distribution
Consolidates everything since v1.2.1: the FitNotes/Strong/Hevy/Apple
Health importer, the Capacitor-based standalone mobile flavor, and the
store-free distribution story — signed Android APK from
opengym.duarte-santos.ch, docs corrected to match (no store listings;
iOS via self-hosted PWA or Xcode free signing).
2026-07-23 15:36:05 +02:00
Duarte Santos 4888fed0c4 Android: version 1.2.1 in the app manifest 2026-07-23 15:28:06 +02:00
Duarte Santos ee2be743b0 Standalone mobile app: Capacitor shells for iOS and Android
A second flavor of openGym (VITE_MOBILE=1) that runs entirely on the
phone: no account, no server, no sync. State is mirrored into a file in
the app's private storage (survives WebView storage eviction), the
workout-day reminder is a native local notification scheduled on planned
weekdays, and backups export through the OS share sheet. Exercise media
loads from the same CDN as the demo build. npm run build:mobile, then
Android Studio / Xcode — see docs/MOBILE.md. NOTICE.md gains an AGPL §7
app-store exception.
2026-07-23 15:14:36 +02:00
Duarte Santos 389315625c Import history from FitNotes, Strong, Hevy and Apple Health
Losing years of logging is the thing that stops people trying another
tracker, so Settings -> Data -> Import from another app now reads their
exports directly.

All of these ship the same thing in a different dialect: one row per set
with a date, an exercise name and some mix of weight/reps/distance/time.
So the parser builds a column map from the header rather than assuming
positions, and a new app is usually a few header aliases. Verified
against real exports from Strong (1903 sets) and Hevy, both FitNotes
column layouts, and an Apple Health body-mass extract.

Exercise matching is the part that decides whether this is useful.
Parenthetical qualifiers and BB/DB shorthand are normalised, names are
compared as an order-independent bag of words, and a curated table maps
the plain names people actually log onto the dataset's qualified ones -
without it, 'Squat' resolved to 'weighted squat' and 'Leg Press' to
'smith leg press'. Where a name stays genuinely ambiguous it is left
unmatched and becomes a custom exercise rather than guessed at: filing
years of training under the wrong lift is worse than a name the user can
see and fix. Nothing in the file is ever dropped.

A summary sheet shows workouts, sets, matches, misses and any unit
conversion before anything is written, and merging skips days that
already have data, so importing twice - or from two apps - never
duplicates a workout.
2026-07-23 14:50:36 +02:00
Duarte Santos fac45f9af9 Release v1.2.1: muscle map and live demo
Consolidates everything since v1.2.0 into one version: the muscle map
(Stats balance card, routine preview, finish screen, male/female body
diagram), the browser-only GitHub Pages demo, and the fix for the blank
screen when finishing a workout from its last exercise.

api/package.json tracks the release alongside the frontend.
v1.2.1
2026-07-23 12:56:52 +02:00
Duarte Santos cd77cfdd84 Muscle map: see which muscles your training actually reaches
A front-and-back body diagram, shaded with the same accent ramp as the
activity heatmap, in three places: Stats gets a Muscle balance card over
a week / 30d / 90d / all-time window, the routine editor previews what a
session hits while you build it, and the finish screen shows what you
just trained. Settings switches between a male and female figure.

The Stats card's real job is the list underneath: the muscles that got
nothing in the period. Load is counted in effective sets — full weight
for an exercise's target muscle, partial for its supporting ones — not
kilograms, since 100 kg of leg press and 12 kg of lateral raise say
nothing about which muscle worked harder. Shading is relative within the
window, so it always reads as a balance rather than an absolute.

The dataset spells muscles inconsistently ('delts', 'deltoids' and
'shoulders' are one muscle); all 50 spellings it uses are normalised onto
the 18 the diagram draws, verified against the full catalogue so nothing
is dropped silently. Custom exercises fall back to their body part.

Geometry is converted from MuscleMap (MIT, see NOTICE.md), which ships
its paths as Swift source rather than .svg. At ~90 kB it is imported
dynamically, so the initial bundle is unchanged.

Also fixes a crash this surfaced but did not cause: finishing a workout
from its last exercise blanked the whole app, because the per-exercise
weight sheet read the running workout without checking it was still
there and finishing clears it while that sheet is on screen.
2026-07-23 12:51:24 +02:00
Duarte Santos e9bf38f39b Publish a browser-only demo to GitHub Pages
Self-hosting is a fair ask once someone knows they want the app, but it's a lot
to ask of someone deciding whether to look at it at all. A demo build (VITE_DEMO=1)
drops the parts that need the backend — passkeys, sync, admin — and boots straight
into guest mode with a seeded example profile, so every screen has real data behind
it: twelve weeks of Push/Pull/Legs with progression and the odd missed session,
twice-weekly weigh-ins trending toward a goal, PRs, and today's session moved onto
the current day so there's always something to press Start on.

The seed generator is imported dynamically and the demo-only UI folds away at build
time, so none of it lands in the bundle self-hosters ship. Exercise media (~140 MB)
isn't committed anywhere, so the demo build points VITE_IMG_BASE / VITE_GIF_BASE at
the upstream dataset on jsDelivr, pinned to a commit; unset, both still resolve to
img/ and gif/ next to the app exactly as before.

Deployed by a Pages workflow on every push to main.
2026-07-23 12:42:40 +02:00
Duarte Santos 3c5bcd5957 Refresh README, self-hosting docs and dependencies for v1.2.0
Screenshots were still from the old design — all five regenerated from a
seeded three-month history.

The feature list had been behind since v1.1.0: push notifications and the
workout-day reminder were never listed, nor were custom exercises, the
equipment filter or the admin dashboard. ADMIN_UIDS and INVITE_ONLY were
documented in .env.example but missing from the README config table, and
docs/SELF_HOSTING.md still claimed there was no admin/invite system by
design — it now explains how to turn one on.

api/package.json version was lagging at 1.1.1; it tracks the release now.
React and @vitejs/plugin-react picked up their patch releases (lockfile
only, no manifest change); api dependencies were already current and both
trees audit clean.
v1.2.0
2026-07-23 12:07:10 +02:00
Duarte Santos b28a58930c Release v1.2.0: complete visual redesign
Rebuilt design system (one type scale, neutral surface ramp, hairline
separators), a 77-icon hand-drawn set replacing every emoji in the UI,
grouped routine-icon picker with the old emoji mapped forward, new tab
bar with a raised Start/Resume button, and a reorganised Home.

Chart fixes that came out of it: axis labels, gridlines and the target
line were painted with colour variables the new sheet no longer defines
and fell back to black-on-black; the hover readout is now placed from
its measured size so it can't be clipped at the edges, and it clears
when the pointer leaves the chart.
2026-07-23 11:55:52 +02:00
Duarte Santos fc36476a5f Release v1.1.3: consolidate all work since v1.1.2
v1.1.2 is the last published release; v1.1.3 and v1.1.4 were tagged but
never released. Collapse those two plus the equipment filter and the rest
timer fix into a single v1.1.3 changelog section, grouped into 'Admin
dashboard' and 'Exercises & workout'. Set frontend/package.json to 1.1.3.

Covers #12, the admin dashboard (phases 1+2), #6 and #14.
v1.1.3
2026-07-22 14:52:32 +02:00
Duarte Santos fbf125f6a2 Filter exercises by equipment (#6)
Adds an equipment filter row under the body-part chips, in both the
Exercises library and the exercise picker sheet.

The options are derived from the exercises already matching the current
body part and search, ordered most-common-first, so the row stays short
instead of listing all 28 equipment values (many with a single exercise)
and every combination on screen has results behind it. The row hides
itself when there is nothing to choose between.

Changing the body part clears the equipment filter; a search that
narrows the chosen equipment away drops it rather than showing an empty
list. All equipment terms were already localized — only the new 'Any
equipment' label needed adding across the 11 locale packs.

Closes #6
2026-07-22 14:44:27 +02:00
Duarte Santos 33317dac91 Fix rest timer freezing at 0:01 (#14)
The tick callback shadowed the imported i18n helper `t` with the timer
object, so the final tick threw a TypeError on t('Rest over — next set!')
before reaching stopRest(). The interval kept running and re-throwing, the
display stayed on the last value it wrote, and the pending server-side
'rest over' push was never cancelled.

Closes #14
2026-07-22 14:44:15 +02:00
Duarte Santos f3ba05aece Admin dashboard (phase 2): live 'training now' heartbeat + release v1.1.4
Backend: in-memory presence map + POST /api/activity heartbeat (authed);
each /api/admin/users row carries a fresh 'live' snapshot (routine,
exercise x/y, sets done/total, started-at) with a ~70s TTL. Disabling a
user clears their presence immediately.

Frontend: the workout screen pings /api/activity every 20s (signed-in
only) and sends a leave signal on unmount (fetch + sendBeacon). The
dashboard gains a 'Training now' section and live markers, auto-
refreshing every 15s.

Cuts the complete admin-dashboard feature (phases 1+2) as v1.1.4.
2026-07-22 02:06:19 +02:00
Duarte Santos 046217079c Admin dashboard (phase 1): users, disable, invite-gated signup
Adds an operator dashboard for self-hosters, gated on a passkey-
authenticated admin flag (ADMIN_UIDS env) and enforced server-side.

Backend:
- ADMIN_UIDS / INVITE_ONLY env (both off by default, OSS-friendly).
- Invite codes in db.json; /api/register gated when INVITE_ONLY, code
  burned on successful signup.
- disabled users are rejected by readSession — locked out everywhere.
- /api/admin/{users,user,user/disable,invites,invites/new,invites/revoke}
  behind an admin guard; /api/config exposes invite_only to the login UI.
- admin flag surfaced on /api/me, register/verify, login/verify.

Frontend:
- New /admin route + Settings link, shown only to admins: user list with
  workout counts and last-sync, disable/enable, invite generation, and a
  per-user workout-history drill-down.
- Registration sheet shows an invite-code field when the instance is
  invite-only.

Phase 2 (live 'training now' via a heartbeat) is separate.
2026-07-22 01:58:33 +02:00
Duarte Santos dabffdebc0 Minimize the exercise animation during a workout (#12)
Adds a persistent minimize/expand toggle to the workout animation so the
set rows are reachable without scrolling past a full-height GIF. A new
S.gifSize setting ('full' | 'mini') is flipped by the button, saved and
synced like other prefs, and applied across exercises and future
workouts. Tapping the animation still pauses/plays it.

Closes #12
2026-07-22 01:00:50 +02:00
Duarte Santos 785380ab1b Release v1.1.2: consolidate all work since v1.1.1
Collapse the never-released intermediate versions (custom exercises,
localization, comma fix, narrow-phone fix) into a single v1.1.2 release.
Merge their changelog sections under one v1.1.2 heading and set the
package version to 1.1.2. The confusing v1.2.0 and v1.1.3 tags are
removed in favour of a clean v1.1.2.
v1.1.2
2026-07-22 00:50:21 +02:00
Duarte Santos 91e0bd73b9 Release v1.1.3: custom exercises + comma decimal separator
Fold the custom-exercises feature (#11) and the comma-decimal fix (#13)
into a single v1.1.3 release. Merge their changelog sections and set the
package version to 1.1.3.
2026-07-22 00:38:24 +02:00