Commit Graph
369 Commits
Author SHA1 Message Date
Duarte Santos bbf46e2aa2 test: mount the note sheet for real
The note sheet was checked structurally — imports resolve, symbols exist — but
nothing ever rendered it, so a bad hook order or a wrong store path would have
reached a phone before it reached a test. This drives it through the real sheet
stack: both textareas, the pin (disabled while the note is empty, since pinning
nothing means nothing), and a save that has to land in two different places —
today's note on the entry, the standing note on S.exNotes.

The third case is the one that would have bitten: clearing the note has to drop
the pin with it, or a stale pin resurfaces a note that no longer exists.
2026-08-25 20:19:01 +02:00
Duarte Santos 69cefca19e release: v1.2.10
Version bumped in both package.json files, the lockfile's self-reference and
the Android build (versionCode 10 -> 11, so the APK installs over the last
one). Changelog covers everything since v1.2.9 in one entry, per the
project's versioning rule.
2026-08-25 20:02:28 +02:00
Duarte Santos e1c14f7ac0 i18n: translate the new strings into all 12 locales
18 strings from this release, plus the rest-pause explainer that arrived
untranslated with !20. Terminology follows each pack's existing entries
(Wdh. / rip. / powt. / повт., and the "Add warm-up set" wording already there).

pt-BR overrides 8 of them rather than inheriting: the pt-PT versions use
tu-forms and «guillemets» (tuas, podes, treinares, teres), which is exactly
what the locale's own guard test is there to catch. Inheritance fingerprint
re-baselined; the remaining 10 read the same in both variants.
2026-08-25 20:00:19 +02:00
Duarte Santos 37d6cf895a notes and planned warm-ups
Three kinds of note, because they have three different lifetimes and users
asked for all three:

  · a session note on an exercise — what happened today, stored on the workout
    entry. It carries a PIN, and that is the whole design: only the person
    writing knows whether "shoulder twinged" is a diary line or "go narrower"
    is a message to their next self. A pinned note surfaces again the next time
    that exercise comes up, where the "Last time" line already is; an unpinned
    one stays in that day's history. This is deliberately not a global setting:
    the answer differs per note, so a single switch would need constant
    flipping, while at the moment of writing it is obvious.
  · a standing note on the exercise itself (S.exNotes) — seat height, pin
    position, a form cue. True every session, shown every session. This is
    elchavalico's request, with ten messages of agreement behind it.
  · a whole-session note on the workout, editable from its history entry, where
    it is easier to say how a session went once you can see what you did.

A routine's own `note` (!14) stays where it is: it belongs to the plan, not to
the day or to the movement.

