Compare commits

...
5 Commits
Author SHA1 Message Date
Duarte Santos d7f0f0dbdb v1.3.7: the Android build builds again (a double dash inside an XML comment in styles.xml broke v1.3.6's APK), plus the iPhone timer-sound fix (#183) 2026-09-12 23:31:21 +02:00
Duarte Santos 5a8873b919 Changelog: the iOS timer-sound fix (#183) as the first entry for v1.3.7 2026-09-12 23:29:04 +02:00
Duarte Santos 33f4758a1c Merge #183: iOS timer sounds — the context resumes before every tone, unlocks from the tap, and a setting plays sounds on silent; #152 (kurktchiev)
# Conflicts:
#	frontend/src/lib/pt-br-locale.test.js
#	frontend/src/locales/de.js
#	frontend/src/locales/es.js
#	frontend/src/locales/fr.js
#	frontend/src/locales/hi.js
#	frontend/src/locales/hu.js
#	frontend/src/locales/it.js
#	frontend/src/locales/ko.js
#	frontend/src/locales/pl.js
#	frontend/src/locales/pt-BR.js
#	frontend/src/locales/pt.js
#	frontend/src/locales/ru.js
#	frontend/src/locales/th.js
#	frontend/src/locales/tr.js
#	frontend/src/locales/zh.js
2026-09-12 23:29:04 +02:00
Duarte Santos 6a8d2288ae Website docs: sync between devices, offline mode, where push works and the reminder catch-up (v1.3.6) 2026-09-12 23:14:00 +02:00
Boris Kurktchiev 6e44e2f793 fix(sound): iOS timer sounds — resume before every tone, unlock from the tap, and a "play on silent" setting (#152)
Three things iOS needs that a desktop browser does not, all in lib/sound.js:

1. The ring/silent switch mutes Web Audio: a page whose only audio is Web Audio gets the
   Ambient category, which obeys the switch. The way out is the 'playback' audio-session type
   (iOS 17+), which is exclusive — it pauses whatever else is playing and WebKit never tells that
   app it may resume — so it is a setting, off by default: Settings → Sounds → "Play sounds when
   the phone is on silent" (S.soundOnSilent, applied page-wide by App.jsx). Offered only where it
   means something: a WebKit with navigator.audioSession on a device with a switch.
2. Locking the screen or switching apps leaves a suspended context suspended, and a suspended
   context makes no sound: every tone resumes the context first. The context sleeps again a
   second after the last tone so it does not keep the phone's audio session busy.
3. A context created outside a tap starts suspended and no timer tick can start it: unlock()
   runs from the taps that lead to a timer (turning Sounds on, starting a hold).

Split out of #165 at the maintainer's request; the per-kind rest-over sounds and the timer-bar
work stay there. Tests: lib/sound.test.js (fake AudioContext + audioSession), views/Settings.sound.test.jsx.
2026-09-12 16:13:17 -04:00
36 changed files with 511 additions and 30 deletions

No files matched your search

+11
View File
@@ -1,5 +1,16 @@
# Changelog
## v1.3.7 — 2026-09-12
The v1.3.6 tag's Android build failed on a double dash inside an XML comment, so the APK for everything in v1.3.6 is this one — plus the iPhone timer-sound fix that landed an hour later. Web bundle, APK and API image; v1.3.6 and v1.3.7 are the same code apart from the two items below.
- 📦 **The Android build builds again**: a comment in `styles.xml` (from the safe-area work in v1.3.6) contained `--`, which XML forbids inside comments.
- 🔊 **Timer sounds on iOS** (kurktchiev, #183, #152): every tone resumes the audio context first
(a lock or app switch leaves it suspended and silent), the context is unlocked from the taps that
lead to a timer, and Settings → Sounds gains **Play sounds when the phone is on silent** (off by
default, iOS 17+), which switches the page's audio session to playback so the ring/silent switch
no longer mutes the beep — at the cost of pausing whatever else the phone was playing.
## v1.3.6 — 2026-09-12
Sync you can trust and a phone that behaves: signed in, the server's profile is always the truth, two devices merge instead of overwriting each other, the app polls for changes and works offline with a banner; reminders and push subscriptions heal themselves; chip rows, sheets under the notch and the tab bar are fixed on iOS; the twelve Astra findings, eleven community merges and a headless QA sweep of every screen. Web bundle, APK and API image.
+2 -2
View File
@@ -215,9 +215,9 @@ host side of that volume, not the variable.
## Roadmap
The plan lives in [ROADMAP.md](ROADMAP.md) (the
[GitLab milestones](https://gitlab.com/DuarteSantos8/opengym/-/milestones) track the same items): v1.3.7 programmes and
[GitLab milestones](https://gitlab.com/DuarteSantos8/opengym/-/milestones) track the same items): v1.3.8 programmes and
progression (explicit warm-up/work phases, AMRAP driver selection, multi-week programmes, adaptive
1RM), v1.3.8 accounts and sync (password and OIDC login, personal-trainer role, remote MCP), v1.3.9
1RM), v1.3.9 accounts and sync (password and OIDC login, personal-trainer role, remote MCP), v1.3.10
mobile (timer in the notification bar, widgets, Withings). Ideas and pull requests welcome.
## Tech
+4 -4
View File
@@ -57,7 +57,7 @@ Left over from this block:
- A real pause for the workout timers (#29 asked for it)
- Discord announcement (owner)
## v1.3.6 — Sync, push and the phone (released 2026-09-12)
## v1.3.6 and v1.3.7 — Sync, push and the phone (released 2026-09-12)
Signed in, the server's profile is the truth: sign-in adopts it, two devices merge on a server
revision instead of overwriting each other, the app polls for changes and works offline with a
@@ -69,7 +69,7 @@ the phone, nginx resolver, custom-exercise equipment, per-side data, warm-up res
QA sweep of every screen. Left over: routine reordering (#142), the Smith-bar "no bar" option
(#138), two decimals (#139), delete user in the admin (#107).
## v1.3.7 — Programmes & progression (October 2026)
## v1.3.8 — 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
@@ -93,7 +93,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.8 — Accounts & sync (November 2026)
## v1.3.9 — Accounts & sync (November 2026)
**Theme: who may sign in, and what else may read or write your data.**
@@ -111,7 +111,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.9 — Mobile (December 2026)
## v1.3.10 — Mobile (December 2026)
**Theme: the Android app catches up with the web app.**
+1 -1
View File
@@ -6,7 +6,7 @@ openapi: 3.1.0
info:
title: openGym API
version: 1.3.6
version: 1.3.7
summary: Passkey (WebAuthn) auth + per-user state storage for openGym
description: |
The backend of [openGym](https://opengym.duarte-santos.ch) — a free, open-source
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "gym-api",
"version": "1.3.6",
"version": "1.3.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "gym-api",
"version": "1.3.6",
"version": "1.3.7",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@simplewebauthn/server": "^13.1.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "gym-api",
"version": "1.3.6",
"version": "1.3.7",
"private": true,
"type": "module",
"main": "server.js",
+2 -2
View File
@@ -7,8 +7,8 @@ android {
applicationId "ch.duartesantos.opengym"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 20
versionName "1.3.6"
versionCode 21
versionName "1.3.7"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
@@ -14,7 +14,7 @@
<item name="windowNoTitle">true</item>
<item name="android:background">@null</item>
<!-- Draw into the camera cutout like iOS does under the notch: the WebView then reports a
real env(safe-area-inset-top) and the sheets keep clear of it (index.css --sat). -->
real env(safe-area-inset-top) and the sheets keep clear of it (the sat variable in index.css). -->
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "opengym-frontend",
"version": "1.3.6",
"version": "1.3.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "opengym-frontend",
"version": "1.3.6",
"version": "1.3.7",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@aparajita/capacitor-secure-storage": "^7.1.6",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "opengym-frontend",
"private": true,
"version": "1.3.6",
"version": "1.3.7",
"type": "module",
"scripts": {
"dev": "vite",
+4
View File
@@ -5,6 +5,7 @@ import { useUI } from './store/useUI.js'
import { bindUI } from './components/ui.jsx'
import { ACCENTS } from './lib/format.js'
import { setLang, useLang } from './lib/i18n.js'
import { setPlayOnSilent } from './lib/sound.js'
import { setNav } from './lib/nav.js'
import { initBackButton } from './lib/back.js'
import { useWakeLock } from './lib/wakelock.js'
@@ -61,6 +62,9 @@ function Shell() {
const loc = useLocation()
const navType = useNavigationType()
const { S, user, ready } = useStore()
// iOS: whether timer sounds get past the ring/silent switch (Settings → Sounds). Page-level,
// so it is applied here on load and on change rather than at each beep.
useEffect(() => { setPlayOnSilent(!!S.soundOnSilent) }, [S.soundOnSilent])
const isGuest = useStore(s => s.isGuest())
const needsMobileOnboarding = useStore(s => s.needsMobileOnboarding)
const langV = useLang() // re-renders the whole shell when the language (pack) changes
+1 -1
View File
@@ -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(642)
expect(Object.keys(PT_BR_OVERRIDES)).toHaveLength(644)
expect(inherited).toHaveLength(647)
// If this fails, review the changed keys and wording before accepting a new hash. From
// frontend/: node scripts/pt-br-inheritance-fingerprint.mjs --list
+77 -4
View File
@@ -1,17 +1,90 @@
// WebAudio beeps + haptics (ported from the vanilla app). `enabled` gates sound.
//
// iOS needs three things a desktop browser does not (#152, "flash but no beep"):
// 1. The ring/silent switch mutes Web Audio. WebKit gives a page whose only audio is Web Audio
// the Ambient category, and Ambient obeys the switch — at a gym the phone is usually on
// silent, so the timer was mute exactly where it mattered. The only way out is the
// 'playback' audio-session type (iOS 17+), which is exclusive: it pauses whatever else the
// phone is playing, and WebKit never tells that app it may resume. Hence a setting
// (setPlayOnSilent), off by default, rather than something done for everyone.
// 2. Locking the screen or switching apps moves a running context to 'interrupted'. WebKit
// only brings it back by itself if it was running when the interruption began; a context
// that was suspended comes back suspended, and a suspended context makes no sound. So every
// tone resumes the context first — allowed without a tap once the context has started
// inside one.
// 3. A context created outside a tap starts 'suspended' and no timer tick can start it.
// unlock() runs from the taps that lead to a timer (set check, hold start, turning Sounds
// on) so the context has started before any tick needs it.
//
// The context is suspended again a second after the last tone: an idle context otherwise keeps
// rendering silence for the rest of the page, and under 'playback' keeps the phone's audio
// session busy. (Suspending does NOT hand the phone back to a paused music app — see 1.)
let audioCtx = null
let idleTm = null
let idleAt = 0
const ctxFor = () => {
if (!audioCtx || audioCtx.state === 'closed') audioCtx = new (window.AudioContext || window.webkitAudioContext)()
return audioCtx
}
const wake = () => {
const ctx = ctxFor()
if (ctx.state !== 'running') { const p = ctx.resume(); if (p && p.catch) p.catch(() => {}) }
return ctx
}
// Suspend once every scheduled tone is over. A burst schedules several tones in one go; the
// latest end wins, and a tone scheduled while the timer is pending pushes it out.
const sleepAfter = endSec => {
const at = Date.now() + endSec * 1000 + 1000
if (at <= idleAt && idleTm) return
idleAt = at
clearTimeout(idleTm)
idleTm = setTimeout(() => {
idleTm = null
try { if (audioCtx && audioCtx.state === 'running') { const p = audioCtx.suspend(); if (p && p.catch) p.catch(() => {}) } } catch (e) { /* */ }
}, at - Date.now())
}
export function beep(enabled, freq, dur, when) {
if (!enabled) return
try {
audioCtx = audioCtx || new (window.AudioContext || window.webkitAudioContext)()
const o = audioCtx.createOscillator(), g = audioCtx.createGain()
o.connect(g); g.connect(audioCtx.destination)
const ctx = wake()
const o = ctx.createOscillator(), g = ctx.createGain()
o.connect(g); g.connect(ctx.destination)
o.frequency.value = freq || 880; o.type = 'sine'
const t0 = audioCtx.currentTime + (when || 0)
const t0 = ctx.currentTime + (when || 0)
g.gain.setValueAtTime(0.001, t0)
g.gain.exponentialRampToValueAtTime(0.35, t0 + 0.02)
g.gain.exponentialRampToValueAtTime(0.001, t0 + (dur || 0.18))
o.start(t0); o.stop(t0 + (dur || 0.18) + 0.05)
sleepAfter((when || 0) + (dur || 0.18) + 0.05)
} catch (e) { /* */ }
}
// Call from inside a tap. Gets the context created and running while the browser still counts
// this as a user gesture; it goes back to sleep on its own. Nothing audible.
export function unlock(enabled) {
if (!enabled) return
try { wake(); sleepAfter(0) } catch (e) { /* */ }
}
// Settings → "Play sounds when the phone is on silent". Offered only where it means something:
// a WebKit with the audio-session API (iOS 17+) on a device that has a ring/silent switch or its
// Control Centre equivalent — iPhone, or an iPad (which reports itself as a Mac with a touch
// screen). macOS Safari has the API but no switch, and other browsers have neither.
// 'playback' ignores the switch; 'auto' is the browser's own choice (Ambient for a page like
// this one). Applied by App.jsx whenever the setting is loaded or changed.
export const playOnSilentSupported = () => {
if (typeof navigator === 'undefined' || !navigator.audioSession) return false
const ua = navigator.userAgent || ''
return /iPhone|iPad|iPod/.test(ua) || (/Macintosh/.test(ua) && navigator.maxTouchPoints > 1)
}
export function setPlayOnSilent(on) {
if (!playOnSilentSupported()) return
try { navigator.audioSession.type = on ? 'playback' : 'auto' } catch (e) { /* */ }
}
export function vibrate(p) { try { navigator.vibrate && navigator.vibrate(p) } catch (e) { /* */ } }
+198
View File
@@ -0,0 +1,198 @@
// @vitest-environment happy-dom
// lib/sound.js keeps one AudioContext per page; each test gets a fresh module so that state
// does not leak. The fake context records what the real one would be asked to do.
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
class FakeCtx {
constructor() {
this.state = 'suspended' // what every browser hands back outside a user gesture
this.currentTime = 0
this.destination = {}
this.tones = []
this.resumes = 0
this.suspends = 0
FakeCtx.instances.push(this)
}
resume() { this.resumes++; this.state = 'running'; return Promise.resolve() }
suspend() { this.suspends++; this.state = 'suspended'; return Promise.resolve() }
createGain() { return { connect() {}, gain: { setValueAtTime() {}, exponentialRampToValueAtTime() {} } } }
createOscillator() {
const ctx = this
const o = { frequency: { value: 0 }, type: '', connect() {}, start(at) { ctx.tones.push({ freq: o.frequency.value, at }) }, stop() {} }
return o
}
}
FakeCtx.instances = []
let sound
let session
const ctx = () => FakeCtx.instances[0]
const IPHONE = 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148'
const MAC = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15'
const setDevice = (userAgent, maxTouchPoints = 0) => {
Object.defineProperty(navigator, 'userAgent', { value: userAgent, configurable: true })
Object.defineProperty(navigator, 'maxTouchPoints', { value: maxTouchPoints, configurable: true })
}
beforeEach(async () => {
vi.useFakeTimers()
FakeCtx.instances = []
window.AudioContext = FakeCtx
session = { type: 'auto' }
Object.defineProperty(navigator, 'audioSession', { value: session, configurable: true, writable: true })
setDevice(IPHONE)
vi.resetModules()
sound = await import('./sound.js')
})
afterEach(() => { vi.useRealTimers() })
describe('sounds off', () => {
it('creates no audio context and leaves the audio session alone', () => {
sound.beep(false, 880, 0.15)
sound.unlock(false)
expect(FakeCtx.instances).toHaveLength(0)
expect(session.type).toBe('auto')
})
})
describe('iOS: silent switch and interruptions (#152)', () => {
it('the first tone gets the context running and leaves the audio session type alone', () => {
sound.beep(true, 880, 0.15)
expect(ctx().resumes).toBe(1)
expect(ctx().state).toBe('running')
expect(ctx().tones).toEqual([{ freq: 880, at: 0 }])
expect(session.type).toBe('auto') // the silent-switch override is the setting's job
})
it('resumes a context that a lock or app switch left suspended before scheduling the tone', () => {
sound.beep(true, 880, 0.15)
ctx().state = 'interrupted' // what iOS does on screen lock / app switch
sound.beep(true, 660, 0.1)
expect(ctx().resumes).toBe(2)
expect(ctx().state).toBe('running')
expect(ctx().tones).toHaveLength(2)
})
// A real context reports 'suspended' until its resume() settles, so a burst can issue one
// resume() per tone in a browser — harmless. What this pins is the guard itself.
it('skips resume when the context already reports running', () => {
sound.beep(true, 880, 0.15)
sound.beep(true, 880, 0.15, 0.25)
expect(ctx().resumes).toBe(1)
})
it('replaces a context the browser has closed', () => {
sound.beep(true, 880, 0.15)
ctx().state = 'closed'
sound.beep(true, 880, 0.15)
expect(FakeCtx.instances).toHaveLength(2)
expect(FakeCtx.instances[1].tones).toHaveLength(1)
})
it('works in a browser without navigator.audioSession', () => {
Object.defineProperty(navigator, 'audioSession', { value: undefined, configurable: true, writable: true })
sound.beep(true, 880, 0.15)
expect(ctx().tones).toHaveLength(1)
})
})
describe('the context sleeps between beeps', () => {
it('suspends about a second after the last tone of a burst has ended', () => {
sound.beep(true, 880, 0.25, 0); sound.beep(true, 1320, 0.5, 0.35) // last tone ends at 0.35 + 0.5 + 0.05 = 0.9s
vi.advanceTimersByTime(1500)
expect(ctx().state).toBe('running')
vi.advanceTimersByTime(500)
expect(ctx().state).toBe('suspended')
expect(ctx().suspends).toBe(1)
})
it('a later tone pushes the sleep out instead of cutting itself short', () => {
sound.beep(true, 660, 0.1) // 3
vi.advanceTimersByTime(1000)
sound.beep(true, 660, 0.1) // 2
vi.advanceTimersByTime(1000)
sound.beep(true, 660, 0.1) // 1
vi.advanceTimersByTime(1000)
sound.beep(true, 880, 0.15, 0); sound.beep(true, 880, 0.15, 0.25) // 0: last tone ends at 0.25 + 0.15 + 0.05 = 0.45s
expect(ctx().suspends).toBe(0)
vi.advanceTimersByTime(1400)
expect(ctx().state).toBe('running')
vi.advanceTimersByTime(100)
expect(ctx().state).toBe('suspended')
expect(ctx().suspends).toBe(1)
})
it('a short tone scheduled during a longer one does not shorten the longer one\'s sleep', () => {
sound.beep(true, 880, 0.5) // ends 0.55s → sleep at 1.55s
sound.beep(true, 660, 0.1) // ends 0.15s → must not pull the sleep to 1.15s
vi.advanceTimersByTime(1200)
expect(ctx().state).toBe('running')
vi.advanceTimersByTime(400)
expect(ctx().state).toBe('suspended')
})
})
describe('unlock from a tap', () => {
it('gets the context created and running, without a tone', () => {
sound.unlock(true)
expect(FakeCtx.instances).toHaveLength(1)
expect(ctx().state).toBe('running')
expect(ctx().tones).toHaveLength(0)
})
it('lets the context sleep again on its own', () => {
sound.unlock(true)
vi.advanceTimersByTime(1000)
expect(ctx().state).toBe('suspended')
})
it('a tick after the tap finds a context it can resume rather than one it must create', () => {
sound.unlock(true)
vi.advanceTimersByTime(1000)
sound.beep(true, 660, 0.1)
expect(FakeCtx.instances).toHaveLength(1)
expect(ctx().state).toBe('running')
})
})
describe('play on silent (Settings switch, WebKit only)', () => {
it('is offered on an iPhone with the audio-session API', () => {
expect(sound.playOnSilentSupported()).toBe(true)
})
it('is offered on an iPad, which calls itself a Mac with a touch screen', () => {
setDevice(MAC, 5)
expect(sound.playOnSilentSupported()).toBe(true)
})
it('is not offered on macOS Safari: it has the API but no ring/silent switch', () => {
setDevice(MAC, 0)
expect(sound.playOnSilentSupported()).toBe(false)
})
it('is not offered where navigator.audioSession does not exist', () => {
Object.defineProperty(navigator, 'audioSession', { value: undefined, configurable: true, writable: true })
expect(sound.playOnSilentSupported()).toBe(false)
})
it("on: the page's audio session becomes 'playback', which ignores the ring/silent switch", () => {
sound.setPlayOnSilent(true)
expect(session.type).toBe('playback')
})
it("off: hands the choice back to the browser ('auto')", () => {
sound.setPlayOnSilent(true)
sound.setPlayOnSilent(false)
expect(session.type).toBe('auto')
})
it('is a no-op in a browser without navigator.audioSession', () => {
Object.defineProperty(navigator, 'audioSession', { value: undefined, configurable: true, writable: true })
expect(() => sound.setPlayOnSilent(true)).not.toThrow()
})
it('survives a browser that rejects the type', () => {
Object.defineProperty(navigator, 'audioSession', { value: Object.freeze({ type: 'auto' }), configurable: true, writable: true })
expect(() => sound.setPlayOnSilent(true)).not.toThrow()
})
})
+2
View File
@@ -339,6 +339,8 @@ export default {
'Weigh in before workouts': 'Vor dem Training wiegen',
'Asks for your body weight when a workout starts. Off starts the session straight away.': 'Fragt beim Start eines Trainings nach deinem Körpergewicht. Aus startet die Einheit direkt.',
'No entries yet — log your weight to start the curve.': 'Noch keine Einträge — trag dein Gewicht ein, um die Kurve zu starten.',
'Play sounds when the phone is on silent': 'Töne auch bei stummgeschaltetem Telefon abspielen',
'Music playing on this phone stops during a workout and does not resume by itself.': 'Musik, die auf diesem Telefon läuft, stoppt während eines Trainings und setzt nicht von selbst wieder ein.',
'Data': 'Daten',
'Export backup (JSON)': 'Backup exportieren (JSON)',
'Import backup': 'Backup importieren',
+2
View File
@@ -324,6 +324,8 @@ export default {
'Weigh in before workouts': 'Pesarse antes de entrenar',
'Asks for your body weight when a workout starts. Off starts the session straight away.': 'Pide tu peso corporal al empezar un entrenamiento. Desactivado, la sesión empieza directamente.',
'No entries yet — log your weight to start the curve.': 'Sin registros aún — apunta tu peso para empezar la curva.',
'Play sounds when the phone is on silent': 'Reproducir sonidos con el teléfono en silencio',
'Music playing on this phone stops during a workout and does not resume by itself.': 'La música que suena en este teléfono se detiene durante un entrenamiento y no se reanuda por sí sola.',
'Data': 'Datos',
'Export backup (JSON)': 'Exportar copia (JSON)',
'Import backup': 'Importar copia',
+2
View File
@@ -324,6 +324,8 @@ export default {
'Weigh in before workouts': 'Se peser avant la séance',
'Asks for your body weight when a workout starts. Off starts the session straight away.': 'Demande ton poids au début d’une séance. Désactivé, la séance démarre directement.',
'No entries yet — log your weight to start the curve.': 'Aucune entrée — note ton poids pour démarrer la courbe.',
'Play sounds when the phone is on silent': 'Jouer les sons même si le téléphone est en mode silencieux',
'Music playing on this phone stops during a workout and does not resume by itself.': 'La musique en cours de lecture sur ce téléphone s’arrête pendant une séance et ne reprend pas toute seule.',
'Data': 'Données',
'Export backup (JSON)': 'Exporter une sauvegarde (JSON)',
'Import backup': 'Importer une sauvegarde',
+2
View File
@@ -324,6 +324,8 @@ export default {
'Weigh in before workouts': 'वर्कआउट से पहले वज़न दर्ज करना',
'Asks for your body weight when a workout starts. Off starts the session straight away.': 'वर्कआउट शुरू होते समय आपका वज़न पूछता है। बंद होने पर सेशन सीधे शुरू होता है।',
'No entries yet — log your weight to start the curve.': 'अभी कोई एंट्री नहीं — ग्राफ़ शुरू करने के लिए वज़न दर्ज करें।',
'Play sounds when the phone is on silent': 'फ़ोन साइलेंट पर हो तब भी आवाज़ें बजाएँ',
'Music playing on this phone stops during a workout and does not resume by itself.': 'इस फ़ोन पर चल रहा संगीत वर्कआउट के दौरान रुक जाता है और अपने आप फिर से शुरू नहीं होता।',
'Data': 'डेटा',
'Export backup (JSON)': 'बैकअप निर्यात करें (JSON)',
'Import backup': 'बैकअप आयात करें',
+2
View File
@@ -748,6 +748,8 @@ export default {
'Weigh in before workouts': 'Súlymérés edzés előtt',
'Asks for your body weight when a workout starts. Off starts the session straight away.': 'Edzés indításakor rákérdez a testsúlyodra. Kikapcsolva az edzés azonnal indul.',
'No entries yet — log your weight to start the curve.': 'Még nincs bejegyzés — rögzítsd a súlyodat a görbe elindításához.',
'Play sounds when the phone is on silent': 'Hangok lejátszása akkor is, ha a telefon némítva van',
'Music playing on this phone stops during a workout and does not resume by itself.': 'A telefonon szóló zene edzés közben leáll, és nem indul újra magától.',
'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.',
+2
View File
@@ -324,6 +324,8 @@ export default {
'Weigh in before workouts': 'Pesarsi prima dell’allenamento',
'Asks for your body weight when a workout starts. Off starts the session straight away.': 'Chiede il tuo peso all’avvio di un allenamento. Disattivato, la sessione parte subito.',
'No entries yet — log your weight to start the curve.': 'Nessun dato — registra il tuo peso per iniziare la curva.',
'Play sounds when the phone is on silent': 'Riproduci i suoni anche con il telefono in silenzioso',
'Music playing on this phone stops during a workout and does not resume by itself.': 'La musica in riproduzione su questo telefono si ferma durante un allenamento e non riprende da sola.',
'Data': 'Dati',
'Export backup (JSON)': 'Esporta backup (JSON)',
'Import backup': 'Importa backup',
+2
View File
@@ -324,6 +324,8 @@ export default {
'Weigh in before workouts': '운동 전 체중 기록',
'Asks for your body weight when a workout starts. Off starts the session straight away.': '운동을 시작할 때 체중을 물어봅니다. 끄면 세션이 바로 시작됩니다.',
'No entries yet — log your weight to start the curve.': '아직 기록이 없어요 — 체중을 기록해 그래프를 시작하세요.',
'Play sounds when the phone is on silent': '무음 모드에서도 소리 재생',
'Music playing on this phone stops during a workout and does not resume by itself.': '운동 중에는 이 휴대폰에서 재생 중인 음악이 멈추며, 자동으로 다시 재생되지 않습니다.',
'Data': '데이터',
'Export backup (JSON)': '백업 내보내기 (JSON)',
'Import backup': '백업 가져오기',
+2
View File
@@ -324,6 +324,8 @@ export default {
'Weigh in before workouts': 'Ważenie przed treningiem',
'Asks for your body weight when a workout starts. Off starts the session straight away.': 'Pyta o Twoją masę ciała przy rozpoczęciu treningu. Wyłączone — sesja zaczyna się od razu.',
'No entries yet — log your weight to start the curve.': 'Brak wpisów — zapisz wagę, aby zacząć krzywą.',
'Play sounds when the phone is on silent': 'Odtwarzaj dźwięki także przy wyciszonym telefonie',
'Music playing on this phone stops during a workout and does not resume by itself.': 'Muzyka odtwarzana na tym telefonie zatrzymuje się podczas treningu i nie wznawia się sama.',
'Data': 'Dane',
'Export backup (JSON)': 'Eksportuj kopię (JSON)',
'Import backup': 'Importuj kopię',
+2
View File
@@ -118,6 +118,8 @@ export const PT_BR_OVERRIDES = {
'Weigh in before workouts': 'Pesar antes do treino',
'Asks for your body weight when a workout starts. Off starts the session straight away.': 'Pede seu peso ao iniciar um treino. Desligado, a sessão começa na hora.',
'No entries yet — log your weight to start the curve.': 'Ainda não há registros — informe seu peso para começar a curva.',
'Play sounds when the phone is on silent': 'Tocar sons com o celular no silencioso',
'Music playing on this phone stops during a workout and does not resume by itself.': 'A música que estiver tocando neste celular para durante o treino e não volta sozinha.',
'Export backup (JSON)': 'Exportar backup (JSON)',
'Import backup': 'Importar backup',
'Reset everything?': 'Redefinir tudo?',
+2
View File
@@ -324,6 +324,8 @@ export default {
'Weigh in before workouts': 'Pesar antes do treino',
'Asks for your body weight when a workout starts. Off starts the session straight away.': 'Pede o teu peso ao iniciar um treino. Desligado, a sessão começa de imediato.',
'No entries yet — log your weight to start the curve.': 'Ainda sem registos — regista o teu peso para começar a curva.',
'Play sounds when the phone is on silent': 'Reproduzir sons com o telemóvel em silêncio',
'Music playing on this phone stops during a workout and does not resume by itself.': 'A música a tocar neste telemóvel para durante um treino e não retoma sozinha.',
'Data': 'Dados',
'Export backup (JSON)': 'Exportar cópia (JSON)',
'Import backup': 'Importar cópia',
+2
View File
@@ -324,6 +324,8 @@ export default {
'Weigh in before workouts': 'Взвешивание перед тренировкой',
'Asks for your body weight when a workout starts. Off starts the session straight away.': 'Спрашивает ваш вес при начале тренировки. Выключено — сессия начинается сразу.',
'No entries yet — log your weight to start the curve.': 'Записей пока нет — внеси вес, чтобы начать кривую.',
'Play sounds when the phone is on silent': 'Воспроизводить звуки при беззвучном режиме',
'Music playing on this phone stops during a workout and does not resume by itself.': 'Музыка, играющая на этом телефоне, останавливается во время тренировки и сама не возобновляется.',
'Data': 'Данные',
'Export backup (JSON)': 'Экспорт резервной копии (JSON)',
'Import backup': 'Импорт резервной копии',
+2
View File
@@ -756,6 +756,8 @@ export default {
'Weigh in before workouts': 'ชั่งน้ำหนักก่อนออกกำลังกาย',
'Asks for your body weight when a workout starts. Off starts the session straight away.': 'ถามน้ำหนักตัวเมื่อเริ่มออกกำลังกาย ถ้าปิด เซสชันจะเริ่มทันที',
'No entries yet — log your weight to start the curve.': 'ยังไม่มีข้อมูล — บันทึกน้ำหนักเพื่อเริ่มกราฟ',
'Play sounds when the phone is on silent': 'เล่นเสียงแม้โทรศัพท์อยู่ในโหมดเงียบ',
'Music playing on this phone stops during a workout and does not resume by itself.': 'เพลงที่เล่นอยู่บนโทรศัพท์นี้จะหยุดระหว่างการออกกำลังกาย และจะไม่เล่นต่อเอง',
'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 คีย์ใช้สำหรับการนำเข้าครั้งนี้เท่านั้นและจะไม่ถูกบันทึก',
+2
View File
@@ -324,6 +324,8 @@ export default {
'Weigh in before workouts': 'Antrenman öncesi tartılma',
'Asks for your body weight when a workout starts. Off starts the session straight away.': 'Antrenman başlarken kilonu sorar. Kapalıyken seans hemen başlar.',
'No entries yet — log your weight to start the curve.': 'Henüz kayıt yok — eğriyi başlatmak için kilonu gir.',
'Play sounds when the phone is on silent': 'Telefon sessizdeyken de sesleri çal',
'Music playing on this phone stops during a workout and does not resume by itself.': 'Bu telefonda çalan müzik antrenman sırasında durur ve kendiliğinden devam etmez.',
'Data': 'Veriler',
'Export backup (JSON)': 'Yedeği dışa aktar (JSON)',
'Import backup': 'Yedeği içe aktar',
+2
View File
@@ -324,6 +324,8 @@ export default {
'Weigh in before workouts': '训练前称重',
'Asks for your body weight when a workout starts. Off starts the session straight away.': '开始训练时询问体重。关闭后直接进入训练。',
'No entries yet — log your weight to start the curve.': '还没有记录——记录体重以开始曲线。',
'Play sounds when the phone is on silent': '手机静音时也播放提示音',
'Music playing on this phone stops during a workout and does not resume by itself.': '锻炼期间,这部手机正在播放的音乐会停止,且不会自动恢复。',
'Data': '数据',
'Export backup (JSON)': '导出备份(JSON)',
'Import backup': '导入备份',
+1 -1
View File
@@ -21,7 +21,7 @@ const SYNC_KEY = 'gym_sync'
const CHECK_MIN_MS = 3000 // rev checks closer together than this are the same event (focus + visibility)
const POLL_MS = 30000 // while the app is open and signed in, ask the server for its revision this often
export const DEF = {
unit: 'kg', restSec: 90, restPauseSec: 15, sound: true, timerFlash: false, keepAwake: true, lang: 'en',
unit: 'kg', restSec: 90, restPauseSec: 15, sound: true, soundOnSilent: false, timerFlash: false, keepAwake: true, lang: 'en',
theme: 'dark', accent: 'lime', body: 'male', targetW: null,
bodyweight: [], routines: [], week: {}, dayPlan: {},
exWeights: {}, workouts: [], active: null, customEx: [], gifSize: 'full',
+13 -1
View File
@@ -6,6 +6,7 @@ import { convertStateUnit } from '../lib/units.js'
import { useUI } from '../store/useUI.js'
import { ACCENTS, todayISO, localTZ, weekStartOf, MONDAY, SUNDAY } from '../lib/format.js'
import { effortOf } from '../lib/history.js'
import { unlock, playOnSilentSupported } from '../lib/sound.js'
import { api, webauthnOK, passkeyLogin, passkeyRegister, IS_ANDROID } from '../lib/api.js'
import { pushSupported, enablePush, disablePush, sendTestPush, syncPushSubscription } from '../lib/push.js'
import { wakeLockSupported } from '../lib/wakelock.js'
@@ -307,8 +308,19 @@ export default function Settings() {
onChange={v => update(s => { s.gifSize = v })} />
</Row>
<Row icon="bell" iconTint="var(--pink)" title={t('Sounds')}>
<Switch checked={!!S.sound} onChange={v => update(s => { s.sound = v })} />
{/* Turning Sounds on is a tap: unlock the audio context now so a timer that ends before
the next set check can already sound (iOS, #152). */}
<Switch checked={!!S.sound} onChange={v => { if (v) unlock(true); update(s => { s.sound = v }) }} />
</Row>
{/* iOS only (WebKit's audio-session API, iOS 17+): with it off the ring/silent switch mutes
the timer. On, the phone treats the timer like a music player — exclusive, and the
music app is not told it may resume — so it is a choice, off by default (lib/sound.js). */}
{S.sound && playOnSilentSupported() && (
<Row icon="bell" iconTint="var(--orange)" title={t('Play sounds when the phone is on silent')}
subtitle={t('Music playing on this phone stops during a workout and does not resume by itself.')}>
<Switch checked={!!S.soundOnSilent} onChange={v => update(s => { s.soundOnSilent = v })} />
</Row>
)}
<Row icon="sun" iconTint="var(--yellow)" title={t('Flash screen when timer ends')}>
<Switch checked={!!S.timerFlash} onChange={v => update(s => { s.timerFlash = v })} />
</Row>
+132
View File
@@ -0,0 +1,132 @@
// @vitest-environment happy-dom
import React, { act } from 'react'
import { createRoot } from 'react-dom/client'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import Settings from './Settings.jsx'
import { unlock } from '../lib/sound.js'
globalThis.IS_REACT_ACT_ENVIRONMENT = true
const mocks = vi.hoisted(() => {
const state = { S: null }
state.snapshot = () => ({
S: state.S,
user: null,
update: mut => {
const next = structuredClone(state.S)
mut(next)
state.S = next
},
replaceState: vi.fn(), setUser: vi.fn(), pullState: vi.fn(), pushState: vi.fn(),
signOut: vi.fn(), signOutAll: vi.fn(), resetDemo: vi.fn(), disconnectServer: vi.fn(),
})
return state
})
vi.mock('../store/useStore.js', () => {
const useStore = selector => selector ? selector(mocks.snapshot()) : mocks.snapshot()
useStore.getState = mocks.snapshot
return { useStore, DEF: { reminder: { time: '17:30' } }, hasData: () => false }
})
vi.mock('../store/useUI.js', () => {
const snap = () => ({ toast: vi.fn(), openSheet: vi.fn() })
const useUI = selector => selector ? selector(snap()) : snap()
useUI.getState = snap
return { useUI }
})
vi.mock('react-router-dom', () => ({ useNavigate: () => () => {} }))
vi.mock('../lib/api.js', () => ({
api: vi.fn(), webauthnOK: () => false, passkeyLogin: vi.fn(), passkeyRegister: vi.fn(), IS_ANDROID: false,
}))
vi.mock('../lib/push.js', () => ({ pushSupported: () => false, enablePush: vi.fn(), disablePush: vi.fn(), sendTestPush: vi.fn() }))
vi.mock('../lib/wakelock.js', () => ({ wakeLockSupported: () => false }))
vi.mock('../lib/mobile.js', () => ({ MOBILE: false, isAndroid: () => Promise.resolve(false), shareExport: vi.fn(), syncReminder: vi.fn() }))
vi.mock('./MobileOnboarding.jsx', () => ({ ConnectSheet: () => null }))
vi.mock('../sheets.jsx', () => ({
starterPlanSheet: vi.fn(), confirmSheet: vi.fn(), importFromApp: vi.fn(),
importFromHevy: vi.fn(), equipmentProfileSheet: vi.fn(),
}))
// The real module decides "supported" from navigator.audioSession, which each test sets up;
// unlock is spied on so the Sounds switch can be checked for its tap-time side effect.
vi.mock('../lib/sound.js', async importOriginal => {
const real = await importOriginal()
return { ...real, unlock: vi.fn() }
})
globalThis.__APP_VERSION__ ??= 'test'
let host, root
const setAudioSession = value => Object.defineProperty(navigator, 'audioSession', { value, configurable: true, writable: true })
beforeEach(() => {
mocks.S = {
unit: 'kg', restSec: 90, restPauseSec: 15, sound: true, soundOnSilent: false, effort: 'none',
gifSize: 'full', workouts: [], routines: [], exWeights: {},
}
setAudioSession({ type: 'auto' })
Object.defineProperty(navigator, 'userAgent', { value: 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', configurable: true })
unlock.mockClear()
host = document.createElement('div')
document.body.appendChild(host)
root = createRoot(host)
})
afterEach(() => {
act(() => root.unmount())
host.remove()
setAudioSession(undefined)
})
const mount = () => act(() => root.render(<Settings />))
const rowTitled = title => [...host.querySelectorAll('.lrow')].find(r => r.querySelector('.lrow-t')?.textContent === title)
const switchIn = row => row.querySelector('[role="switch"]') || row.querySelector('input[type="checkbox"]') || row.querySelector('button')
describe('Settings — play sounds when the phone is on silent', () => {
it('is offered on a browser with an audio session (iOS), under Sounds, with the music trade-off spelled out', () => {
mount()
const row = rowTitled('Play sounds when the phone is on silent')
expect(row).toBeTruthy()
expect(row.querySelector('.lrow-s').textContent).toBe('Music playing on this phone stops during a workout and does not resume by itself.')
const rows = [...host.querySelectorAll('.lrow')]
expect(rows.indexOf(row)).toBe(rows.indexOf(rowTitled('Sounds')) + 1)
})
it('is not offered where the browser has no audio session API', () => {
setAudioSession(undefined)
mount()
expect(rowTitled('Play sounds when the phone is on silent')).toBeUndefined()
})
it('is not offered on macOS Safari, which has the API but no ring/silent switch', () => {
Object.defineProperty(navigator, 'userAgent', { value: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15', configurable: true })
Object.defineProperty(navigator, 'maxTouchPoints', { value: 0, configurable: true })
mount()
expect(rowTitled('Play sounds when the phone is on silent')).toBeUndefined()
})
it('is not offered while Sounds is off', () => {
mocks.S.sound = false
mount()
expect(rowTitled('Play sounds when the phone is on silent')).toBeUndefined()
})
it('writes soundOnSilent to the store', () => {
mount()
const sw = switchIn(rowTitled('Play sounds when the phone is on silent'))
expect(sw).toBeTruthy()
act(() => { sw.click() })
expect(mocks.S.soundOnSilent).toBe(true)
})
})
describe('Settings — Sounds switch unlocks audio from the tap', () => {
it('turning Sounds on unlocks; turning it off does not', () => {
mocks.S.sound = false
mount()
act(() => { switchIn(rowTitled('Sounds')).click() })
expect(mocks.S.sound).toBe(true)
expect(unlock).toHaveBeenCalledWith(true)
unlock.mockClear()
mount()
act(() => { switchIn(rowTitled('Sounds')).click() })
expect(mocks.S.sound).toBe(false)
expect(unlock).not.toHaveBeenCalled()
})
})
+4 -1
View File
@@ -7,7 +7,7 @@ import { exOr } from '../lib/exercises.js'
import { usesBar, barWeightFor, plateSplit } from '../lib/bar.js'
import { effectiveRoutines, effectiveRoutineIds, lastEntryFor, bestWeightFor, bestWeightForEntry, buildSets, freestyleConfig, defaultConfig, setsDoneActive, setUnitsTotal, supersetUnits, unitOf, setLabel, modeOf, isBw, isPerSide, repStep, EFFORT, effortOf, stepEffort, capEffort, cascadeWeight, insertWarmupRow, removeRowAt, pairAdjacent, unpairSuperset, cleanupSg, applyIntensifierPlan, pinnedNoteFor, exNoteFor } from '../lib/history.js'
import { fmtNum, capWords, fmtDate, todayISO, exCount, DAYN } from '../lib/format.js'
import { beep, vibrate } from '../lib/sound.js'
import { beep, vibrate, unlock } from '../lib/sound.js'
import { t, exerciseNameFor } from '../lib/i18n.js'
import { api } from '../lib/api.js'
import { insertionIndexAfterCurrentUnit, nextUnfinishedUnit, setProgressHighWater, supersetFlowStep, restAfterSet, restOnRecheck, restSecFor, warmupRestSecFor } from '../lib/supersetFlow.js'
@@ -806,6 +806,9 @@ function ActiveWorkout() {
// behave exactly as they do for a reps set.
const startTimed = (idx, i) => {
const e = A.entries[idx]
// This tap may be the only one before the hold's countdown beeps (a timed first exercise):
// get the audio context running while it still counts as a gesture (iOS, #152).
unlock(S.sound)
useUI.getState().startWork(e.sets[i].sec || 45, exerciseNameFor(exOr(e.id)), elapsed => {
mutEntry(idx, en => { en.sets[i].sec = elapsed })
if (!useStore.getState().S.active.entries[idx].sets[i].done) toggle(idx, i)
+1 -1
View File
@@ -8,7 +8,7 @@ import { DEF, useStore } from '../store/useStore.js'
import { useUI } from '../store/useUI.js'
import { LANGS, DERIVED_LOCALES } from '../lib/i18n-core.js'
vi.mock('../lib/sound.js', () => ({ beep: vi.fn(), vibrate: vi.fn() }))
vi.mock('../lib/sound.js', () => ({ beep: vi.fn(), vibrate: vi.fn(), unlock: vi.fn() }))
vi.mock('../lib/api.js', () => ({ api: vi.fn(() => Promise.resolve({})) }))
globalThis.IS_REACT_ACT_ENVIRONMENT = true
+2 -2
View File
@@ -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.6).
Built by scripts/build-api-docs.mjs from api/openapi.yaml (openGym API v1.3.7).
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.6</span>
<span>openGym v1.3.7</span>
<span>30 endpoints</span>
<span>AGPL-3.0-or-later</span>
</p>
+22 -2
View File
@@ -493,6 +493,25 @@ docker compose up -d # restart alone does NOT re-read .env</code></pre>
<code>./data/vapid.json</code>, and each browser reports its own timezone. Set
<code>VAPID_SUBJECT=mailto:you@example.com</code> if you'd rather push services could
reach an inbox than your origin URL.</p>
<p>Where it works: any desktop browser, Android Chrome, and on iOS only the app <b>added to
the Home Screen</b> (a Safari tab has no Web Push). The Android APK doesn't use Web Push —
its reminder is a local notification scheduled on the phone. A reminder that was due while
the server was down or restarting is still sent up to 15 minutes late, once; the browser
re-registers its subscription with the server on every signed-in start, so one the server
lost heals itself; and a rest-timer alert belongs to the device that started the rest, so
finishing a rest on the desktop no longer silences the phone.</p>
<h3 id="sh-sync">Sync between devices</h3>
<p>Signed in, <b>the profile on the server is the truth</b>. Signing in on a device adopts it
— settings, plan, history — and if that device logged workouts while signed out, one
dialog asks whether to add them to the profile or keep the profile as it is. While the
app is open it asks the server every 30 seconds (and every time it comes back to the
foreground) whether anything changed and fetches only what did, so a session logged on the
phone shows up on the desktop within half a minute. Two devices that both changed
something are merged on the server's revision — every workout, routine and weigh-in from
both sides is kept, settings follow the newer copy — instead of one overwriting the other.
Without a network the app keeps working on the device and says so under the header; the
changes go up when the connection is back.</p>
<h3 id="sh-stack">Fitting it into an existing stack</h3>
<p>The defaults assume openGym is alone: a service called <code>api</code> on port 3000,
@@ -587,8 +606,9 @@ ALLOW_GUEST=0 # remove "Continue without account"</code></pre>
<p>Worth knowing: the pairing exchanges the code for a bearer token that is the same signed
value a session cookie carries — so <b>"sign out everywhere"</b> in the browser revokes
paired apps too. Use an HTTPS address if at all possible (the token would otherwise
cross the network in plain text). A connected app needs network access while in use —
no offline mirror, same as the browser PWA. Settings → <b>Disconnect</b> syncs one last
cross the network in plain text). A connected app keeps working without a network on the
last copy it synced — it shows an "Offline" line under the header and pushes your changes
as soon as the connection is back, same as the browser PWA. Settings → <b>Disconnect</b> syncs one last
time, then drops the device cleanly back to local mode. (For the curious: it's
<code>POST /api/pair/create</code> + <code>/api/pair/redeem</code> in
<code>api/server.js</code>.)</p>
+1 -1
View File
@@ -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.6 · 27.7 MB · Android 6.0+ · signed APK. Your browser will ask
<p class="meta">v1.3.7 · 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://github.com/DuarteSantos8/openGym/releases" rel="noopener">GitHub