Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
684b0054ad | ||
|
|
95654b4f55 | ||
|
|
9c7c351345 | ||
|
|
4e015ec74d | ||
|
|
4e3377f4c3 | ||
|
|
80a8026a79 | ||
|
|
3707a215f0 |
No files matched your search
@@ -1,5 +1,37 @@
|
||||
# Changelog
|
||||
|
||||
## v1.3.5 — 2026-09-06
|
||||
|
||||
One bug, and the one everybody with the Android app and their own API key ran into. Web bundle and
|
||||
APK; the API only carries the version number.
|
||||
|
||||
- 🔑 **"Bring my own API key" works on the phone.** Since v1.3.0 every key-store call on Android
|
||||
hung before it started: the secure-storage plugin was handed to the app as the value of a promise,
|
||||
and a Capacitor plugin object answers *any* property name with a native method — `then`
|
||||
included — so the promise took it for a thenable, called a native `SecureStorage.then()` that does
|
||||
not exist, and never settled. That one stuck `await` was all three reports at once: "Save and use
|
||||
the Coach" greyed out forever, the key "not saved" when you came back, and a Coach that sat on
|
||||
"thinking…" without end because the job read the key first. The plugin now travels inside a plain
|
||||
object, a test drives the store through a Capacitor-style proxy so it cannot come back, and the
|
||||
whole flow — save, intake, plan, restart with the key still there — was run on an emulator before
|
||||
tagging. The web app and the "use my self-hosted openGym" mode were never affected.
|
||||
(issues #42, #58; reported by many on Discord)
|
||||
|
||||
## v1.3.4 — 2026-09-05
|
||||
|
||||
Two things noticed on the phone right after v1.3.3. Web bundle and APK; the API only carries the
|
||||
version number.
|
||||
|
||||
- 🎨 **The effort picker looks like the rest of the app.** The v1.3.3 sheet was a grid of colour-edged
|
||||
tiles that matched nothing else on screen. It is now the same list the ⋯ menus use: a tinted
|
||||
square with the value where the icon sits, the sentence as the row, a tick on the current one, and
|
||||
an "Exact RIR" row carrying the app's own stepper, tinted like the logged cell. Same six levels, same
|
||||
colours, same free value.
|
||||
- 🖼️ **Animations that fail to load fall back instead of breaking.** If the animation cannot be
|
||||
fetched (dropped connection, CDN hiccup, an instance that gates media behind a session) the still
|
||||
picture takes its place; if that fails too, a neutral tile does, and a tap tries again. No more
|
||||
broken-image glyph on a white block.
|
||||
|
||||
## v1.3.3 — 2026-09-05
|
||||
|
||||
The workout screen gets out of the way, and the bug round from the board. Same day as v1.3.2 on
|
||||
|
||||
@@ -210,9 +210,9 @@ host side of that volume, not the variable.
|
||||
## Roadmap
|
||||
|
||||
The plan lives in [ROADMAP.md](ROADMAP.md) and on the
|
||||
[GitLab milestones](https://gitlab.com/DuarteSantos8/opengym/-/milestones): v1.3.3 programmes and
|
||||
[GitLab milestones](https://gitlab.com/DuarteSantos8/opengym/-/milestones): v1.3.5 programmes and
|
||||
progression (explicit warm-up/work phases, AMRAP driver selection, multi-week programmes, adaptive
|
||||
1RM), v1.3.4 accounts and sync (password and OIDC login, personal-trainer role, remote MCP), v1.3.5
|
||||
1RM), v1.3.6 accounts and sync (password and OIDC login, personal-trainer role, remote MCP), v1.3.7
|
||||
mobile (timer in the notification bar, widgets, Withings). Ideas and merge requests welcome — the
|
||||
[board](https://gitlab.com/DuarteSantos8/opengym/-/boards) shows what is planned, in progress and
|
||||
waiting for a test on the staging instance.
|
||||
|
||||
+15
-14
@@ -14,14 +14,14 @@ minor bump is reserved for something that breaks compatibility.
|
||||
|
||||
---
|
||||
|
||||
## v1.3.2 — Cleaner workout (mid September 2026)
|
||||
## v1.3.2 and v1.3.3 — Cleaner workout (released 2026-09-05)
|
||||
|
||||
**Theme: the workout screen gets out of the way.** Fewer things to tap, the things you tap every set
|
||||
stay where they are, everything else moves one tap away. Compared with Hevy or Strong the screen was
|
||||
busy: ~10 buttons under a card and ~8 per set. The new default is one "⋯" per exercise, the set
|
||||
number as the set's own menu, and an optional list view.
|
||||
|
||||
Staged on gym-test (branches `mrbatch-0904` and `workout-clean`):
|
||||
Shipped: v1.3.2 is the contributors' batch, v1.3.3 the redesign and the bug round on top of it.
|
||||
|
||||
- Workout view: cards or a scrollable list, with the header pinned in list mode (!96, #28, #44, #50)
|
||||
- One menu per exercise (note, details, progression, bar weight, warm-up, superset, swap, move,
|
||||
@@ -45,18 +45,19 @@ Staged on gym-test (branches `mrbatch-0904` and `workout-clean`):
|
||||
- Infrastructure: nginx re-resolves the api container (#16); Renovate config repaired (#37); CI with
|
||||
JUnit/coverage, stack smoke test, Trivy scan, SBOMs, release preflight, fork-MR pipelines
|
||||
|
||||
Still to do in this version:
|
||||
Also in v1.3.3: exercise history and a progress line from the ⋯ menu (#43), favourite exercises
|
||||
(#6), the in-app update check for the Android build (!40, #38, #9), the Coach save fix on Android
|
||||
(#42), bands as bodyweight equipment (#39), kg ↔ lb conversion (#22), the centre tab button on the
|
||||
workout screen (#29, #21), warm-up ramps on the exercise increment, and the small fixes from the
|
||||
tester round.
|
||||
|
||||
- Resume returns to the exercise you were on (#21) and the centre tab button means something
|
||||
during a workout — "Resume" only when you are elsewhere, otherwise nothing or "pause" (#29)
|
||||
- AI Coach on Android with a bring-your-own API key: reproduce and fix (#42)
|
||||
- Favourite exercises, sorted first in the picker (#6)
|
||||
- Copy of a copy should not become "Name (Copy) (Copy)"; the "+" in the swap picker should quick-add
|
||||
like everywhere else; "By muscle" inside the Add-exercise sheet keeps the keyboard-aware search
|
||||
- Warm-up ramp uses the per-exercise increment, not the default one
|
||||
- Release notes per contributor, CHANGELOG, APK on the website, Discord announcement
|
||||
Left over from this block:
|
||||
|
||||
## v1.3.3 — Programmes & progression (October 2026)
|
||||
- "By muscle" inside the Add-exercise sheet keeps the keyboard-aware search
|
||||
- A real pause for the workout timers (#29 asked for it)
|
||||
- Discord announcement (owner)
|
||||
|
||||
## v1.3.5 — Programmes & progression (October 2026)
|
||||
|
||||
**Theme: training structure beyond one weekly template.** Most of this is the Space-Hermes series.
|
||||
It changes the training model (per-set roles, explicit phases, normalisation on every persist), so
|
||||
@@ -80,7 +81,7 @@ it goes in one MR at a time, each rebased and tested on gym-test before the next
|
||||
- Catalogue cleanup: exercises that should not carry weight, incline and interval fields for
|
||||
cardio (#46); timers for planks and outdoor cardio are already there, document them (#45)
|
||||
|
||||
## v1.3.4 — Accounts & sync (November 2026)
|
||||
## v1.3.6 — Accounts & sync (November 2026)
|
||||
|
||||
**Theme: who may sign in, and what else may read or write your data.**
|
||||
|
||||
@@ -98,7 +99,7 @@ it goes in one MR at a time, each rebased and tested on gym-test before the next
|
||||
logged sessions lost after editing a routine (#25)
|
||||
- Admin: per-user export, invite management, audit log filters
|
||||
|
||||
## v1.3.5 — Mobile (December 2026)
|
||||
## v1.3.7 — Mobile (December 2026)
|
||||
|
||||
**Theme: the Android app catches up with the web app.**
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ openapi: 3.1.0
|
||||
|
||||
info:
|
||||
title: openGym API
|
||||
version: 1.3.3
|
||||
version: 1.3.5
|
||||
summary: Passkey (WebAuthn) auth + per-user state storage for openGym
|
||||
description: |
|
||||
The backend of [openGym](https://opengym.duarte-santos.ch) — a free, open-source
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "gym-api",
|
||||
"version": "1.3.3",
|
||||
"version": "1.3.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "gym-api",
|
||||
"version": "1.3.3",
|
||||
"version": "1.3.5",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@simplewebauthn/server": "^13.1.1",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gym-api",
|
||||
"version": "1.3.3",
|
||||
"version": "1.3.5",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "server.js",
|
||||
|
||||
@@ -7,8 +7,8 @@ android {
|
||||
applicationId "ch.duartesantos.opengym"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 17
|
||||
versionName "1.3.3"
|
||||
versionCode 19
|
||||
versionName "1.3.5"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
aaptOptions {
|
||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "opengym-frontend",
|
||||
"version": "1.3.3",
|
||||
"version": "1.3.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "opengym-frontend",
|
||||
"version": "1.3.3",
|
||||
"version": "1.3.5",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@aparajita/capacitor-secure-storage": "^7.1.6",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "opengym-frontend",
|
||||
"private": true,
|
||||
"version": "1.3.3",
|
||||
"version": "1.3.5",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -13,21 +13,35 @@ import Icon from './Icon.jsx'
|
||||
// a custom exercise without media. Any other/legacy value behaves as 'full'.
|
||||
export default function Media({ ex, id, compact, minimizable }) {
|
||||
const [playing, setPlaying] = useState(true)
|
||||
// 'gif' → the animation failed, the still is showing; 'all' → the still failed too. Media is
|
||||
// fetched from wherever the build points (a mount, a CDN): a dropped connection, an expired
|
||||
// session on a gated instance or a CDN hiccup used to leave the browser's broken-image glyph
|
||||
// on a white block. Now the still stands in for the animation, a neutral tile stands in for
|
||||
// both, and a tap tries again — no text, so nothing new to translate.
|
||||
const [failed, setFailed] = useState(null)
|
||||
const gifSize = useStore(s => s.S.gifSize)
|
||||
const update = useStore(s => s.update)
|
||||
if (!ex.gif) return null
|
||||
if (minimizable && gifSize === 'off') return null
|
||||
const mini = minimizable && gifSize === 'mini'
|
||||
const toggleSize = e => { e.stopPropagation(); update(s => { s.gifSize = mini ? 'full' : 'mini' }) }
|
||||
const showGif = playing && failed == null
|
||||
const onError = () => setFailed(showGif ? 'gif' : 'all')
|
||||
const onTap = () => {
|
||||
if (failed) { setFailed(null); setPlaying(true); return }
|
||||
setPlaying(p => !p)
|
||||
}
|
||||
return (
|
||||
<div className={'exmedia' + (compact ? ' compact' : '') + (mini ? ' mini' : '')} id={id} onClick={() => setPlaying(p => !p)}>
|
||||
<img decoding="async" draggable={false} src={playing ? gifSrc(ex) : imgSrc(ex)} alt={exerciseNameFor(ex)} />
|
||||
<div className={'exmedia' + (compact ? ' compact' : '') + (mini ? ' mini' : '') + (failed === 'all' ? ' broken' : '')} id={id} onClick={onTap}>
|
||||
{failed === 'all'
|
||||
? <div className="exmedia-x"><Icon name="dumbbell" /></div>
|
||||
: <img decoding="async" draggable={false} src={showGif ? gifSrc(ex) : imgSrc(ex)} alt={exerciseNameFor(ex)} onError={onError} />}
|
||||
{minimizable && (
|
||||
<button className="giftoggle" onClick={toggleSize}>
|
||||
<Icon name={mini ? 'expand' : 'minimize'} />{mini ? t('Expand') : t('Minimize')}
|
||||
</button>
|
||||
)}
|
||||
{!mini && (
|
||||
{!mini && !failed && (
|
||||
<span className="gifhint">
|
||||
<Icon name={playing ? 'pause' : 'play'} />{playing ? t('tap to pause') : t('tap to play')}
|
||||
</span>
|
||||
|
||||
+17
-43
@@ -639,6 +639,12 @@ h4.sec{
|
||||
at 180px you had to scroll a full screen between two exercises done back-to-back */
|
||||
.exmedia.compact img{height:120px}
|
||||
.exmedia.mini img{height:84px}
|
||||
/* both the animation and the still failed to load: a neutral tile instead of the browser's
|
||||
broken-image glyph; same heights as the picture so the card does not jump. tap retries. */
|
||||
.exmedia.broken{background:var(--surface-2)}
|
||||
.exmedia-x{width:100%;height:320px;display:flex;align-items:center;justify-content:center;color:var(--label-3);font-size:34px}
|
||||
.exmedia.compact .exmedia-x{height:120px}
|
||||
.exmedia.mini .exmedia-x{height:84px}
|
||||
|
||||
.sethead{
|
||||
display:flex;align-items:center;gap:8px;padding:0 0 6px;
|
||||
@@ -715,50 +721,18 @@ h4.sec{
|
||||
.setrow.eff3 .effcell-stp>button[aria-label="Increase"]{width:22px}
|
||||
.setrow.eff3 .effcell-stp .val{font-size:14px}
|
||||
/* effort quick picker sheet: colour-coded preset buttons, hardest (purple) first */
|
||||
.effpick{display:grid;grid-template-columns:repeat(2,1fr);gap:9px;margin-bottom:16px}
|
||||
.effpick-b{
|
||||
display:flex;flex-direction:column;align-items:flex-start;gap:3px;
|
||||
padding:12px 14px;border-radius:13px;text-align:left;
|
||||
background:var(--surface);border:1.5px solid var(--sep-op);
|
||||
border-left:4px solid var(--bc);
|
||||
transition:background var(--fast),transform var(--fast),border-color var(--fast);
|
||||
/* effort picker: the ⋯-menu list with the value in the icon square, tinted per band; the
|
||||
exact-value row carries the same stepper as the logged cell in the set row. */
|
||||
.effpick.menu-list .menu-item .effpick-n{
|
||||
background:var(--bc);color:#fff;font-size:13px;font-weight:700;letter-spacing:-.02em;
|
||||
font-variant-numeric:tabular-nums;
|
||||
}
|
||||
.effpick-b:active{transform:scale(.97)}
|
||||
.effpick-b.on{background:color-mix(in srgb,var(--bc) 16%,var(--surface));border-color:var(--bc)}
|
||||
.effpick-n{font-size:20px;font-weight:700;color:var(--bc);line-height:1;font-variant-numeric:tabular-nums}
|
||||
.effpick-f{font-size:12px;color:var(--label-2);line-height:1.25}
|
||||
/* the free field sits as a full-width row the same size as a preset button: its "Exact RIR"
|
||||
label on the left, a −/value/+ group in the middle, and the scale name on the right, same
|
||||
padding and radius as .effpick-b. the whole row borders in the current band colour. */
|
||||
.effpick-free{
|
||||
display:flex;align-items:center;justify-content:space-between;gap:10px;
|
||||
padding:10px 14px;border-radius:13px;margin-top:2px;
|
||||
background:var(--surface);border:1.5px solid var(--sep-op);
|
||||
transition:border-color var(--fast);
|
||||
}
|
||||
.effpick-free-l{font-size:14px;color:var(--label-2);flex:none}
|
||||
.effpick-free-unit{font-size:13px;font-weight:600;color:var(--label-3);flex:none}
|
||||
/* the −/value/+ group: a rounded surface holding a big tappable number between two step
|
||||
buttons. tinted (color:inherit) to the band colour when a value is set. */
|
||||
.effpick-step{
|
||||
display:flex;align-items:center;gap:2px;flex:none;
|
||||
background:var(--surface-2);border-radius:10px;overflow:hidden;
|
||||
}
|
||||
.effpick-step button{
|
||||
width:38px;height:40px;flex:none;color:currentColor;font-size:16px;--icon-stroke:2.2;
|
||||
display:flex;align-items:center;justify-content:center;transition:background var(--fast);
|
||||
}
|
||||
.effpick-step button:active{background:var(--surface-3)}
|
||||
/* the `.num` base styling (transparent bg, no border) is scoped to `.stp .num`; this input is
|
||||
not in a `.stp`, so it must set its own or the browser paints a native white field. */
|
||||
.effpick-free-in.num{
|
||||
flex:none;width:64px;text-align:center;padding:0;height:40px;
|
||||
background:none;border:none;outline:none;color:currentColor;
|
||||
font-size:20px;font-weight:700;font-variant-numeric:tabular-nums;
|
||||
-moz-appearance:textfield;appearance:textfield;
|
||||
}
|
||||
.effpick-free-in.num::-webkit-inner-spin-button{display:none}
|
||||
.effpick-free-in.num::placeholder{color:var(--label-3);font-weight:600}
|
||||
.effpick .menu-item.on{background:color-mix(in srgb,var(--bc) 14%,var(--surface))}
|
||||
.effpick .menu-on.is-on{color:var(--bc)}
|
||||
.effpick .effpick-free{padding-right:8px}
|
||||
.effpick .effpick-free .stp{flex:none;width:148px}
|
||||
.effpick .effpick-free .stp .num{font-size:17px;font-weight:600}
|
||||
.effpick .effpick-free .stp .num::placeholder{color:var(--label-3);font-weight:500}
|
||||
.setrow.done .n{background:var(--acc);color:var(--on-acc)}
|
||||
.setrow.done{opacity:.45}
|
||||
/* drop-set drops / rest-pause bursts riding on a work row, editable like the row itself
|
||||
|
||||
@@ -10,12 +10,19 @@
|
||||
const KEY = 'coach.apiKey'
|
||||
const memory = new Map()
|
||||
|
||||
// The loaded plugin travels inside a plain object, never as a promise's own value (no `await`
|
||||
// or `.then` may ever hand the proxy back bare — the wrapper below is the whole point). Capacitor's
|
||||
// registerPlugin() hands out a Proxy that answers EVERY property name with a native-method
|
||||
// wrapper — `then` included — so a promise that resolves to the proxy itself takes it for a
|
||||
// thenable, calls SecureStorage.then() on the native side ("not implemented on android"), and
|
||||
// never settles. That one await hung the whole feature on the phone: "Save and use the Coach"
|
||||
// greyed out forever, the key "not saved", the Coach "thinking" without end (issues #42, #58).
|
||||
let pluginPromise = null
|
||||
function plugin() {
|
||||
if (!pluginPromise) {
|
||||
pluginPromise = import('@aparajita/capacitor-secure-storage')
|
||||
.then(m => (m && m.SecureStorage && typeof m.SecureStorage.get === 'function' ? m.SecureStorage : null))
|
||||
.catch(() => null)
|
||||
.then(m => ({ store: m && m.SecureStorage && typeof m.SecureStorage.get === 'function' ? m.SecureStorage : null }))
|
||||
.catch(() => ({ store: null }))
|
||||
}
|
||||
return pluginPromise
|
||||
}
|
||||
@@ -30,7 +37,7 @@ export const withTimeout = (promise, ms = NATIVE_TIMEOUT_MS) => new Promise((res
|
||||
})
|
||||
|
||||
export async function getApiKey() {
|
||||
const p = await plugin()
|
||||
const { store: p } = await plugin()
|
||||
if (p) {
|
||||
try { const v = await withTimeout(p.get(KEY)); return typeof v === 'string' && v ? v : null } catch { /* fall through */ }
|
||||
}
|
||||
@@ -39,14 +46,14 @@ export async function getApiKey() {
|
||||
export async function setApiKey(value) {
|
||||
const v = String(value || '').trim()
|
||||
if (!v) return clearApiKey()
|
||||
const p = await plugin()
|
||||
const { store: p } = await plugin()
|
||||
if (p) {
|
||||
try { await withTimeout(p.set(KEY, v)); memory.delete(KEY); return } catch { /* fall through */ }
|
||||
}
|
||||
memory.set(KEY, v)
|
||||
}
|
||||
export async function clearApiKey() {
|
||||
const p = await plugin()
|
||||
const { store: p } = await plugin()
|
||||
if (p) { try { await withTimeout(p.remove(KEY)) } catch { /* nothing to clear */ } }
|
||||
memory.delete(KEY)
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
// @vitest-environment node
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
|
||||
// A stand-in for what @capacitor/core's registerPlugin() really returns: a Proxy that turns ANY
|
||||
// property — `then` included — into a method wrapper whose native call fails asynchronously
|
||||
// without ever invoking the callbacks it was handed. Resolving a promise with that object makes
|
||||
// the promise wait for `then` to call back, which it never does (issues #42 / #58).
|
||||
const calls = []
|
||||
const backing = new Map()
|
||||
const impl = {
|
||||
get: async k => (backing.has(k) ? backing.get(k) : null),
|
||||
set: async (k, v) => { backing.set(k, v) },
|
||||
remove: async k => backing.delete(k)
|
||||
}
|
||||
const SecureStorage = new Proxy({}, {
|
||||
get(_, prop) {
|
||||
if (prop === '$$typeof') return undefined
|
||||
if (prop === 'toJSON') return () => ({})
|
||||
return (...args) => {
|
||||
calls.push(String(prop))
|
||||
if (impl[prop]) return impl[prop](...args)
|
||||
return Promise.reject(new Error(`"SecureStorage.${String(prop)}()" is not implemented on android`))
|
||||
}
|
||||
}
|
||||
})
|
||||
vi.mock('@aparajita/capacitor-secure-storage', () => ({ SecureStorage }))
|
||||
|
||||
const secrets = await import('./coach-secrets.js')
|
||||
|
||||
const within = (p, ms) => Promise.race([p, new Promise((_, rej) => setTimeout(() => rej(new Error(`hung for ${ms} ms`)), ms))])
|
||||
|
||||
describe('coach-secrets against a Capacitor-style plugin proxy', () => {
|
||||
beforeEach(() => { calls.length = 0; backing.clear() })
|
||||
|
||||
it('a round trip settles instead of waiting on the proxy\'s never-answering then()', async () => {
|
||||
await within(secrets.setApiKey('sk-live-1'), 1000)
|
||||
expect(await within(secrets.getApiKey(), 1000)).toBe('sk-live-1')
|
||||
await within(secrets.clearApiKey(), 1000)
|
||||
expect(await within(secrets.getApiKey(), 1000)).toBe(null)
|
||||
expect(calls).not.toContain('then')
|
||||
})
|
||||
|
||||
it('goes through the platform store, not the in-memory fallback', async () => {
|
||||
await within(secrets.setApiKey('sk-live-2'), 1000)
|
||||
expect([...backing.keys()]).toEqual(['coach.apiKey'])
|
||||
expect(calls).toEqual(['set'])
|
||||
})
|
||||
})
|
||||
+28
-31
@@ -1368,53 +1368,50 @@ export const glyphPicker = (current, onPick) => {
|
||||
// RPE sees the same buttons labelled on its own scale (toScale), coloured identically — the
|
||||
// colour is the effort, not the number, so 0 RIR and 10 RPE are both the "went to failure" end.
|
||||
function EffortPicker({ kind, value, onPick, close }) {
|
||||
// Local mirror so the highlighted preset and the free field track typing live; the store is
|
||||
// Local mirror so the ticked preset and the exact field track typing live; the store is
|
||||
// written on every change through onPick, the same as the stepper did.
|
||||
const [v, setV] = useState(value ?? null)
|
||||
const set = nv => { setV(nv); onPick(nv) }
|
||||
// `v` is in the profile's own scale (whatever sits on the set: s.rir or s.rpe). Compare in
|
||||
// RIR so the highlighted preset is right on either scale, and so a typed RPE colours the
|
||||
// RIR so the tick lands on the right preset on either scale, and so a typed RPE colours the
|
||||
// same as the RIR it equals.
|
||||
const curRir = rirOf(kind === 'rpe' ? { rpe: v } : { rir: v })
|
||||
// The band colour for the value currently on the field, so the exact-value row is tinted the
|
||||
// same way the presets and the workout row cell are — null (nothing typed) stays neutral.
|
||||
const curColor = effortColor(curRir)
|
||||
const commit = nv => { close(); onPick(nv) }
|
||||
const pick = rir => commit(toScale(kind, rir))
|
||||
const hd = EFFORT[kind].hd
|
||||
// Same list the ⋯ menus use: a tinted square with the value where the icon goes, the sentence
|
||||
// as the row title, a tick on the current one. The exact field is the app's own stepper,
|
||||
// tinted like the logged cell in the set row, so the sheet and the row read as one thing.
|
||||
return <>
|
||||
<h3>{t('How hard was that set?')}</h3>
|
||||
<div className="muted small" style={{ marginBottom: 14, lineHeight: 1.45 }}>
|
||||
{t('Tap how many reps you had left, or type an exact {0}.', EFFORT[kind].hd)}
|
||||
</div>
|
||||
<div className="effpick">
|
||||
<h3 style={{ marginBottom: 2 }}>{t('How hard was that set?')}</h3>
|
||||
<div className="muted small" style={{ marginBottom: 10 }}>{t('Tap how many reps you had left, or type an exact {0}.', hd)}</div>
|
||||
<div className="list menu-list effpick">
|
||||
{EFFORT_PRESETS.map(p => {
|
||||
const label = fmtNum(toScale(kind, p.rir)) + (p.tail ? '+' : '')
|
||||
const on = curRir != null && curRir === p.rir
|
||||
return <button key={p.rir} className={'effpick-b' + (on ? ' on' : '')}
|
||||
style={{ '--bc': p.color }} onClick={() => pick(p.rir)}>
|
||||
<span className="effpick-n">{label}</span>
|
||||
<span className="effpick-f">{t(p.feel)}</span>
|
||||
</button>
|
||||
return <div key={p.rir} className={'item menu-item' + (on ? ' on' : '')} style={{ '--bc': p.color }}
|
||||
{...tappable(() => pick(p.rir))}>
|
||||
<span className="lrow-i effpick-n">{label}</span>
|
||||
<div className="grow"><div className="tt">{t(p.feel)}</div></div>
|
||||
<span className={'menu-on' + (on ? ' is-on' : '')}><Icon name="check" /></span>
|
||||
</div>
|
||||
})}
|
||||
</div>
|
||||
{/* The free field keeps the flexibility the stepper had: a value between two presets, in
|
||||
the profile's own scale, capped to the top of it (there is no RPE 12). Sized like a
|
||||
preset so it reads as the seventh option — "or type your own" — not an afterthought.
|
||||
A −/+ pair flanks the number for 0.5-step nudging without leaving the sheet, coloured
|
||||
by the band the current value falls in (the same colour the presets and the row cell
|
||||
use); tapping the number itself still types an exact value. */}
|
||||
<div className="effpick-free" style={curColor ? { borderColor: curColor } : undefined}>
|
||||
<span className="effpick-free-l">{t('Exact {0}', EFFORT[kind].hd)}</span>
|
||||
<div className="effpick-step" style={curColor ? { color: curColor } : undefined}>
|
||||
<button aria-label="Decrease" onClick={() => set(stepEffort(kind, v, -1))}><Icon name="minus" /></button>
|
||||
<NumberField className="effpick-free-in" decimal nullable value={v ?? ''}
|
||||
placeholder={EFFORT[kind].hd} onChange={nv => set(capEffort(kind, nv))} />
|
||||
<button aria-label="Increase" onClick={() => set(stepEffort(kind, v, 1))}><Icon name="plus" /></button>
|
||||
<div className="item menu-item effpick-free">
|
||||
<div className="grow"><div className="tt">{t('Exact {0}', hd)}</div></div>
|
||||
<div className="stp effcell-stp"
|
||||
style={curColor ? { color: curColor, background: `color-mix(in srgb, ${curColor} 20%, var(--surface-2))` } : undefined}>
|
||||
<button aria-label="Decrease" onClick={() => set(stepEffort(kind, v, -1))}><Icon name="minus" /></button>
|
||||
<span className="val"><NumberField decimal nullable value={v ?? ''} placeholder="–"
|
||||
onChange={nv => set(capEffort(kind, nv))} /></span>
|
||||
<button aria-label="Increase" onClick={() => set(stepEffort(kind, v, 1))}><Icon name="plus" /></button>
|
||||
</div>
|
||||
</div>
|
||||
<span className="effpick-free-unit">{EFFORT[kind].hd}</span>
|
||||
</div>
|
||||
<div style={{ height: 10 }} />
|
||||
{v != null && <Button variant="ghost" className="dim" icon="xmark" onClick={() => commit(null)}>{t('Clear rating')}</Button>}
|
||||
{v != null && <>
|
||||
<div style={{ height: 10 }} />
|
||||
<Button variant="ghost" className="dim" icon="xmark" onClick={() => commit(null)}>{t('Clear rating')}</Button>
|
||||
</>}
|
||||
<div style={{ height: 4 }} />
|
||||
</>
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- GENERATED FILE - do not edit by hand.
|
||||
Built by scripts/build-api-docs.mjs from api/openapi.yaml (openGym API v1.3.3).
|
||||
Built by scripts/build-api-docs.mjs from api/openapi.yaml (openGym API v1.3.5).
|
||||
Regenerate with: node scripts/build-api-docs.mjs -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
@@ -232,7 +232,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon
|
||||
</div>
|
||||
<p class="api-facts">
|
||||
<span>OpenAPI 3.1.0</span>
|
||||
<span>openGym v1.3.3</span>
|
||||
<span>openGym v1.3.5</span>
|
||||
<span>28 endpoints</span>
|
||||
<span>AGPL-3.0-or-later</span>
|
||||
</p>
|
||||
|
||||
+28
-4
@@ -224,8 +224,11 @@
|
||||
<li>The <a href="https://gitlab.com/DuarteSantos8/opengym/-/releases" rel="noopener">GitLab release</a> for that version, which links to both.</li>
|
||||
</ul>
|
||||
<p>Got the file from anywhere else? Verify it against the registry's <code>.sha256</code>
|
||||
before installing. Updates: download the new APK and install it over the old one — same
|
||||
signing key, data stays. Everything is stored on the phone itself; the only network
|
||||
before installing. <b>Updates come to you:</b> when a newer release exists, Settings → Data
|
||||
shows "openGym vX available" — one tap downloads the signed APK, checks its SHA-256
|
||||
against the published checksum and opens the installer (no checksum, no install; the first
|
||||
time Android asks for the "install unknown apps" permission). Installing over the old
|
||||
version by hand works too — same signing key, data stays. Everything is stored on the phone itself; the only network
|
||||
traffic is fetching exercise images and animations from a CDN, on demand.</p>
|
||||
<p>The app requests notification permission only when you switch the workout-day reminder
|
||||
on, and declares <code>SCHEDULE_EXACT_ALARM</code> so reminders fire to the minute.
|
||||
@@ -302,6 +305,12 @@
|
||||
plan is never overwritten.</li>
|
||||
<li><b>Muscle preview:</b> while you build a routine, the body diagram shows what it
|
||||
hits.</li>
|
||||
<li><b>Favourites:</b> star an exercise in its details and it sorts first in the picker, the
|
||||
library and the muscle explorer; the picker gets a Favourites chip.</li>
|
||||
<li><b>kg ↔ lb, your numbers included:</b> switching the unit asks whether to convert
|
||||
everything you've logged and planned — sets, working weights, targets and
|
||||
increments, warm-up configs, body weight, goal, bar weights — or keep the values
|
||||
and only change the label.</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="f-prog">Progression — weights that follow a rule</h3>
|
||||
@@ -331,6 +340,18 @@
|
||||
<ul>
|
||||
<li><b>Guided sessions:</b> today's routine opens with weights pre-filled from last time,
|
||||
animated demos, a rest timer, and PR detection as you log.</li>
|
||||
<li><b>A screen that gets out of the way.</b> Each exercise has one ⋯ menu next to its
|
||||
name — note, details, progression, bar weight, warm-up set, superset with the
|
||||
previous or next exercise, swap, move, remove — and the set number is the set's own
|
||||
menu (drop set, rest-pause burst, remove). Nothing else sits between you and the numbers.
|
||||
Miss a button? Settings → During a workout → <b>Workout controls</b> brings any
|
||||
group back: +/− steppers, drop/burst shortcuts on every row, superset buttons in
|
||||
the header, move/swap/remove below the card.</li>
|
||||
<li><b>List view keeps the header pinned</b> — name, clock, set counter, discard and
|
||||
finish stay at the top while the session scrolls.</li>
|
||||
<li><b>History without leaving the workout:</b> ⋯ → History shows your best set
|
||||
(or estimated 1RM, longest hold, minutes) over time and the last ten sessions with every
|
||||
set, the volume and a PR marker. Also in an exercise's details in the library.</li>
|
||||
<li><b>It asks your body weight first</b> — one habit, one chart.</li>
|
||||
<li><b>Plate math for barbell work.</b> Barbell, olympic, EZ, trap bar and Smith machine
|
||||
exercises carry a bar weight — 20 kg / 45 lb and the rest of the usual
|
||||
@@ -357,8 +378,11 @@
|
||||
workouts that came later.</li>
|
||||
<li><b>Effort per set, in your scale:</b> an optional third column rating how hard a set
|
||||
was, as <b>RIR</b> (reps left in the tank) or <b>RPE</b> (the same judgement on a
|
||||
10-point scale). Off by default; each set keeps the scale it was logged with, and
|
||||
nothing else reads the value — progression and 1RM are unaffected.</li>
|
||||
10-point scale). Tap the button to pick one of six levels, each with a sentence —
|
||||
"Nothing left, went to failure" through "Easy, warm-up territory" — or type an
|
||||
exact value; a logged rating tints its cell by how close to failure it was. Off by
|
||||
default; each set keeps the scale it was logged with, and nothing else reads the value
|
||||
— progression and 1RM are unaffected.</li>
|
||||
<li><b>See the timer end, not just hear it:</b> an opt-in screen flash when a rest or
|
||||
work timer finishes — for loud gyms and headphones.</li>
|
||||
<li><b>Rest-timer push notifications</b> even with the app closed (self-hosted; the
|
||||
|
||||
+1
-1
@@ -404,7 +404,7 @@ try {
|
||||
</ul>
|
||||
<div class="push">
|
||||
<a class="btn" href="openGym.apk" download>Download for Android</a>
|
||||
<p class="meta">v1.3.1 · 4.8 MB · Android 6.0+ · signed APK. Your browser will ask
|
||||
<p class="meta">v1.3.5 · 27.7 MB · Android 6.0+ · signed APK. Your browser will ask
|
||||
before installing; that is normal outside the Play Store.</p>
|
||||
<p class="meta">Every release is also built and signed by CI and attached to the
|
||||
<a href="https://gitlab.com/DuarteSantos8/opengym/-/releases" rel="noopener">GitLab
|
||||
|
||||
Reference in new issue
Block a user