Planned warm-ups: `warmupSets` on an exercise config, stacked by buildSets
using the same ramp as the in-session button, so the session starts with them
already there instead of you adding them by hand every time. Written only when
non-zero, so an existing plan keeps its exact shape and reads back as 0. They
travel with a shared plan, and stay out of volume, records and progression via
the phase flag that already existed.
2026-08-25 20:00:10 +02:00
Duarte Santos 62b69ea88d home + stats: stop asking for a workout that is done, plot bodyweight lifts
Home's week strip already knew today was finished — its dot goes 'done' from
S.workouts — but the row underneath only ever asked `routine`, so a logged day
kept showing the routine name behind a green Start tag and read as still
outstanding (issue #4). It now reports the session instead. Tapping still
starts another one; it just stops urging.

Stats dropped every point whose value was 0, and a bodyweight pull-up has no
weight, so "Exercise progress" read "No data yet" for exercises with a full
history behind them (issue #5). When nothing in an exercise's history was ever
loaded, its progress IS the rep count, so that is what gets plotted, labelled
in reps. Add a weighted set later and it switches back to weight on its own —
which is also the honest reading, because that is when load became the thing
improving. Same fallback in currentOf, or the picker label went blank and the
exercise sorted to the bottom as if it had no history at all.
2026-08-25 19:59:50 +02:00
Duarte Santos 46eaefd2c7 css: make the tab bar opaque, and actually ship backdrop-filter to Firefox
Reported as "the navigation bar is half transparent … the information can be
harder to see as it is mixed with the background". Two separate causes.

The bar was 72% opaque. Even with the blur working that is too little to read
labels against a scrolling page, and nobody needs to read what is behind a
navigation bar. Now 94% in both themes, with the blur down from 24px to 10px:
this is a position:fixed element, so the WebView recomposites the blurred
region on every scroll frame, which is the most expensive thing on an Android
screen. Same blur reduction on the rest timer, which is on screen for a whole
session.

The second cause is worse and was invisible from the source: the CSS minifier
dedupes a `backdrop-filter` / `-webkit-backdrop-filter` pair down to whichever
is written LAST, so the standard property was being dropped from the build
entirely and only the -webkit- one shipped. Firefox understands only the
unprefixed name, so it had no blur at all — just the alpha, which is exactly
the reported symptom. All five pairs now put the prefixed line first, with a
comment so nobody tidies the order back.

Adds an @supports fallback to fully opaque where backdrop-filter is genuinely
unavailable (old Android WebViews, reduce-transparency settings), and drops
.ss-card's padding on narrow screens — a superset pays the page gutter twice
and squeezed the reps field, which socialscientist93 diagnosed exactly.
2026-08-25 19:59:50 +02:00
Duarte Santos 0863aa73fb workout: fix the warm-up weight and the missing rest after a final set
Two session bugs that users reported separately and that both sat in the
"what happens when a set ends" path.

insertWarmupRow read rows[at - 1] to find what to ramp from. For the FIRST
warm-up `at` is 0, so that is rows[-1] — undefined — and the `||` fallback
took the LAST row instead: the heaviest work set. "Add warm-up set" handed
you a warm-up at your full working weight, every time, and you corrected it
by hand. It now ramps from the first work row, each added row closing half
the remaining gap (50% / 75% / 87.5%), rounded DOWN to the exercise's own
loading step — a warm-up a notch light costs nothing, one a notch heavy is a
set you have to strip plates off. The step is passed in by the caller so
history.js keeps no dependency on progression.js, which already imports it.

Rest timers stopped at the end of an exercise: the singleton path called
stopRest() and then skipped startRest(), commented as "final sets finish
quietly". But another exercise follows that set, and you rest before it too —
a two-set exercise timed one rest instead of two (issue #3), and the rest
never carried across the gap. Supersets already had the right rule, so the
condition is now shared as restAfterSet(): rest after every completed set
except the last set of the last exercise, which is where zkssyth landed
independently in Discord.
2026-08-25 19:59:31 +02:00
Manuel bcbde6245c fix: stack exercise progress selector value 2026-08-25 17:47:52 +00:00
Duarte Santos a04a5cab52 Merge remote-tracking branch 'mrq/23' into integrate3 2026-08-25 19:29:54 +02:00
Manuel 4a614eb8ca Show calendar year in multi-year chart tooltips 2026-08-25 16:43:06 +00:00
Ameer Khan e737954e37 Import: resolve Hevy exercise names instead of inventing customs
Hevy writes the equipment in parentheses and says "bicep"/"chest fly"
where the catalogue says "biceps"/"fly", so the word-bag matcher landed
one word off. A real 34-session export arrived with 27 custom exercises
covering a third of its sets.

Three separate causes:

- SYN rewrote 'machine' -> 'lever' before 'smith machine' -> 'smith'
  could ever fire, so every Smith-machine name became "smith lever ..."
  and matched nothing in the catalogue. The two rules are order
  dependent; 'smith machine' now runs first.
- The alias table had no entry for Hevy's vocabulary. Added the names
  from a real export, mapped by hand to catalogue ids.
- Hevy exports no category column, so every invented exercise took the
  'upper legs' default and a third of an imported history was
  attributed to the legs in the muscle map. With no category to read,
  the body part now comes off the name instead.

The same export now creates 2 custom exercises instead of 27. The two
that remain, box jump and wall ball, are genuinely not in a 1,324-entry
strength catalogue, and guessing would file them under the wrong lift.

import-match.test.js covers the new aliases, the SYN ordering and the
body-part inference.
2026-08-25 15:36:25 +00:00
Duarte Santos 7d2460c2c2 Merge merge request !20 (intensifiers, pairing, theme, security hardening)
Takes the nine commits as submitted, with three adjustments:

- remote.test.js ran in the node environment while remote.js pulls in
  api.js, which reads navigator.userAgent at module scope — the file failed
  to import. Same @vitest-environment happy-dom pragma the api tests use.
- Drops skills-lock.json. It pins a personal Claude Code skill chain to
  third-party GitHub repos by hash; that is contributor tooling, not a
  project artefact, and this project's GitHub access is gone. CLAUDE.md
  itself is kept — it is an accurate description of the repo.
- Corrects two stale claims in that CLAUDE.md: the website deploys from
  .gitlab-ci.yml, not GitHub Pages, and the CI gate is GitLab, not Gitea
  Actions with a dormant GitHub copy.

pt-BR: 23 of the 44 new pt strings are European (ficheiro, telemóvel,
Definições, «guillemets», tu-forms), so they get Brazilian overrides
rather than being inherited; fingerprint re-baselined.
2026-08-25 14:28:10 +02:00
Duarte Santos 5762096a5f Merge merge request !2 (exercise catalogue and muscle metadata)
Keeps the ExRx-informed primary/secondary metadata for 223 catalogue
entries and the muscle-group UI, with two fixes to the branch:

- muscles.js dropped metadataOf, the muscleSnapshot fallback. A custom
  exercise deleted from the catalogue survives in history only as that
  snapshot, so without it those sessions silently stopped counting toward
  the body map and Stats — loadOfWorkouts returned {} where main returned
  {chest: 1}. Restored and widened to the new primaries/secondaries fields.
- It also replaced the shared isWarmupRow import with a local copy that
  only matches the exact string 'warmup'. phaseForSet normalises 'warm-up',
  'warm_up', casing and whitespace, so warm-up rows written in any other
  spelling would have counted as work here while counting as warm-ups
  everywhere else. Restored the import.

Both are covered by new tests. Locale conflicts resolved additively; the
three new muscle-group strings read the same in pt-BR, so they stay
inherited and the inheritance fingerprint is re-baselined.
2026-08-25 14:22:40 +02:00
Duarte Santos 76973edad1 Merge merge request !16 (pt-BR exercise names and instructions)
Resolves against !13 and !1: the picker and library keep the multi-token
search and the equipment-profile filter, and matchExercise now builds its
haystack from exerciseNameSearchText, so a pt-BR profile finds an exercise
by the name it actually sees as well as by the English one. The 'chosen'
sort takes !16's locale-aware localeCompare. Adds regression tests for
localized search and for cache invalidation on a language switch.
2026-08-25 14:13:03 +02:00
Duarte Santos f37448aece pt-BR: override the equipment-profile strings instead of inheriting them
The new equipment strings landed in pt.js only, so pt-BR inherited European
wording — «guillemets», 'A mostrar', 'Ginásio', 'tens' — and the locale's
own guard test caught it. Adds Brazilian overrides (você, 'Academia',
'Excluir perfil?', curly double quotes) and re-baselines the inheritance
fingerprint: the one newly inherited entry is !14's note placeholder, which
reads the same in both variants ('anilha' is current usage in Brazil too).
2026-08-25 14:10:39 +02:00
Duarte Santos 7f0afae228 Merge remote-tracking branch 'mrq/15' into integrate2 2026-08-25 14:08:36 +02:00
Duarte Santos 6eabeda89b equipment profiles: translate the new strings into all 11 locales
The merge request added 18 user-facing strings and no locale entries, so
every non-English profile would have rendered the equipment card, picker
banner and routine warning in English. Terminology follows each pack's
existing 'Equipment' key (Geräte / Equipo / Attrezzi / Sprzęt / Инвентарь …).

Also replaces the literal \u2019 escape in the Settings footer with the
character itself — the locale key has to match the string as it is written.
2026-08-25 14:06:40 +02:00
Duarte Santos 5a1f1d673f Merge merge request !1 (equipment profiles) 2026-08-25 14:03:32 +02:00
Duarte Santos f5b215f109 import: fix the gravl column aliases so they can actually match
mapHeader normalises the header before comparing ('Weight (kg)' -> 'weight
kg') but matches the alias list raw, so an alias written with parentheses
never matches. Three of the added ones were dead entries whose normalised
twin was already in the table; 'set duration (sec)' had no twin, so gravl's
per-set duration was dropped and its cardio rows skipped entirely.

Also moves that column from "time" to "seconds", which is what it is:
toMinutes() would have read gravl's 22 seconds as 22 minutes.

Adds the gravl sample from the merge request as a regression test.
2026-08-25 14:01:45 +02:00
Duarte Santos 880a9c184e Merge remote-tracking branch 'mrq/21' into integrate2 2026-08-25 14:00:13 +02:00
Duarte Santos 669756a6dd exercise search: cache the normalised haystack per exercise
matchExercise rebuilt an NFD-normalised corpus for all ~1300 catalogue
entries on every keystroke (~8ms desktop, several times that on a phone).
Cache it in a WeakMap keyed by the i18n version so a language switch
rebuilds the translated terms, and custom exercises re-cache on their own
because the store hands out fresh objects on update.
2026-08-25 14:00:13 +02:00
Duarte Santos 1bd69c75ff Merge remote-tracking branch 'mrq/13' into integrate2 2026-08-25 13:59:18 +02:00
Duarte Santos 142b444c8f Merge remote-tracking branch 'mrq/14' into integrate2 2026-08-25 13:58:59 +02:00
andi242 9c4bc16967 add fields for gravl csv import 2026-08-25 13:21:44 +02:00
andi242 881fe4b2dc add date format parse and tests
parse and test YYYY/MM/DD format
add some different date formats to testing
2026-08-25 12:31:50 +02:00
JoseviandClaude Opus 5 e326f1b1cb api: cierra SSRF en push, CSRF por subdominio hermano y shadowing de cookie
Cuatro problemas encontrados en una revision de seguridad, los cuatro reproducidos
antes y despues del arreglo.

SSRF + cuelgue del handler. El `endpoint` de una suscripcion push se validaba solo
como "string no vacio", y web-push lo pasa tal cual a https.request: cualquier
usuario registrado alcanzaba cualquier host:puerto que viera el contenedor api,
que comparte red Docker con el resto del stack. Ademas no habia timeout, asi que
un endpoint que aceptaba TCP y se callaba dejaba colgado el handler que hacia
await (>2 min medidos). Ahora el rechazo de direcciones loopback/privadas/
link-local/CGNAT vive en el lookup del propio agente, no en una pasada previa, asi
que no queda ventana de DNS rebinding; y los envios llevan timeout de 10s.

Amplificacion. No habia tope de suscripciones por usuario y sendPush lanzaba un
Promise.all sin limite: una peticion de ~90 bytes producia 200 conexiones TLS
simultaneas al host que eligiera el atacante. Cap de 20 por cuenta y 6 en vuelo.

CSRF. SameSite=Lax deja fuera un origen cross-site pero no un subdominio hermano,
que es el mismo site y es el reparto habitual en self-hosting; y el body se
parseaba como JSON dijera lo que dijera el Content-Type, asi que bastaba un POST
simple sin preflight. Ahora una peticion que cambia estado tiene que ser
Sec-Fetch-Site: same-origin, o traer un Origin igual a ORIGIN donde esa cabecera
no llegue. Exentas las rutas que llevan su credencial en el body y todo lo
autenticado por Bearer, para no romper la app movil.

Fijacion de sesion. Las cookies se reducian con Object.fromEntries, que se queda
con la ultima repetida: un subdominio hermano podia plantar gymsid para el dominio
padre y quedarse con la sesion. En HTTPS la cookie pasa a __Host-gymsid, que el
navegador garantiza host-only; la legacy se sigue aceptando, asi que actualizar no
desloguea a nadie. Un nombre repetido con valores distintos se rechaza entero.

El proxy de Vite reescribe Origin porque el dev server vive en otro puerto.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 10:01:07 +02:00
JoseviandClaude Sonnet 5 781e2441ba mobile: modo "conectar a mi servidor" (emparejamiento por codigo, sin passkeys)
La app movil puede ahora sincronizar de verdad contra un servidor openGym
propio en vez de guardar todo solo en el telefono. Como las passkeys no
funcionan desde el WebView de la app (su origen nunca coincide con el
hostname real), el emparejamiento se hace con un codigo de un solo uso
generado desde una sesion ya logueada en el navegador (Ajustes > "Emparejar
la app movil"), canjeado por un bearer token con la misma firma que ya usa
la cookie de sesion.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-25 07:59:12 +02:00
Josevi ec84f6db06 i18n: completa las 10 traducciones que faltaban en todos los idiomas
check-locales.mjs exige el mismo set de claves en las 11 locales; las
cadenas de drop-set/rest-pause (commit 02ea938) y las de tema
"Sistema"/auto-backup solo estaban en es.js, lo que rompia el job
test:frontend en CI y bloqueaba build:apk (dependia de el).
2026-08-24 21:17:47 +02:00
Josevi 7261403d2d settings: opcion de tema "Sistema" que sigue el prefers-color-scheme del OS
Ademas de Oscuro/Claro fijos, ahora se puede elegir que el tema siga la
preferencia del sistema operativo/navegador, con actualizacion en vivo si
esta cambia mientras la app esta abierta (sin necesitar recargar).
2026-08-24 21:04:42 +02:00
Josevi 50194442b6 mobile: opcion de auto-backup local al terminar entreno o editar rutina
En el build movil (Capacitor) los datos solo viven en el dispositivo, sin
backend. Ademas del export/import manual ya existente, se agrega un toggle
en Settings que escribe una copia fechada en la carpeta Documents (visible
en Files/gestor de archivos) tras terminar un entrenamiento o salir del
editor de rutinas, para que una app de sincronizacion externa (o una copia
manual) siempre tenga algo reciente que llevarse.
2026-08-24 20:54:28 +02:00
JoseviandClaude Sonnet 5 02ea938b2c Add planned drop-sets and rest-pause/myo-reps intensifiers
An exercise's set config can now plan a drop-set (N drops, weight
decrement % per drop) or rest-pause (a total rep count split into
descending, roughly-halving bursts) via a new "Intensifier" picker in
the routine editor / exercise config sheet. The guided workout screen
pre-fills the resulting rows already computed and editable, no live
sheet or timer required; a plain set can still grow a drop/burst on
the spot too.

Rest-pause collapses the exercise to exactly two sets (a warm-up at
its own reps, then one rest-pause work set whose own reps ARE the
configured total) rather than repeating the full protocol per set.

Volume, fatigue tonnage, 1RM estimation and progression all continue
to read a set row's own w/r directly, so most of the app needed no
changes; the few that sum across a row's extras (workoutVolume,
setTonnage, applyPrescription's set-growth path) got small, targeted
fixes to avoid double-counting. Full design writeup in
PROJECT_CONTEXT.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-24 20:36:25 +02:00
Horus Gonzalez 79206950c4 Add the note placeholder string to the remaining 10 locales
check-locales.mjs requires every locale to carry the same key set —
the previous commit only added the string to es.js. Machine-translated
for de/fr/it/pl/pt/ru/tr/zh/ko/hi; happy to have a native speaker
refine any of these on review.
2026-08-24 11:47:22 -06:00
Horus Gonzalez f52decf633 Add optional per-exercise notes
An exercise instance in a routine only carried sets/reps/weight — a flat
target with no room for loading instructions that vary within a session
(e.g. a pyramid: "bar only, then +1 plate/side each set"). Adds a small
free-text `note` field alongside the existing config flags, shown in the
routine editor, during the active workout, and round-tripped through the
plan share/print/import paths.

No schema migration: it's an optional string on the same object that
already carries `sg`/`bodyweight`/`side`.
2026-08-24 11:40:35 -06:00
wagenheimer 4df4406139 feat(exercises): add multi-token, accent-insensitive and multilingual exercise search 2026-08-24 14:32:00 -03:00
mzspicoli 3e531e72e1 fix: allow passkeys in Chrome on iOS 2026-08-24 18:03:10 +02:00
mzspicoli 448c66752f feat(i18n): localize pt-BR exercise names 2026-08-24 18:02:29 +02:00
mzspicoli dc3fafc6ef fix(i18n): correct reviewed pt-BR instructions 2026-08-24 18:02:11 +02:00
mzspicoli 3d3e44c973 feat(i18n): complete Brazilian Portuguese instructions 2026-08-24 18:02:11 +02:00
mzspicoli ad69235f6e feat(i18n): complete pt-BR core instructions 2026-08-24 18:01:54 +02:00
mzspicoli c667539f10 feat(i18n): translate first pt-BR core batch 2026-08-24 18:01:54 +02:00
mzspicoli 600f7ff0e6 test(i18n): allow pt-BR instruction batches to grow 2026-08-24 18:01:54 +02:00
mzspicoli 052ef7e0ba fix(i18n): document and validate pt-BR instructions 2026-08-24 18:01:54 +02:00
mzspicoli 9b72fb7f1e feat(i18n): start Brazilian Portuguese instructions 2026-08-24 18:01:36 +02:00
mzspicoli 03f8abb46b fix(i18n): address final pt-BR UI review 2026-08-24 18:01:31 +02:00
mzspicoli 4081ddac06 fix(i18n): close pt-BR review gaps 2026-08-24 18:01:31 +02:00
mzspicoli 9f913055d7 fix(i18n): harden Brazilian Portuguese locale 2026-08-24 18:01:31 +02:00
mzspicoli 00ba71d4df feat(i18n): add Brazilian Portuguese UI 2026-08-24 18:01:31 +02:00
Space_Hermes 64ea41a5df fix(stats): remove duplicate muscle exercise list 2026-08-23 22:23:12 +02:00
Aaron Sachs d46b9215a3 feat: persisted equipment profiles (Home/Gym/etc)
Builds on the existing session-only equipment filter (issue #6) by adding a
persisted "what I actually own" profile, so the Library and exercise picker
can default to what's usable at Home vs. at the Gym instead of the full
catalogue every time.

- New equipProfiles / activeEquipId / equipFilterOn on synced state (S)
- lib/equipment.js: ALL_EQUIPMENT catalogue, activeProfile(), exAvailable() —
  body weight is always available regardless of profile
- Settings: create/edit/delete profiles (name + equipment checklist), pick
  the active one, toggle filtering on/off
- Library + exercise picker: filter to the active profile by default, with a
  one-tap "show all equipment" escape hatch per session
- RoutineEdit: flags any saved exercise that needs equipment outside the
  active profile (inline warning icon + a summary banner), so you find out
  before showing up at the wrong location, not mid-workout

Purely additive to synced client state — no server/API changes, no new
dependencies. All 339 previously-passing tests still pass (the 7 failures in
Workout.remove.test.jsx are pre-existing on a clean checkout too — a Node
localStorage/vitest environment issue unrelated to this change).
2026-08-23 16:22:34 -04:00
Space_Hermes c8f4d5bd18 feat: extract exercise catalogue and logging 2026-08-23 22:11:49 +02:00