Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

curated2: review fixes — touch drag (!45), deload seeds (!28), rep-range typing (!69), rebuilt rows on config change (!54), swap keeps history (!43), Hevy retry/dedup/aliases (!30), HTTPS doc (!67), locale gaps

Duarte Santoscc878dd3534d
diff --git a/docs/SELF_HOSTING.md b/docs/SELF_HOSTING.md
index 6fc0abb8e..57faeee6c 100644
--- a/docs/SELF_HOSTING.md
+++ b/docs/SELF_HOSTING.md
@@ -59,6 +59,8 @@ you're poking at the API directly:
## 3. Expose it over HTTPS on your own domain
+> Want HTTPS **without** exposing anything to the internet — a valid certificate on a LAN-only address? See [SELF_HOSTING_HTTPS.md](./SELF_HOSTING_HTTPS.md) (wildcard cert via a DNS challenge, Caddy in front).
+
Put openGym behind something that terminates TLS for a hostname you control, then point it at
the `web` container. Pick whichever you already run:
diff --git a/docs/SELF_HOSTING_HTTPS.md b/docs/SELF_HOSTING_HTTPS.md
index 8ed4aa480..af646dc52 100644
--- a/docs/SELF_HOSTING_HTTPS.md
+++ b/docs/SELF_HOSTING_HTTPS.md
@@ -1,12 +1,12 @@
# Selfhosting with HTTPS
-Since we handling a rather complex topic with this, it is separate from the [SELF_HOSTING.md](./SELF_HOSTING.md) which is focusing on how to run openGym.
+This is a rather complex topic of its own, so it lives apart from the [SELF_HOSTING.md](./SELF_HOSTING.md) which focuses on how to run openGym.
This document takes a more general approach on how to achieve "https at home", it is not necessarily focused on openGym and applies to self hosting in general.
-When self hosting it is often thought of that one needs to expose their services to the internet, this is not necessarily the case.
+When self-hosting it is often assumed that one needs to expose their services to the internet, this is not necessarily the case.
We can have https certificates without having to expose our precious hosts to the world. You can still do that if you want to access your applications from the internet without any VPN, but it's not necessary to take the risk.
-Since VPN is a beast of it's own we'll only handle the certificates for now and grant https traffic to our local network hosts.
+Since VPN is a beast of its own we'll only handle the certificates for now and grant https traffic to our local network hosts.
This guide assumes that you are running a Linux host, everything else is not covered.
@@ -31,20 +31,20 @@ graph TD
In most cases the router also provides DNS for the local network and forwards all requests to the internet provider DNS.
(If you set up your own DNS server on your homelab, you probably know what you're doing.)
-The clients (PC, mobile phone, ...) will ask the local DNS for adress translation and if the local DNS can't provide the target adress, it will forward the request.
-Usually the DNS servers out there translate DNS names to public IP adresses.
-Since we do not own a plublic DNS server, we need a DNS provider that does this for us.
+The clients (PC, mobile phone, ...) will ask the local DNS for address translation and if the local DNS can't provide the target address, it will forward the request.
+Usually the DNS servers out there translate DNS names to public IP addresses.
+Since we do not own a public DNS server, we need a DNS provider that does this for us.
You probably heard of dyndns, duckdns and the like. This is what they do: provide a public DNS for us.
-In order to make the public DNS servers out there resolve the local IP adress of our homelab we will set up the DNS provider.
-It is strongly adviced to check which DNS providers are supported by the tools you choose (we'll get to that later).
+In order to make the public DNS servers out there resolve the local IP address of our homelab we will set up the DNS provider.
+It is strongly advised to check which DNS providers are supported by the tools you choose (we'll get to that later).
### Let's encrypt!
Let's encrypt is free to use, they provide certificates for everyone to make the internet safer. Read [here](https://letsencrypt.org/docs/why-all-https/) for more information.
They provide tools to automatically create certificates with a challenge to ensure your request is valid.
Therefore the tool needs to have access to the DNS provider to generate temporary TXT entries on the DNS entry.
-If all is checked, the certificate authority of Let's encrypt singns the certificate and it can be used.
+If all is checked, the certificate authority of Let's Encrypt signs the certificate and it can be used.
We will make use of a wildcard certificate, so we can serve all our services with one certificate.
@@ -52,7 +52,7 @@ We will make use of a wildcard certificate, so we can serve all our services wit
A proxy is optional but desirable. It acts as sort of a gateway to our service and can be a single entrypoint to multiple services on our homelab.
Let's say we have three services running on our instance. Since a TCP port can be used only once on a host we would have three ports that access our individual services.
-It would not be very nice to have to remember all the ports when we adress our services, so we let the proxy do it.
+It would not be very nice to have to remember all the ports when we address our services, so we let the proxy do it.
Port 443 (https) can only be used once so we would let our proxy answer to that port.
We configure the proxy to forward requests to our individual services like so:
@@ -79,7 +79,7 @@ So how does it all come together?
- let's encrypt client: certbot, officially supported by LE
- reverse proxy: caddy, lightweight and hackable.
-This is the tools I picked and that I know to work, your choice may be different and the setup is different as well.
+These are the tools I picked and know to work, your choice may be different and the setup is different as well.
But the main tasks are the same, so you can adapt to your choice.
Additional info:
@@ -91,10 +91,10 @@ Additional info:
1. register with desec.io and choose a name (we take `myhomelab` as example)
1. create a new A record that points to your service, e.g.: `*.myhomelab.dedyn.io` (Wildcard!) - 192.168.0.100 (the ip of your homelab/mini PC/Raspberry Pi running the proxy)
2. A wildcard certificate handles all certificates for that given host. e.g.: `opengym.myhomelab.dedyn.io` and `nextcloud.myhomelab.dedyn.io` can share the same certificates.
- 2. create an API token for updating the domain settings (`Can create domains` and `Can delete domains` activated), be sure to note the token, it is only displayed once.
+ 3. create an API token for the certbot plugin. It only needs to write records inside your domain — leave `Can create domains` and `Can delete domains` **off**; a leaked token should not be able to take your domain apart. Note the token, it is only displayed once.
2. install certbot on your host
1. most linux distributions provide the packages for this, e.g. debian: `apt install certbot python3-certbot-dns-desec` check the [docs](https://desec.readthedocs.io/en/latest/integrations/lets-encrypt.html)
- 3. create a config file in `/etc/letsencrypt`: `desec.ini` `dns_desec_token = YOUR_TOKEN`
+ 2. create a config file in `/etc/letsencrypt`: `desec.ini` containing `dns_desec_token = YOUR_TOKEN`, and `chmod 600` it
3. run certbot to register
```bash
certbot certonly \
@@ -105,7 +105,8 @@ Additional info:
--no-eff-email \
-d "*.myhomelab.dedyn.io"
```
- 2. the certbot will also create a systemd service that checks and renews the certificates automatically.
+ 4. certbot also installs a systemd timer that renews the certificate automatically. Caddy only re-reads the files when told to, so add a deploy hook once: `certbot renew --deploy-hook "systemctl reload caddy"` (or drop that line into `/etc/letsencrypt/renewal-hooks/deploy/`).
+ 5. certbot writes `privkey.pem` readable by root only, while caddy runs as its own user. Either `chgrp caddy /etc/letsencrypt/live /etc/letsencrypt/archive && chmod g+rx` those directories (and `g+r` on the key), or copy the files in the deploy hook — otherwise caddy starts, but every TLS handshake fails.
3. install caddy
1. most linux distributions provide the packages for this, e.g. debian: `apt install caddy` check the [docs](https://caddyserver.com/docs/install)
2. create the caddy config, this is an example that should work:
@@ -138,7 +139,9 @@ Additional info:
```
And that's about it. Now you should be able to access your opengym instance from your local network via https with working passkeys.
-Be sure to update the opengym config accordingly.
+Be sure to update the openGym config accordingly (`RP_ID=opengym.myhomelab.dedyn.io`, `ORIGIN=https://opengym.myhomelab.dedyn.io` — see [SELF_HOSTING.md](./SELF_HOSTING.md#2-understand-the-passkey-requirement-important)).
+
+**If the name does not resolve on your phone:** many home routers (Fritz!Box, some ISP boxes) have *DNS rebind protection* and silently drop public names that resolve to a private IP. Add `myhomelab.dedyn.io` to the router's rebind exception list, or run your own resolver.
usable URLs in this example:
- `https://opengym.myhomelab.dedyn.io -> http://192.168.0.100:8080`
@@ -161,5 +164,5 @@ If something does not work, please check the corresponding documentation:
- [Let's encrypt](https://letsencrypt.org/docs/)
- [certbot](https://certbot.eff.org/)
-Next time we'll handle a VPN connection with wireguard, desec and automatic IP updater, so we can access our services from the internet.
+Reaching the services from outside your network (WireGuard plus a dynamic-DNS updater) is out of scope here.
diff --git a/frontend/src/index.css b/frontend/src/index.css
index 51b967c3d..e3971aec2 100644
--- a/frontend/src/index.css
+++ b/frontend/src/index.css
@@ -382,7 +382,7 @@ h4.sec{
}
.item:active{background:var(--surface-2)}
.routine-list{position:relative}
-.routine-drag-row{touch-action:pan-y;position:relative;transition:transform var(--fast) var(--ease)}
+.routine-drag-row{touch-action:pan-y;-webkit-touch-callout:none;position:relative;transition:transform var(--fast) var(--ease)}
.routine-list.is-reordering{user-select:none;-webkit-user-select:none}
.routine-list.is-reordering .routine-drag-row{transition:none}
.routine-drag-row.is-dragging{z-index:2;pointer-events:none}
diff --git a/frontend/src/lib/hevy-id-map.js b/frontend/src/lib/hevy-id-map.js
index ce5b32f27..e4f48bf73 100644
--- a/frontend/src/lib/hevy-id-map.js
+++ b/frontend/src/lib/hevy-id-map.js
@@ -1,7 +1,9 @@
// AUTO-GENERATED by scripts/build-hevy-id-map.mjs — do not edit by hand.
// Hevy exercise_template id → openGym catalogue id, plus English title → id for CSV exports
// (Hevy CSV has titles, not template ids). Regenerated from the Hevy templates API +
-// verified title aliases.
+// verified title aliases. Five title aliases whose catalogue match was wrong (crunch → weighted
+// crunch, side plank → hip adduction, machine squat → barbell squat, cable triceps extension and
+// cable reverse fly → lever machines) are left out; those titles import as custom exercises.
// 283 mapped · 168 left unmatched (import as custom).
// Source templates: 451 (built-in only).
@@ -348,7 +350,6 @@ export const HEVY_TITLE_MAP = {
"clean and press": "0028",
"concentration curl": "0297",
"cross body hammer curl": "0298",
- "crunch": "0832",
"crunch (machine)": "1452",
"crunch (weighted)": "0832",
"cycling": "2331",
@@ -473,7 +474,6 @@ export const HEVY_TITLE_MAP = {
"push up (weighted)": "0662",
"push up - close grip": "0259",
"rack pull": "0074",
- "rear delt reverse fly (cable)": "0602",
"rear delt reverse fly (dumbbell)": "0383",
"rear delt reverse fly (machine)": "0602",
"renegade row (dumbbell)": "0521",
@@ -516,7 +516,6 @@ export const HEVY_TITLE_MAP = {
"shrug (machine)": "0604",
"shrug (smith machine)": "0767",
"side bend (dumbbell)": "0407",
- "side plank": "1775",
"single arm lateral raise (cable)": "0192",
"single leg standing calf raise (machine)": "0605",
"sissy squat (weighted)": "1489",
@@ -530,7 +529,6 @@ export const HEVY_TITLE_MAP = {
"squat (barbell)": "0043",
"squat (bodyweight)": "3543",
"squat (dumbbell)": "0413",
- "squat (machine)": "0043",
"squat (smith machine)": "0770",
"squat (suspension)": "0043",
"squat row": "1003",
@@ -558,7 +556,6 @@ export const HEVY_TITLE_MAP = {
"triceps dip (assisted)": "0019",
"triceps dip (weighted)": "0591",
"triceps extension (barbell)": "0607",
- "triceps extension (cable)": "0607",
"triceps extension (dumbbell)": "0607",
"triceps extension (machine)": "0607",
"triceps extension (suspension)": "0607",
diff --git a/frontend/src/lib/history.js b/frontend/src/lib/history.js
index f1bcc08bd..0850fc206 100644
--- a/frontend/src/lib/history.js
+++ b/frontend/src/lib/history.js
@@ -308,11 +308,17 @@ export function buildSets(S, cfg, options = {}) {
export const MAX_PLANNED_WARMUPS = 5
function buildWorkSets(S, cfg, options = {}) {
- const last = lastEntryFor(S, cfg.id)
- const n = Math.max(1, cfg.sets || 1)
- const mode = modeOf(cfg)
const preferLast = !!options.preferLast
const useTarget = !!options.useTarget
+ // A workout flagged excludeFromProgression (a planned deload) is not "last time" for the
+ // next regular session either: its reps and durations must not seed the rows any more than
+ // its weight seeds the prescription. The deload session itself reads the routine's own target.
+ const regular = (S.workouts || []).some(w => w.excludeFromProgression === true)
+ ? { ...S, workouts: S.workouts.filter(w => w.excludeFromProgression !== true) }
+ : S
+ const last = lastEntryFor(regular, cfg.id)
+ const n = Math.max(1, cfg.sets || 1)
+ const mode = modeOf(cfg)
const sets = []
// A deload routine must use its own prescription instead of carrying regular-session values
// into the workout. Other planned sessions keep the existing history-first behaviour.
@@ -341,8 +347,11 @@ function buildWorkSets(S, cfg, options = {}) {
const usable = prev && prev.r > 0 ? prev : null
// Planned sessions may use the confirmed working weight, while freestyle should reproduce
// the load of each matching set when that option is requested.
+ // A deload uses the routine's target weight; a routine that never set one (weight 0) falls
+ // back to the last regular load rather than prescribing an empty bar.
+ const lastRegular = last ? (last.sets[i] || last.sets[last.sets.length - 1]) : null
const w = useTarget
- ? cfg.weight
+ ? (cfg.weight > 0 ? cfg.weight : (lastRegular && lastRegular.r > 0 ? lastRegular.w : cfg.weight))
: preferLast && usable ? usable.w : (conf && conf.w > 0 ? conf.w : (usable ? usable.w : cfg.weight))
sets.push({ w, r: usable ? usable.r : cfg.reps, done: false })
}
diff --git a/frontend/src/lib/import-hevy.js b/frontend/src/lib/import-hevy.js
index aa4fafd41..b66c8718d 100644
--- a/frontend/src/lib/import-hevy.js
+++ b/frontend/src/lib/import-hevy.js
@@ -31,12 +31,22 @@ async function hevyGet(path, apiKey, params = {}) {
for (const [k, v] of Object.entries(params)) {
if (v != null && v !== '') url.searchParams.set(k, String(v))
}
- const res = await fetch(url, { headers: { 'api-key': apiKey } })
- if (res.status === 401 || res.status === 403) {
- throw new HevyApiError(res.status, 'auth')
+ // Hevy publishes no rate limit, but a large account is 100+ sequential page requests; a 429
+ // gets a short back-off and one more try before it surfaces as its own error kind.
+ for (let attempt = 0; ; attempt++) {
+ const res = await fetch(url, { headers: { 'api-key': apiKey } })
+ if (res.status === 401 || res.status === 403) {
+ throw new HevyApiError(res.status, 'auth')
+ }
+ if (res.status === 429 && attempt < 2) {
+ const after = Number(res.headers?.get?.('retry-after'))
+ await new Promise(r => setTimeout(r, (after > 0 && after <= 30 ? after : 2 * (attempt + 1)) * 1000))
+ continue
+ }
+ if (res.status === 429) throw new HevyApiError(res.status, 'rate-limit')
+ if (!res.ok) throw new HevyApiError(res.status, `http ${res.status}`)
+ return res.json()
}
- if (!res.ok) throw new HevyApiError(res.status, `http ${res.status}`)
- return res.json()
}
/** Page through a Hevy list endpoint. `pageSize` caps differ per resource. */
@@ -371,17 +381,28 @@ export function mergeHevyRoutines(S, parsed) {
// Keep the pre-assigned id from parse so routine configs already point at it.
if (!S.customEx.some(x => x.id === c.id)) S.customEx.push(c)
})
- let added = 0
+ // A second import must not double every plan: a routine that already carries the same Hevy
+ // id is replaced in place (its exercises re-read from Hevy), everything else is appended.
+ let added = 0, updated = 0
for (const r of parsed.routines || []) {
+ const ex = (r.ex || []).map(e => ({ ...e, id: exIdMap[e.id] || e.id }))
+ const existing = r.hevyId ? S.routines.find(x => x.hevyId === r.hevyId) : null
+ if (existing) {
+ existing.name = r.name
+ existing.ex = ex
+ updated++
+ continue
+ }
S.routines.push({
id: uid(),
name: r.name,
emoji: r.emoji || 'figureStrength',
- ex: (r.ex || []).map(e => ({ ...e, id: exIdMap[e.id] || e.id })),
+ ...(r.hevyId ? { hevyId: r.hevyId } : {}),
+ ex,
})
added++
}
- return { added }
+ return { added, updated }
}
/** Body measurements from the Hevy API → `mergeImport` bodyweight shape. */
diff --git a/frontend/src/lib/import-hevy.test.js b/frontend/src/lib/import-hevy.test.js
index ec2a65e7b..7d7bc39cf 100644
--- a/frontend/src/lib/import-hevy.test.js
+++ b/frontend/src/lib/import-hevy.test.js
@@ -269,14 +269,25 @@ describe('parseHevyRoutines', () => {
expect(pull.sg).toBe(row.sg)
})
- it('mergeHevyRoutines always adds new routines', () => {
+ it('mergeHevyRoutines replaces a routine it imported before instead of duplicating it', () => {
const parsed = parseHevyRoutines([ROUTINE], TEMPLATES, { unit: 'kg' })
const S = { routines: [], customEx: [] }
- expect(mergeHevyRoutines(S, parsed).added).toBe(1)
+ expect(mergeHevyRoutines(S, parsed)).toEqual({ added: 1, updated: 0 })
expect(S.routines).toHaveLength(1)
- expect(mergeHevyRoutines(S, parsed).added).toBe(1)
+ expect(S.routines[0].hevyId).toBe(ROUTINE.id)
+ const firstId = S.routines[0].id
+ S.routines[0].name = 'renamed locally'
+ expect(mergeHevyRoutines(S, parsed)).toEqual({ added: 0, updated: 1 })
+ expect(S.routines).toHaveLength(1)
+ expect(S.routines[0].id).toBe(firstId)
+ expect(S.routines[0].name).toBe(ROUTINE.title)
+ })
+
+ it('mergeHevyRoutines still adds a routine that carries no Hevy id', () => {
+ const parsed = parseHevyRoutines([{ ...ROUTINE, id: undefined }], TEMPLATES, { unit: 'kg' })
+ const S = { routines: [], customEx: [] }
+ mergeHevyRoutines(S, parsed); mergeHevyRoutines(S, parsed)
expect(S.routines).toHaveLength(2)
- expect(S.routines[0].id).not.toBe(S.routines[1].id)
})
})
diff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.js
index 337697019..b630209be 100644
--- a/frontend/src/lib/pt-br-locale.test.js
+++ b/frontend/src/lib/pt-br-locale.test.js
@@ -27,7 +27,7 @@ describe('Brazilian Portuguese locale', () => {
.sort(byCodeUnit)
const fingerprint = createHash('sha256').update(JSON.stringify(inherited)).digest('hex')
- expect(Object.keys(PT_BR_OVERRIDES)).toHaveLength(331)
+ expect(Object.keys(PT_BR_OVERRIDES)).toHaveLength(333)
expect(inherited).toHaveLength(448)
// If this fails, review the changed keys and wording before accepting a new hash. From
// frontend/: node scripts/pt-br-inheritance-fingerprint.mjs --list
diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js
index d8fcb203d..b0cecb437 100644
--- a/frontend/src/locales/de.js
+++ b/frontend/src/locales/de.js
@@ -731,5 +731,7 @@ export default {
'Add session note': 'Notiz zum Training',
'Edit session note': 'Notiz bearbeiten',
'How the session went as a whole.': 'Wie das Training insgesamt lief.',
- 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-Pause trainiert immer als ein Aufwärmsatz mit dieser Wiederholungszahl und ein Rest-Pause-Arbeitssatz — „Sätze“ wird nicht verwendet.'
+ 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-Pause trainiert immer als ein Aufwärmsatz mit dieser Wiederholungszahl und ein Rest-Pause-Arbeitssatz — „Sätze“ wird nicht verwendet.',
+ 'Open progression settings': 'Progressions-Einstellungen öffnen',
+ 'Hevy is rate-limiting requests — wait a minute and try again': 'Hevy drosselt die Anfragen — eine Minute warten und erneut versuchen',
}
diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js
index 7329f5519..202cb34f1 100644
--- a/frontend/src/locales/es.js
+++ b/frontend/src/locales/es.js
@@ -714,5 +714,7 @@ export default {
'Add session note': 'Añadir nota de la sesión',
'Edit session note': 'Editar nota de la sesión',
'How the session went as a whole.': 'Cómo fue la sesión en conjunto.',
- 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-pause siempre entrena como una serie de calentamiento con estas reps y una serie de trabajo rest-pause — «Series» no se usa.'
+ 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-pause siempre entrena como una serie de calentamiento con estas reps y una serie de trabajo rest-pause — «Series» no se usa.',
+ 'Open progression settings': 'Abrir ajustes de progresión',
+ 'Hevy is rate-limiting requests — wait a minute and try again': 'Hevy está limitando las solicitudes: espera un minuto y vuelve a intentarlo',
}
diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js
index dab8dfdc9..e0ae38785 100644
--- a/frontend/src/locales/fr.js
+++ b/frontend/src/locales/fr.js
@@ -714,5 +714,7 @@ export default {
'Add session note': 'Ajouter une note de séance',
'Edit session note': 'Modifier la note de séance',
'How the session went as a whole.': 'Comment la séance s’est passée dans l’ensemble.',
- 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Le rest-pause s’entraîne toujours comme une série d’échauffement à ce nombre de reps, puis une série de travail rest-pause — « Séries » n’est pas utilisé.'
+ 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Le rest-pause s’entraîne toujours comme une série d’échauffement à ce nombre de reps, puis une série de travail rest-pause — « Séries » n’est pas utilisé.',
+ 'Open progression settings': 'Ouvrir les réglages de progression',
+ 'Hevy is rate-limiting requests — wait a minute and try again': 'Hevy limite les requêtes — attendez une minute puis réessayez',
}
diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js
index a16477a7c..0de7f9c26 100644
--- a/frontend/src/locales/hi.js
+++ b/frontend/src/locales/hi.js
@@ -714,5 +714,7 @@ export default {
'Add session note': 'सत्र का नोट जोड़ें',
'Edit session note': 'सत्र का नोट बदलें',
'How the session went as a whole.': 'पूरा सत्र कैसा रहा।',
- 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'रेस्ट-पॉज़ हमेशा इसी रेप्स संख्या के एक वार्म-अप सेट और एक रेस्ट-पॉज़ वर्क सेट के रूप में किया जाता है — “सेट” का उपयोग नहीं होता।'
+ 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'रेस्ट-पॉज़ हमेशा इसी रेप्स संख्या के एक वार्म-अप सेट और एक रेस्ट-पॉज़ वर्क सेट के रूप में किया जाता है — “सेट” का उपयोग नहीं होता।',
+ 'Open progression settings': 'प्रगति सेटिंग्स खोलें',
+ 'Hevy is rate-limiting requests — wait a minute and try again': 'Hevy अनुरोधों को सीमित कर रहा है — एक मिनट रुकें और फिर से कोशिश करें',
}
diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.js
index 768605884..42d436a04 100644
--- a/frontend/src/locales/hu.js
+++ b/frontend/src/locales/hu.js
@@ -689,4 +689,37 @@ export default {
'Keep replacement in this group': 'A csere maradjon ebben a csoportban',
'Insert after this group': 'Beszúrás a csoport után',
'Logged sets stay with the original exercise. The replacement will be inserted afterward.': 'A naplózott sorozatok az eredeti gyakorlatnál maradnak. A csere utána kerül beszúrásra.',
+ 'Rest after each set of this exercise. Leave at 0 to use your default rest timer.': 'Pihenő a gyakorlat minden sorozata után. Hagyd 0-n az alapértelmezett pihenőidőzítőhöz.',
+ 'Flash screen when timer ends': 'Képernyő villogása, ha lejár az időzítő',
+ 'Import from Hevy': 'Importálás a Hevyből',
+ 'Pull your history with a Hevy Pro API key': 'Előzmények letöltése Hevy Pro API-kulccsal',
+ 'Pull your history with a Hevy Pro API key. The key is only used for this import and is not saved.': 'Előzmények letöltése Hevy Pro API-kulccsal. A kulcs csak ehhez az importhoz kell, nem mentjük el.',
+ 'Hevy API key': 'Hevy API-kulcs',
+ 'Get your API key': 'API-kulcs beszerzése',
+ 'Hevy → Settings → Developer': 'Hevy → Beállítások → Fejlesztő',
+ 'Paste your Hevy API key first': 'Előbb illeszd be a Hevy API-kulcsot',
+ 'Fetch from Hevy': 'Letöltés a Hevyből',
+ 'Fetching from Hevy…': 'Letöltés a Hevyből…',
+ 'Fetching exercises… ({0}/{1})': 'Gyakorlatok letöltése… ({0}/{1})',
+ 'Fetching workouts… ({0}/{1})': 'Edzések letöltése… ({0}/{1})',
+ 'Fetching weigh-ins… ({0}/{1})': 'Mérések letöltése… ({0}/{1})',
+ 'Matching exercises…': 'Gyakorlatok párosítása…',
+ 'Could not reach Hevy — check the key and try again': 'A Hevy nem érhető el — ellenőrizd a kulcsot, és próbáld újra',
+ 'That Hevy API key was refused': 'A Hevy elutasította ezt az API-kulcsot',
+ 'Nothing to import from Hevy': 'Nincs mit importálni a Hevyből',
+ 'Import workouts': 'Edzések importálása',
+ 'Import routines': 'Edzéstervek importálása',
+ 'Import weigh-ins': 'Mérések importálása',
+ '{0} new · {1} days already here': '{0} új · {1} nap már megvan',
+ '{0} routines · {1} exercises — added as new plans': '{0} edzésterv · {1} gyakorlat — új tervekként hozzáadva',
+ '{0} routines imported': '{0} edzésterv importálva',
+ 'Fetching routines… ({0}/{1})': 'Edzéstervek letöltése… ({0}/{1})',
+ 'Hevy stores weights in kg — they will be converted to {0}.': 'A Hevy kg-ban tárolja a súlyokat — átváltjuk erre: {0}.',
+ 'Back': 'Vissza',
+ 'Reps up to': 'Ism. legfeljebb',
+ 'Exclude from automatic progression': 'Kihagyás az automatikus progresszióból',
+ 'Use for planned deloads. Workouts stay in history and statistics.': 'Tervezett deloadhoz. Az edzések megmaradnak az előzményekben és a statisztikában.',
+ 'The next regular target continues from the last included workout.': 'A következő normál cél az utolsó beszámított edzéstől folytatódik.',
+ 'Open progression settings': 'Progresszió beállításainak megnyitása',
+ 'Hevy is rate-limiting requests — wait a minute and try again': 'A Hevy korlátozza a kéréseket — várj egy percet, és próbáld újra',
}
diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js
index 4ef387a07..aba0c1dda 100644
--- a/frontend/src/locales/it.js
+++ b/frontend/src/locales/it.js
@@ -714,5 +714,7 @@ export default {
'Add session note': 'Aggiungi nota della sessione',
'Edit session note': 'Modifica nota della sessione',
'How the session went as a whole.': 'Com’è andata la sessione nel complesso.',
- 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Il rest-pause si allena sempre come una serie di riscaldamento a queste ripetizioni e una serie di lavoro rest-pause — “Serie” non viene usato.'
+ 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Il rest-pause si allena sempre come una serie di riscaldamento a queste ripetizioni e una serie di lavoro rest-pause — “Serie” non viene usato.',
+ 'Open progression settings': 'Apri le impostazioni di progressione',
+ 'Hevy is rate-limiting requests — wait a minute and try again': 'Hevy sta limitando le richieste: attendi un minuto e riprova',
}
diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js
index 2de66234f..c8922e53c 100644
--- a/frontend/src/locales/ko.js
+++ b/frontend/src/locales/ko.js
@@ -714,5 +714,7 @@ export default {
'Add session note': '운동 메모 추가',
'Edit session note': '운동 메모 편집',
'How the session went as a whole.': '이번 운동이 전체적으로 어땠는지.',
- 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': '레스트포즈는 항상 이 횟수의 워밍업 세트 하나와 레스트포즈 작업 세트 하나로 진행됩니다 — ‘세트’는 사용하지 않습니다.'
+ 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': '레스트포즈는 항상 이 횟수의 워밍업 세트 하나와 레스트포즈 작업 세트 하나로 진행됩니다 — ‘세트’는 사용하지 않습니다.',
+ 'Open progression settings': '진행 설정 열기',
+ 'Hevy is rate-limiting requests — wait a minute and try again': 'Hevy가 요청을 제한하고 있습니다 — 잠시 기다렸다가 다시 시도하세요',
}
diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js
index 0fabeb629..1a0b876f0 100644
--- a/frontend/src/locales/pl.js
+++ b/frontend/src/locales/pl.js
@@ -714,5 +714,7 @@ export default {
'Add session note': 'Dodaj notatkę do sesji',
'Edit session note': 'Edytuj notatkę do sesji',
'How the session went as a whole.': 'Jak przebiegła cała sesja.',
- 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-pause zawsze trenuje się jako jedna seria rozgrzewkowa o tej liczbie powtórzeń i jedna seria robocza rest-pause — „Serie” nie są używane.'
+ 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-pause zawsze trenuje się jako jedna seria rozgrzewkowa o tej liczbie powtórzeń i jedna seria robocza rest-pause — „Serie” nie są używane.',
+ 'Open progression settings': 'Otwórz ustawienia progresji',
+ 'Hevy is rate-limiting requests — wait a minute and try again': 'Hevy ogranicza liczbę zapytań — odczekaj minutę i spróbuj ponownie',
}
diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.js
index 4db81553b..f5d152990 100644
--- a/frontend/src/locales/pt-BR.js
+++ b/frontend/src/locales/pt-BR.js
@@ -345,7 +345,9 @@ export const PT_BR_OVERRIDES = {
'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'O rest-pause sempre treina como uma série de aquecimento com essas repetições e uma série de trabalho rest-pause — “Séries” não é usado.',
// --- per-exercise rest ---
- 'Rest after each set of this exercise. Leave at 0 to use your default rest timer.': 'Descanso depois de cada série deste exercício. Deixe em 0 para usar o temporizador de descanso padrão.'
+ 'Rest after each set of this exercise. Leave at 0 to use your default rest timer.': 'Descanso depois de cada série deste exercício. Deixe em 0 para usar o temporizador de descanso padrão.',
+ 'Open progression settings': 'Abrir configurações de progressão',
+ 'Hevy is rate-limiting requests — wait a minute and try again': 'O Hevy está limitando as solicitações — espere um minuto e tente novamente',
}
export default { ...pt, ...PT_BR_OVERRIDES }
diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js
index 6beb3ccf6..8343fd7a6 100644
--- a/frontend/src/locales/pt.js
+++ b/frontend/src/locales/pt.js
@@ -714,5 +714,7 @@ export default {
'Add session note': 'Adicionar nota da sessão',
'Edit session note': 'Editar nota da sessão',
'How the session went as a whole.': 'Como correu a sessão no seu todo.',
- 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'O rest-pause treina sempre como uma série de aquecimento com estas repetições e uma série de trabalho rest-pause — «Séries» não é usado.'
+ 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'O rest-pause treina sempre como uma série de aquecimento com estas repetições e uma série de trabalho rest-pause — «Séries» não é usado.',
+ 'Open progression settings': 'Abrir definições de progressão',
+ 'Hevy is rate-limiting requests — wait a minute and try again': 'O Hevy está a limitar os pedidos — espere um minuto e tente novamente',
}
diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js
index 6418392b0..31a5ea204 100644
--- a/frontend/src/locales/ru.js
+++ b/frontend/src/locales/ru.js
@@ -714,5 +714,7 @@ export default {
'Add session note': 'Добавить заметку',
'Edit session note': 'Изменить заметку',
'How the session went as a whole.': 'Как прошла тренировка в целом.',
- 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-pause всегда выполняется как один разминочный подход с этим числом повторений и один рабочий подход rest-pause — «Подходы» не используются.'
+ 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-pause всегда выполняется как один разминочный подход с этим числом повторений и один рабочий подход rest-pause — «Подходы» не используются.',
+ 'Open progression settings': 'Открыть настройки прогрессии',
+ 'Hevy is rate-limiting requests — wait a minute and try again': 'Hevy ограничивает запросы — подождите минуту и попробуйте снова',
}
diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.js
index 5111db203..b051a0100 100644
--- a/frontend/src/locales/th.js
+++ b/frontend/src/locales/th.js
@@ -697,4 +697,37 @@ export default {
'Keep replacement in this group': 'เก็บท่าใหม่ไว้ในกลุ่มนี้',
'Insert after this group': 'แทรกหลังกลุ่มนี้',
'Logged sets stay with the original exercise. The replacement will be inserted afterward.': 'เซ็ตที่บันทึกแล้วจะอยู่กับท่าเดิม ท่าใหม่จะถูกแทรกไว้ถัดไป',
+ 'Rest after each set of this exercise. Leave at 0 to use your default rest timer.': 'พักหลังแต่ละเซ็ตของท่านี้ ปล่อยไว้ที่ 0 เพื่อใช้ตัวจับเวลาพักค่าเริ่มต้น',
+ 'Flash screen when timer ends': 'กะพริบหน้าจอเมื่อหมดเวลา',
+ 'Import from Hevy': 'นำเข้าจาก Hevy',
+ 'Pull your history with a Hevy Pro API key': 'ดึงประวัติด้วยคีย์ API ของ Hevy Pro',
+ 'Pull your history with a Hevy Pro API key. The key is only used for this import and is not saved.': 'ดึงประวัติด้วยคีย์ API ของ Hevy Pro คีย์ใช้สำหรับการนำเข้าครั้งนี้เท่านั้นและจะไม่ถูกบันทึก',
+ 'Hevy API key': 'คีย์ API ของ Hevy',
+ 'Get your API key': 'รับคีย์ API ของคุณ',
+ 'Hevy → Settings → Developer': 'Hevy → การตั้งค่า → นักพัฒนา',
+ 'Paste your Hevy API key first': 'วางคีย์ API ของ Hevy ก่อน',
+ 'Fetch from Hevy': 'ดึงจาก Hevy',
+ 'Fetching from Hevy…': 'กำลังดึงจาก Hevy…',
+ 'Fetching exercises… ({0}/{1})': 'กำลังดึงท่าออกกำลังกาย… ({0}/{1})',
+ 'Fetching workouts… ({0}/{1})': 'กำลังดึงการฝึก… ({0}/{1})',
+ 'Fetching weigh-ins… ({0}/{1})': 'กำลังดึงน้ำหนักตัว… ({0}/{1})',
+ 'Matching exercises…': 'กำลังจับคู่ท่าออกกำลังกาย…',
+ 'Could not reach Hevy — check the key and try again': 'ติดต่อ Hevy ไม่ได้ — ตรวจสอบคีย์แล้วลองอีกครั้ง',
+ 'That Hevy API key was refused': 'คีย์ API ของ Hevy ถูกปฏิเสธ',
+ 'Nothing to import from Hevy': 'ไม่มีอะไรให้นำเข้าจาก Hevy',
+ 'Import workouts': 'นำเข้าการฝึก',
+ 'Import routines': 'นำเข้าโปรแกรม',
+ 'Import weigh-ins': 'นำเข้าน้ำหนักตัว',
+ '{0} new · {1} days already here': 'ใหม่ {0} · มีอยู่แล้ว {1} วัน',
+ '{0} routines · {1} exercises — added as new plans': '{0} โปรแกรม · {1} ท่า — เพิ่มเป็นแผนใหม่',
+ '{0} routines imported': 'นำเข้า {0} โปรแกรมแล้ว',
+ 'Fetching routines… ({0}/{1})': 'กำลังดึงโปรแกรม… ({0}/{1})',
+ 'Hevy stores weights in kg — they will be converted to {0}.': 'Hevy เก็บน้ำหนักเป็นกก. — จะถูกแปลงเป็น {0}',
+ 'Back': 'กลับ',
+ 'Reps up to': 'ครั้งสูงสุด',
+ 'Exclude from automatic progression': 'ไม่รวมในการเพิ่มน้ำหนักอัตโนมัติ',
+ 'Use for planned deloads. Workouts stay in history and statistics.': 'ใช้สำหรับดีโหลดที่วางแผนไว้ การฝึกยังอยู่ในประวัติและสถิติ',
+ 'The next regular target continues from the last included workout.': 'เป้าหมายปกติครั้งถัดไปจะต่อจากการฝึกล่าสุดที่นับรวม',
+ 'Open progression settings': 'เปิดการตั้งค่าการเพิ่มน้ำหนัก',
+ 'Hevy is rate-limiting requests — wait a minute and try again': 'Hevy จำกัดจำนวนคำขอ — รอสักครู่แล้วลองอีกครั้ง',
}
diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js
index 2f56a2268..a3dcfbf16 100644
--- a/frontend/src/locales/tr.js
+++ b/frontend/src/locales/tr.js
@@ -714,5 +714,7 @@ export default {
'Add session note': 'Antrenman notu ekle',
'Edit session note': 'Antrenman notunu düzenle',
'How the session went as a whole.': 'Antrenmanın genel olarak nasıl geçtiği.',
- 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-pause her zaman bu tekrar sayısında bir ısınma seti ve bir rest-pause çalışma seti olarak çalışılır — “Setler” kullanılmaz.'
+ 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-pause her zaman bu tekrar sayısında bir ısınma seti ve bir rest-pause çalışma seti olarak çalışılır — “Setler” kullanılmaz.',
+ 'Open progression settings': 'İlerleme ayarlarını aç',
+ 'Hevy is rate-limiting requests — wait a minute and try again': 'Hevy istekleri sınırlıyor — bir dakika bekleyip tekrar deneyin',
}
diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js
index 98d16663e..3122001b4 100644
--- a/frontend/src/locales/zh.js
+++ b/frontend/src/locales/zh.js
@@ -714,5 +714,7 @@ export default {
'Add session note': '添加训练备注',
'Edit session note': '编辑训练备注',
'How the session went as a whole.': '这次训练整体感觉如何。',
- 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-pause 始终按这个次数练一个热身组,再加一个 rest-pause 正式组 —— 不使用“组数”。'
+ 'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-pause 始终按这个次数练一个热身组,再加一个 rest-pause 正式组 —— 不使用“组数”。',
+ 'Open progression settings': '打开进阶设置',
+ 'Hevy is rate-limiting requests — wait a minute and try again': 'Hevy 正在限制请求——请稍等一分钟后重试',
}
diff --git a/frontend/src/sheets.jsx b/frontend/src/sheets.jsx
index 008314eac..39d8e2e18 100644
--- a/frontend/src/sheets.jsx
+++ b/frontend/src/sheets.jsx
@@ -297,6 +297,7 @@ function HevyImportSheet({ close }) {
setPayload(data)
} catch (e) {
if (e instanceof HevyApiError && e.message === 'auth') toast(t('That Hevy API key was refused'))
+ else if (e instanceof HevyApiError && e.message === 'rate-limit') toast(t('Hevy is rate-limiting requests — wait a minute and try again'))
else if (e instanceof HevyApiError && e.message === 'empty') toast(t('Paste your Hevy API key first'))
else toast(t('Could not reach Hevy — check the key and try again'))
} finally {
@@ -716,15 +717,23 @@ export function swapActiveWorkoutExercise(index) {
const active = S().active
if (!active?.entries?.[index]) return
- exercisePicker(ex => exConfigSheet(ex, null, cfg => {
+ const picker = exercisePicker(ex => exConfigSheet(ex, null, cfg => {
+ // The picker is a chooser here, not a stack you keep adding from: one swap, then back to
+ // the workout. (The add flow deliberately leaves it open.)
+ picker.close()
const full = { ...cfg, id: ex.id }
+ const st = S()
+ // Same rows the add flow builds: last time's loads and, in a planned session, the
+ // prescription — swapping barbell for dumbbell bench must not start you at an empty bar.
+ const freestyle = !st.active?.routineId
+ const step = defaultIncrement(ex.id, st.unit)
+ const plan = freestyle ? null : nextPrescription(st, full, st.routines.find(r => r.id === st.active.routineId))
+ const built = buildSets(st, full, { step, ...(freestyle ? { preferLast: true } : {}) })
const replacement = {
id: ex.id,
target: { ...cfg },
- plan: null,
- sets: applyIntensifierPlan(buildSets({ ...S(), workouts: [] }, full, {
- step: defaultIncrement(ex.id, S().unit)
- }), full)
+ plan,
+ sets: applyIntensifierPlan(freestyle ? built : applyPrescription(built, plan, step), full)
}
const current = S().active?.entries?.[index]
if (!current) return
@@ -846,10 +855,12 @@ function ProgressionFields({ ex, mode, c, setC, routine, unit, perSide }) {
step={mode === 'time' ? 5 : 1.25} decimal={mode !== 'time'} invalid={invalid} className={invalid ? 'invalid' : ''}
onChange={v => setC(x => ({ ...x, inc: v }))} />
{active === 'double' && <>
- <Stepper label={t('Reps from')} value={range.repsMin} step={stride} decimal={false}
- onChange={v => setC(x => ({ ...x, ...normalizeRepRange(x.reps, v, stride) }))} />
- <Stepper label={t('Reps up to')} value={range.reps} step={stride} decimal={false}
- onChange={v => setC(x => ({ ...x, ...normalizeRepRange(v, x.repsMin, stride) }))} />
+ {/* The draft stays as typed: normalising on every keystroke turned "12" into 92 (the
+ "1" was pulled above the lower bound first). Save and the engine normalise anyway. */}
+ <Stepper label={t('Reps from')} value={c.repsMin ?? range.repsMin} step={stride} decimal={false}
+ onChange={v => setC(x => ({ ...x, repsMin: v }))} />
+ <Stepper label={t('Reps up to')} value={c.reps ?? range.reps} step={stride} decimal={false}
+ onChange={v => setC(x => ({ ...x, reps: v }))} />
</>}
</div>}
{invalid && <div className="small" role="alert" style={{ color: 'var(--red)', marginTop: -10, marginBottom: 18 }}>
diff --git a/frontend/src/views/RoutineEdit.jsx b/frontend/src/views/RoutineEdit.jsx
index 5a331ff70..9c41ba314 100644
--- a/frontend/src/views/RoutineEdit.jsx
+++ b/frontend/src/views/RoutineEdit.jsx
@@ -251,7 +251,14 @@ function useRoutineReorder(routineIdentity, exercises, onDrop) {
const onContextMenu = event => { if (gestureRef.current?.active && event.target.closest?.('[data-routine-row]')) event.preventDefault() }
const onDragStart = event => { if (event.target.closest?.('[data-routine-row]')) event.preventDefault() }
+ // Touch: the rows keep `touch-action: pan-y` so the list still scrolls with a finger, but once
+ // a long-press has lifted a row the browser must not claim the vertical drag as a pan — it
+ // would fire pointercancel and scroll instead. preventDefault on a pointer event cannot stop
+ // that; only a non-passive touchmove listener can, and only while a drag is actually active.
+ const onTouchMove = event => { if (gestureRef.current?.active) event.preventDefault() }
+
document.addEventListener('pointerdown', onPointerDown)
+ document.addEventListener('touchmove', onTouchMove, { passive: false })
document.addEventListener('pointermove', onPointerMove, { passive: false })
document.addEventListener('pointerup', onPointerUp, { passive: false })
document.addEventListener('pointercancel', onPointerCancel)
@@ -266,6 +273,7 @@ function useRoutineReorder(routineIdentity, exercises, onDrop) {
clearTimer(gesture); clearFrame(); gestureRef.current = null
releaseCapture(gesture)
document.removeEventListener('pointerdown', onPointerDown)
+ document.removeEventListener('touchmove', onTouchMove)
document.removeEventListener('pointermove', onPointerMove)
document.removeEventListener('pointerup', onPointerUp)
document.removeEventListener('pointercancel', onPointerCancel)
diff --git a/frontend/src/views/Workout.jsx b/frontend/src/views/Workout.jsx
index 43851591a..444d773f5 100644
--- a/frontend/src/views/Workout.jsx
+++ b/frontend/src/views/Workout.jsx
@@ -444,10 +444,21 @@ function ActiveWorkout() {
if (!activeEntry) return
const full = { ...cfg, id: activeEntry.id }
const activeRoutine = s.routines.find(r => r.id === s.active.routineId)
+ const step = defaultIncrement(activeEntry.id, s.unit)
+ // A config without a set count keeps the rows the session already has.
+ if (!(full.sets > 0)) full.sets = activeEntry.sets.filter(x => !isWarmupRow(x)).length || 1
const plan = nextPrescription(s, full, activeRoutine)
+ // The sheet edits sets, reps, weight and warm-ups as well as the rule — so the rows are
+ // rebuilt from the new config the way the session was, and only what you already logged
+ // is kept in place (done warm-ups first, then done work sets, then the fresh remainder).
+ const fresh = applyIntensifierPlan(applyPrescription(buildSets(s, full, { step }), plan, step), full)
+ const doneWarm = activeEntry.sets.filter(x => x.done && isWarmupRow(x))
+ const doneWork = activeEntry.sets.filter(x => x.done && !isWarmupRow(x))
+ const freshWarm = fresh.filter(isWarmupRow)
+ const freshWork = fresh.filter(x => !isWarmupRow(x))
activeEntry.target = { ...cfg }
activeEntry.plan = plan
- activeEntry.sets = applyPrescription(activeEntry.sets, plan, defaultIncrement(activeEntry.id, s.unit))
+ activeEntry.sets = [...doneWarm, ...freshWarm.slice(doneWarm.length), ...doneWork, ...freshWork.slice(doneWork.length)]
}), null, routine)
}
diff --git a/scripts/build-hevy-id-map.mjs b/scripts/build-hevy-id-map.mjs
index a01bd03dd..1e626a134 100644
--- a/scripts/build-hevy-id-map.mjs
+++ b/scripts/build-hevy-id-map.mjs
@@ -39,6 +39,10 @@ function hevyApiKey() {
* Only entries we have verified against EXIDX. Gaps (hip thrust, rower, …)
* are intentionally omitted so they import as custom exercises.
*/
+// Titles whose closest catalogue entry is a different movement — better a custom exercise than
+// a wrong one. Keep in sync with the note at the top of the generated map.
+const NEVER_BY_TITLE = new Set(['crunch', 'side plank', 'squat (machine)', 'triceps extension (cable)', 'rear delt reverse fly (cable)'])
+
const BY_TITLE = {
// Reported from a real import as customs — same lifts, Hevy vocabulary.
'bulgarian split squat (dumbbell)': '0410',
@@ -46,7 +50,6 @@ const BY_TITLE = {
'chest supported incline row (dumbbell)': '0327',
'knee raise parallel bars': '0826',
'lat pulldown - close grip (cable)': '2616',
- 'rear delt reverse fly (cable)': '0602',
'rear delt reverse fly (dumbbell)': '0383',
'rear delt reverse fly (machine)': '0602',
'reverse lunge (dumbbell)': '0381',
@@ -217,7 +220,7 @@ async function main() {
if (id) {
map[t.id] = id
const titleKey = String(t.title || '').trim().toLowerCase()
- if (titleKey && !titleMap[titleKey]) titleMap[titleKey] = id
+ if (titleKey && !NEVER_BY_TITLE.has(titleKey) && !titleMap[titleKey]) titleMap[titleKey] = id
} else unmatched.push(t)
}