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.
JavaScript apple-watchbodyweightdockerfitnessfitness-trackergymhealthiosmcpnodejspasskeysprogressive-web-applicationspwareactself-hostedself-hostingvitewebauthnweightliftingworkout-tracker
Animations: the quality setting, the packs bridge and the media fallback
Duarte Santos877d4eb99bc3
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsxindex 813efcd0e..e3287b683 100644--- a/frontend/src/App.jsx+++ b/frontend/src/App.jsx@@ -27,6 +27,7 @@ import SyncBanner from './components/SyncBanner.jsx'import RestTimer from './components/RestTimer.jsx'import TimerFlash from './components/TimerFlash.jsx'import { openDeviceLinkRedeem } from './components/Passkeys.jsx'+import { useAnimPacksBoot } from './components/Animations.jsx'import Login from './views/Login.jsx'import MobileOnboarding from './views/MobileOnboarding.jsx'import PermissionSteps from './views/PermissionSteps.jsx'@@ -82,6 +83,9 @@ function Shell() {useEffect(() => { setAlarmBuzzer(MOBILE && S.vibrate !== false && S.vibrateOnSilent ? buzzAsAlarm : null) }, [S.vibrate, S.vibrateOnSilent])// iPhone app: the page cannot buzz (no navigator.vibrate), its native side can.useEffect(() => { if (MOBILE) nativePlatform().then(p => { if (p === 'ios') setNativeBuzzer(buzzAsAlarm) }) }, [])+ // Store apps: which animation packs this device has, and the one the chosen quality wants for+ // the figure shown (components/Animations.jsx). Nothing on the web.+ useAnimPacksBoot()const isGuest = useStore(s => s.isGuest())const needsMobileOnboarding = useStore(s => s.needsMobileOnboarding)const permSteps = useStore(s => s.permSteps)diff --git a/frontend/src/components/Animations.jsx b/frontend/src/components/Animations.jsxnew file mode 100644index 000000000..6ba764c8f--- /dev/null+++ b/frontend/src/components/Animations.jsx@@ -0,0 +1,104 @@+// Settings → Workout → Animation quality, and the hooks that put the chosen quality on screen+// (store apps only; the web and a self-hosted server show nothing new and keep their 180 px+// files). The rules are lib/anim-quality.js, the packs and the per-device choice lib/anim-packs.js.+import { useEffect, useSyncExternalStore } from 'react'+import { useStore } from '../store/useStore.js'+import { t } from '../lib/i18n.js'+import { MOBILE } from '../lib/mobile.js'+import { gifSrc, figureOf } from '../lib/exercises.js'+import { fmtMB } from '../lib/media-limits.js'+import { BUILTIN_PX, packQualities, packId, wantedQuality, clipSources } from '../lib/anim-quality.js'+import { subscribe, getState, installedBases, deviceInfo, refresh, ensureWanted, writePrefs, download, remove } from '../lib/anim-packs.js'+import { Section, Row, Switch, Button } from './ui.jsx'+import { useUI } from '../store/useUI.js'++const MB = 1024 * 1024+export const useAnimPacks = () => useSyncExternalStore(subscribe, getState, getState)++/**+ * Where a built-in exercise's animation comes from, best first (lib/anim-quality.js clipSources):+ * `{ still, sources }`. Off the store apps, always the built-in file.+ */+export function useAnimSources(ex, figure) {+ const packs = useAnimPacks()+ const builtin = ex?.gif ? gifSrc(ex, figure) : null+ if (!MOBILE) return { still: false, sources: builtin ? [builtin] : [] }+ const choice = packs.available ? packs.prefs.choice : (packs.prefs.choice === 'still' ? 'still' : 'builtin')+ return clipSources({ ex, figure, choice, device: deviceInfo(), installed: installedBases(packs), builtin })+}++/** Shell: what the device has, once, and the pack the choice wants for the figure shown. */+export function useAnimPacksBoot() {+ const figure = useStore(s => figureOf(s.S))+ useEffect(() => { if (MOBILE) refresh().then(() => ensureWanted(figure)).catch(() => {}) }, [])+ useEffect(() => { if (MOBILE && getState().checked) ensureWanted(figure) }, [figure])+}++// "Auto (360 px)", "Still only", "Built in (180 px)", "720 px".+export function choiceLabel(choice, packs = getState()) {+ if (choice === 'still') return t('Still only')+ if (choice === 'builtin' || !packs.available) return t('Built in ({0} px)', BUILTIN_PX)+ if (choice === 'auto') {+ const q = wantedQuality('auto', deviceInfo())+ return t('Auto ({0})', q === 'builtin' ? t('{0} px', BUILTIN_PX) : t('{0} px', q))+ }+ return t('{0} px', choice)+}++export function AnimationQualityRow() {+ const packs = useAnimPacks()+ if (!MOBILE) return null+ return <Row icon="image" iconTint="var(--indigo)" title={t('Animation quality')} value={choiceLabel(packs.prefs.choice, packs)} accessory="chevron"+ onClick={() => useUI.getState().openSheet(close => <AnimationQualitySheet close={close} />)} />+}++// One pack's line under its quality: downloaded and how big, on its way, waiting for Wi-Fi.+function packLine(p) {+ if (!p || p.state === 'none' || !p.state) return t('Not downloaded')+ if (p.state === 'ready') return t('Downloaded · {0}', t('{0} MB', fmtMB(Math.max(0.1, (p.bytes || 0) / MB))))+ if (p.state === 'downloading') return t('Downloading… {0}%', Math.round((p.progress || 0) * 100))+ if (p.state === 'needs-wifi') return t('Waiting for Wi-Fi')+ return t('Download failed. Tap to try again.')+}++export function AnimationQualitySheet({ close }) {+ const packs = useAnimPacks()+ const figure = useStore(s => figureOf(s.S))+ const { choice, wifiOnly } = packs.prefs+ const pick = c => { writePrefs({ choice: c }); ensureWanted(figure) }+ const retry = id => () => download(id)+ const qualities = packs.available ? packQualities() : []+ const ready = Object.entries(packs.packs).filter(([, p]) => p.state === 'ready')+ return <>+ <h3>{t('Animation quality')}</h3>+ <Section footer={packs.available+ ? t('Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.')+ : t('Sharper animations aren’t available on this device yet. The built-in ones work everywhere.')}>+ {packs.available && <Row title={choiceLabel('auto', packs)} subtitle={t('A good size for this screen.')} accessory={choice === 'auto' ? 'check' : 'none'} onClick={() => pick('auto')} />}+ <Row title={t('Still only')} subtitle={t('No animation, just the picture. Easy on battery.')} accessory={choice === 'still' ? 'check' : 'none'} onClick={() => pick('still')} />+ <Row title={choiceLabel('builtin', packs)} accessory={choice === 'builtin' || (!packs.available && choice !== 'still') ? 'check' : 'none'} onClick={() => pick('builtin')} />+ {qualities.map(px => {+ const id = packId(px, figure)+ const p = packs.packs[id]+ const failed = p?.state === 'failed' || p?.state === 'needs-wifi'+ return <Row key={px} title={t('{0} px', px)} subtitle={packLine(p)} accessory={choice === px ? 'check' : 'none'}+ onClick={failed && choice === px ? retry(id) : () => pick(px)} />+ })}+ </Section>+ {packs.available && <Section>+ <Row icon="cloud" iconTint="var(--blue)" title={t('Download over Wi-Fi only')}>+ <Switch checked={wifiOnly} onChange={v => writePrefs({ wifiOnly: v })} />+ </Row>+ </Section>}+ {ready.length > 0 && <Section title={t('On this device')}>+ {ready.map(([id, p]) => {+ const [, px, fig] = /^anim-(\d+)-(male|female)$/.exec(id) || []+ return <Row key={id} title={t('{0} px', px) + ' · ' + (fig === 'female' ? t('Female') : t('Male'))}+ subtitle={t('{0} MB', fmtMB(Math.max(0.1, (p.bytes || 0) / MB)))}>+ <Button size="sm" variant="danger" onClick={() => remove(id)}>{t('Delete')}</Button>+ </Row>+ })}+ </Section>}+ <Button variant="ghost" className="dim" onClick={close}>{t('Done')}</Button>+ </>+}diff --git a/frontend/src/components/Media.jsx b/frontend/src/components/Media.jsxindex cd473c440..2405a1b0d 100644--- a/frontend/src/components/Media.jsx+++ b/frontend/src/components/Media.jsx@@ -5,6 +5,7 @@ import { useStore } from '../store/useStore.js'import { t, exerciseNameFor } from '../lib/i18n.js'import Icon from './Icon.jsx'import CustomMedia, { CustomThumb } from './CustomMedia.jsx'+import { useAnimSources } from './Animations.jsx'// An exercise's picture, wherever one shows. A custom exercise goes to CustomMedia.jsx — its own// photo, GIF, video or link, from the local media store — and never through imgSrc/gifSrc, which@@ -31,16 +32,29 @@ function BuiltinMedia({ ex, id, compact, minimizable }) {const gifSize = useStore(s => s.S.gifSize)const body = useStore(s => figureOf(s.S))const update = useStore(s => s.update)- const clip = ex.gif && isVideoSrc(gifSrc(ex, body)) ? gifSrc(ex, body) : null+ // In the store apps the animation may come from a downloaded pack at the chosen quality+ // (Settings → Animation quality, components/Animations.jsx): the sources are the best file+ // first and the built-in one last, and one that will not load hands over to the next before the+ // still is shown. 'Still only' asks for no animation at all. Elsewhere: the built-in file.+ const anim = useAnimSources(ex, body)+ const sourcesKey = anim.sources.join('|')+ const [tried, setTried] = useState({ key: sourcesKey, i: 0 })+ const at = tried.key === sourcesKey ? tried.i : 0+ const gif = anim.sources[Math.min(at, Math.max(0, anim.sources.length - 1))] || gifSrc(ex, body)+ const clip = ex.gif && isVideoSrc(gif) ? gif : nullconst clipSrc = useClipInMemory(clip)if (!ex.gif) return nullif (minimizable && gifSize === 'off') return nullconst 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 showGif = playing && failed == null && !anim.still+ const onError = () => {+ if (showGif && at < anim.sources.length - 1) { setTried({ key: sourcesKey, i: at + 1 }); return }+ setFailed(showGif ? 'gif' : 'all')+ }const onTap = () => {- if (failed) { setFailed(null); setPlaying(true); return }+ if (failed) { setFailed(null); setPlaying(true); setTried({ key: sourcesKey, i: 0 }); return }+ if (anim.still) returnsetPlaying(p => !p)}return (@@ -55,13 +69,13 @@ function BuiltinMedia({ ex, id, compact, minimizable }) {: showGif && clip// the phone app is still reading the clip into memory: the still holds its place? <img decoding="async" draggable={false} src={imgSrc(ex, body)} alt={exerciseNameFor(ex)} />- : <img decoding="async" draggable={false} src={showGif ? gifSrc(ex, body) : imgSrc(ex, body)} alt={exerciseNameFor(ex)} onError={onError} />}+ : <img decoding="async" draggable={false} src={showGif ? gif : imgSrc(ex, body)} alt={exerciseNameFor(ex)} onError={onError} />}{minimizable && (<button className="giftoggle" onClick={toggleSize}><Icon name={mini ? 'expand' : 'minimize'} />{mini ? t('Expand') : t('Minimize')}</button>)}- {!mini && !failed && (+ {!mini && !failed && !anim.still && (<span className="gifhint"><Icon name={playing ? 'pause' : 'play'} />{playing ? t('tap to pause') : t('tap to play')}</span>diff --git a/frontend/src/lib/anim-packs.js b/frontend/src/lib/anim-packs.jsnew file mode 100644index 000000000..08bff0a11--- /dev/null+++ b/frontend/src/lib/anim-packs.js@@ -0,0 +1,149 @@+// The animation packs on this device (store apps only): what is installed, what is downloading,+// and the person's choice of quality. The rules are lib/anim-quality.js; this is the state around+// them and the bridge to the native AnimationPacks plugin:+//+// available() → { available } iOS 26+ with Apple-hosted packs+// status({ packId, probe }) → { state: 'ready'|'none', bytes?, downloadSize? }+// download({ packId, wifiOnly, probe }) → resolves once installed; 'progress' events+// { packId, fraction }; rejects with a code:+// 'needs-wifi', 'unavailable', 'cancelled', 'failed'+// remove({ packId })+// localPath({ packId, probe }) → { path } the folder the pack's <id>.webp sit in+//+// `probe` is one drawing the pack holds, for a native side that can only find a pack's folder+// through one of its files. iOS: ios/App/App/AnimationPacksPlugin.swift. Android answers+// "unavailable" until Play Asset Delivery comes (and the sideloaded APK never has packs).+//+// The choice is this device's, not the profile's: kept in localStorage, never in S, so it never+// syncs. Packs are downloaded per device, and a phone and an iPad want different sizes; the+// profile, its workouts and its history are not touched by any of this.+import { MOBILE } from './mobile.js'+import { EXIDX } from './exercises.js'+import { PACK_QUALITIES, FIGURES, packId, packDrawingId, readChoice, wantedPack, DEFAULT_CHOICE } from './anim-quality.js'++export const PREFS_KEY = 'gym_anim_v1'+export const ALL_PACKS = PACK_QUALITIES.flatMap(px => FIGURES.map(f => packId(px, f)))+const PROBE_EX = '0001'+export const probeFor = id => packDrawingId(EXIDX[PROBE_EX], id.endsWith('-female') ? 'female' : 'male')++/* ---------------------------------------------------------------- the choice, per device */+export function readPrefs(storage = globalThis.localStorage) {+ let v = null+ try { v = JSON.parse(storage?.getItem(PREFS_KEY) || 'null') } catch { /* unreadable: the defaults */ }+ return { choice: readChoice(v?.choice ?? DEFAULT_CHOICE), wifiOnly: v?.wifiOnly !== false }+}+export function writePrefs(patch, storage = globalThis.localStorage) {+ const next = { ...readPrefs(storage), ...patch }+ next.choice = readChoice(next.choice)+ next.wifiOnly = next.wifiOnly !== false+ try { storage?.setItem(PREFS_KEY, JSON.stringify(next)) } catch { /* private mode: for this run only */ }+ state = { ...state, prefs: next }+ emit()+ return next+}++/** The screen's short side in CSS px: what Auto reads to tell a phone from a tablet. */+export const deviceInfo = () => {+ try { return { shortSide: Math.min(window.screen?.width || 0, window.screen?.height || 0) } } catch { return {} }+}++/* ---------------------------------------------------------------- state */+// packs: { [packId]: { state: 'none'|'ready'|'downloading'|'failed'|'needs-wifi', progress, bytes, base } }+let state = { available: false, checked: false, packs: {}, prefs: readPrefs() }+const listeners = new Set()+const emit = () => { for (const fn of listeners) fn() }+export const subscribe = fn => { listeners.add(fn); return () => listeners.delete(fn) }+export const getState = () => state+const setPack = (id, patch) => { state = { ...state, packs: { ...state.packs, [id]: { ...(state.packs[id] || {}), ...patch } } }; emit() }++/** The installed packs as clipSources wants them: pack id → base its files are read from. */+export const installedBases = (s = state) =>+ Object.fromEntries(Object.entries(s.packs).filter(([, p]) => p.state === 'ready' && p.base).map(([id, p]) => [id, p.base]))++/* ---------------------------------------------------------------- the native side */+// Registered once and handed out inside an object: a Capacitor plugin proxy answers `then` with+// a native call that never settles, so a promise resolved with the bare proxy hangs (#42).+let pluginP = null+const packsPlugin = () => pluginP || (pluginP = (async () => {+ if (!MOBILE) return null+ const { registerPlugin, Capacitor } = await import('@capacitor/core')+ return { Packs: registerPlugin('AnimationPacks'), toUrl: p => Capacitor.convertFileSrc(p) }+})().catch(() => null))++async function readPack(p, id) {+ try {+ const st = await p.Packs.status({ packId: id, probe: probeFor(id) })+ if (st?.state !== 'ready') { setPack(id, { state: state.packs[id]?.state === 'downloading' ? 'downloading' : 'none', bytes: 0, base: null }); return }+ const { path } = await p.Packs.localPath({ packId: id, probe: probeFor(id) })+ setPack(id, { state: 'ready', bytes: Number(st.bytes) || 0, base: path ? p.toUrl(path) : null, progress: 1 })+ } catch { setPack(id, { state: 'none', base: null }) }+}++/** Asks the native side what it has. Once at start, and after every download or removal. */+export async function refresh() {+ const p = await packsPlugin()+ if (!p) { state = { ...state, checked: true, available: false }; emit(); return state }+ let available = false+ try { available = !!(await p.Packs.available())?.available } catch { available = false }+ state = { ...state, checked: true, available }+ emit()+ if (available) await Promise.all(ALL_PACKS.map(id => readPack(p, id)))+ return state+}++let progressHooked = false+const downloads = new Map()+/** Downloads a pack; resolves to 'ready' or the code it stopped with. One at a time per pack. */+export function download(id) {+ if (downloads.has(id)) return downloads.get(id)+ const run = (async () => {+ const p = await packsPlugin()+ if (!p || !state.available) return 'unavailable'+ if (!progressHooked) {+ progressHooked = true+ // Returned into the catch: addListener rejects when the plugin is not behind the bridge.+ Promise.resolve(p.Packs.addListener('progress', e => {+ if (e?.packId && state.packs[e.packId]?.state === 'downloading') setPack(e.packId, { progress: Math.max(0, Math.min(1, Number(e.fraction) || 0)) })+ })).catch(() => {})+ }+ setPack(id, { state: 'downloading', progress: 0 })+ try {+ await p.Packs.download({ packId: id, wifiOnly: state.prefs.wifiOnly, probe: probeFor(id) })+ await readPack(p, id)+ return state.packs[id]?.state === 'ready' ? 'ready' : 'failed'+ } catch (e) {+ const code = ['needs-wifi', 'unavailable', 'cancelled'].includes(e?.code) ? e.code : 'failed'+ setPack(id, { state: code === 'needs-wifi' ? 'needs-wifi' : code === 'cancelled' ? 'none' : 'failed' })+ return code+ }+ })().finally(() => downloads.delete(id))+ downloads.set(id, run)+ return run+}++export async function remove(id) {+ const p = await packsPlugin()+ if (!p) return false+ try { await p.Packs.remove({ packId: id }) } catch { /* read back below either way */ }+ await readPack(p, id)+ return state.packs[id]?.state !== 'ready'+}++/**+ * Starts the download the current choice and figure want, when the pack is not there yet and+ * not on its way. Called when the choice or the figure changes and at start. Never touches the+ * profile: the figure is only read.+ */+export function ensureWanted(figure, device = deviceInfo()) {+ if (!state.available) return null+ const id = wantedPack(state.prefs.choice, figure, device)+ if (!id) return null+ const st = state.packs[id]?.state+ if (st === 'ready' || st === 'downloading') return null+ return download(id)+}++export function _resetAnimPacks(next = {}) {+ pluginP = null; progressHooked = false; downloads.clear()+ state = { available: false, checked: false, packs: {}, prefs: readPrefs(), ...next }+}diff --git a/frontend/src/lib/anim-packs.test.js b/frontend/src/lib/anim-packs.test.jsnew file mode 100644index 000000000..c83094c66--- /dev/null+++ b/frontend/src/lib/anim-packs.test.js@@ -0,0 +1,124 @@+// @vitest-environment happy-dom+import { beforeEach, describe, expect, it, vi } from 'vitest'++/* The animation packs on this device (lib/anim-packs.js): the per-device choice, the bridge to+ the native AnimationPacks plugin and the download a choice or a figure starts. The plugin is a+ stand-in shaped like Capacitor's: a Proxy whose `then` is a native call that never answers (#42). */+const mocks = vi.hoisted(() => ({ MOBILE: true, available: true, ready: new Set(), calls: [], listeners: {}, downloadFails: null }))+vi.mock('./mobile.js', () => ({ get MOBILE() { return mocks.MOBILE } }))+vi.mock('@capacitor/core', () => {+ const impl = {+ available: async () => ({ available: mocks.available }),+ status: async ({ packId }) => (mocks.ready.has(packId) ? { state: 'ready', bytes: 5 * 1024 * 1024 } : { state: 'none' }),+ localPath: async ({ packId }) => ({ path: '/var/packs/' + packId }),+ download: async ({ packId, wifiOnly, probe }) => {+ mocks.calls.push(['download', packId, wifiOnly, probe])+ mocks.listeners.progress?.({ packId, fraction: 0.5 })+ if (mocks.downloadFails) throw Object.assign(new Error(mocks.downloadFails), { code: mocks.downloadFails })+ mocks.ready.add(packId)+ },+ remove: async ({ packId }) => { mocks.calls.push(['remove', packId]); mocks.ready.delete(packId) },+ addListener: (ev, fn) => { mocks.listeners[ev] = fn; return { remove() {} } },+ }+ return {+ registerPlugin: name => {+ expect(name).toBe('AnimationPacks')+ return new Proxy({}, { get: (_, k) => impl[k] || (() => new Promise(() => {})) })+ },+ Capacitor: { convertFileSrc: p => 'capacitor://localhost/_capacitor_file_' + p },+ }+})++import * as packs from './anim-packs.js'++const phone = { shortSide: 390 }+beforeEach(() => {+ localStorage.clear()+ mocks.MOBILE = true; mocks.available = true; mocks.ready = new Set(); mocks.calls = []; mocks.listeners = {}; mocks.downloadFails = null+ packs._resetAnimPacks()+})++describe('the choice is this device’s', () => {+ it('defaults to auto over Wi-Fi only, and is kept in localStorage, nowhere else', () => {+ expect(packs.readPrefs()).toEqual({ choice: 'auto', wifiOnly: true })+ packs.writePrefs({ choice: 720, wifiOnly: false })+ expect(JSON.parse(localStorage.getItem(packs.PREFS_KEY))).toEqual({ choice: 720, wifiOnly: false })+ expect(packs.readPrefs()).toEqual({ choice: 720, wifiOnly: false })+ })+ it('reads junk as the defaults', () => {+ localStorage.setItem(packs.PREFS_KEY, '{nope')+ expect(packs.readPrefs()).toEqual({ choice: 'auto', wifiOnly: true })+ localStorage.setItem(packs.PREFS_KEY, JSON.stringify({ choice: 'ultra', wifiOnly: 'yes' }))+ expect(packs.readPrefs()).toEqual({ choice: 'auto', wifiOnly: true })+ })+})++describe('the native side', () => {+ it('reads what is installed, with the folder each pack’s files are served from', async () => {+ mocks.ready.add('anim-360-male')+ await packs.refresh()+ const s = packs.getState()+ expect(s.available).toBe(true)+ expect(packs.installedBases(s)).toEqual({ 'anim-360-male': 'capacitor://localhost/_capacitor_file_/var/packs/anim-360-male' })+ expect(s.packs['anim-360-male'].bytes).toBe(5 * 1024 * 1024)+ expect(s.packs['anim-720-female'].state).toBe('none')+ })+ it('unavailable (older iOS, Android, the sideloaded APK): no packs, nothing asked for', async () => {+ mocks.available = false+ await packs.refresh()+ expect(packs.getState().available).toBe(false)+ expect(packs.ensureWanted('male', phone)).toBeNull()+ expect(mocks.calls).toEqual([])+ })+ it('the web build registers nothing', async () => {+ mocks.MOBILE = false+ await packs.refresh()+ expect(packs.getState()).toMatchObject({ available: false, checked: true })+ })+})++describe('downloads', () => {+ it('auto on a phone fetches the 360 pack of the figure shown, over Wi-Fi only, with a probe the pack holds', async () => {+ await packs.refresh()+ expect(await packs.ensureWanted('female', phone)).toBe('ready')+ expect(mocks.calls).toEqual([['download', 'anim-360-female', true, '2476']])+ expect(packs.getState().packs['anim-360-female']).toMatchObject({ state: 'ready', progress: 1 })+ })+ it('switching figure fetches the other figure’s pack of the same quality; one already there is left alone', async () => {+ mocks.ready.add('anim-720-male')+ packs.writePrefs({ choice: 720 })+ await packs.refresh()+ expect(packs.ensureWanted('male', phone)).toBeNull()+ await packs.ensureWanted('female', phone)+ expect(mocks.calls).toEqual([['download', 'anim-720-female', true, '2476']])+ })+ it('still only and built in download nothing', async () => {+ await packs.refresh()+ for (const choice of ['still', 'builtin']) {+ packs.writePrefs({ choice })+ expect(packs.ensureWanted('male', phone)).toBeNull()+ }+ expect(mocks.calls).toEqual([])+ })+ it('no Wi-Fi: waits for it, and a later try goes ahead', async () => {+ await packs.refresh()+ mocks.downloadFails = 'needs-wifi'+ expect(await packs.download('anim-480-male')).toBe('needs-wifi')+ expect(packs.getState().packs['anim-480-male'].state).toBe('needs-wifi')+ mocks.downloadFails = null+ expect(await packs.download('anim-480-male')).toBe('ready')+ })+ it('a failure is said, and nothing counts as installed', async () => {+ await packs.refresh()+ mocks.downloadFails = 'boom'+ expect(await packs.download('anim-480-male')).toBe('failed')+ expect(packs.installedBases()).toEqual({})+ })+ it('removing a pack takes it off the list', async () => {+ mocks.ready.add('anim-1080-male')+ await packs.refresh()+ expect(await packs.remove('anim-1080-male')).toBe(true)+ expect(packs.installedBases()).toEqual({})+ expect(mocks.calls).toEqual([['remove', 'anim-1080-male']])+ })+})diff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.jsindex 5d5994fb3..16932ec1a 100644--- a/frontend/src/lib/pt-br-locale.test.js+++ b/frontend/src/lib/pt-br-locale.test.js@@ -41,7 +41,7 @@ describe('Brazilian Portuguese locale', () => {// has to be taught is a number nobody reads. What the numbers stood for is asserted above.// If the hash fails, review the changed keys and wording before accepting a new one. From// frontend/: node scripts/pt-br-inheritance-fingerprint.mjs --list- expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('216032f046ce2c36098a4a434d117bb1c33737f96c5a4eb7e377de0cfdcabb1d')+ expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('5f0b01ecc8dcce4d1b6915c23c83de665ec915ca5650d5b6f3cafb4e8d95f9c8')})// pt-PT labelled Unpair 'Desfazer': Undo, in Portuguese (it is pt-BR's Undo), on the button thatdiff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.jsindex 0542ae348..ba3374228 100644--- a/frontend/src/locales/ar.js+++ b/frontend/src/locales/ar.js@@ -2346,4 +2346,21 @@ export default {'Training reminders, only if you switch them on': 'تذكيرات التمرين، فقط إذا فعّلتها','You can change it anytime in your phone’s settings.': 'يمكنك تغيير ذلك في أي وقت من إعدادات هاتفك.','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': 'يمكن لـ openGym أن ينقر على كتفك عند انتهاء الراحة، حتى والهاتف مقفل في جيبك.',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': 'حجم مناسب لهذه الشاشة.',+ 'Animation quality': 'جودة الرسوم المتحركة',+ 'Auto ({0})': 'تلقائي ({0})',+ 'Built in ({0} px)': 'مدمجة ({0} px)',+ 'Download failed. Tap to try again.': 'فشل التنزيل. اضغط للمحاولة مجددًا.',+ 'Download over Wi-Fi only': 'التنزيل عبر Wi-Fi فقط',+ 'Downloaded · {0}': 'تم التنزيل · {0}',+ 'Downloading… {0}%': 'جارٍ التنزيل… {0}%',+ 'No animation, just the picture. Easy on battery.': 'بلا حركة، الصورة فقط. أرحم بالبطارية.',+ 'Not downloaded': 'لم يتم التنزيل',+ 'On this device': 'على هذا الجهاز',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': 'الرسوم الأوضح غير متاحة على هذا الجهاز بعد. الرسوم المدمجة تعمل في كل مكان.',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': 'تُنزَّل الرسوم الأوضح مرة واحدة لكل هيئة. وحتى تصل ترى الرسوم المدمجة، فلا يبقى شيء فارغًا.',+ 'Still only': 'صورة ثابتة فقط',+ 'Waiting for Wi-Fi': 'بانتظار Wi-Fi',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/bn.js b/frontend/src/locales/bn.jsindex e28216ec6..f02789de2 100644--- a/frontend/src/locales/bn.js+++ b/frontend/src/locales/bn.js@@ -2370,4 +2370,21 @@ export default {'Training reminders, only if you switch them on': 'ট্রেনিংয়ের রিমাইন্ডার, শুধু আপনি চালু করলে','You can change it anytime in your phone’s settings.': 'ফোনের সেটিংসে যেকোনো সময় এটি বদলাতে পারেন।','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': 'ফোন লক করে পকেটে রাখলেও, বিশ্রাম শেষ হলে openGym আপনার কাঁধে টোকা দিতে পারে।',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': 'এই স্ক্রিনের জন্য ঠিকঠাক মাপ।',+ 'Animation quality': 'অ্যানিমেশনের মান',+ 'Auto ({0})': 'অটো ({0})',+ 'Built in ({0} px)': 'অন্তর্ভুক্ত ({0} px)',+ 'Download failed. Tap to try again.': 'ডাউনলোড ব্যর্থ। আবার চেষ্টা করতে ট্যাপ করুন।',+ 'Download over Wi-Fi only': 'শুধু Wi-Fi-তে ডাউনলোড',+ 'Downloaded · {0}': 'ডাউনলোড হয়েছে · {0}',+ 'Downloading… {0}%': 'ডাউনলোড হচ্ছে… {0}%',+ 'No animation, just the picture. Easy on battery.': 'অ্যানিমেশন নেই, শুধু ছবি। ব্যাটারি বাঁচে।',+ 'Not downloaded': 'ডাউনলোড হয়নি',+ 'On this device': 'এই ডিভাইসে',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': 'আরও স্পষ্ট অ্যানিমেশন এই ডিভাইসে এখনও নেই। অন্তর্ভুক্তগুলো সব জায়গায় চলে।',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': 'আরও স্পষ্ট অ্যানিমেশন প্রতিটি অবয়বের জন্য একবার ডাউনলোড হয়। ততক্ষণ অন্তর্ভুক্তগুলো দেখবেন, তাই কিছুই ফাঁকা থাকে না।',+ 'Still only': 'শুধু স্থির ছবি',+ 'Waiting for Wi-Fi': 'Wi-Fi-র অপেক্ষায়',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.jsindex a0f46b317..4f78f64d1 100644--- a/frontend/src/locales/de.js+++ b/frontend/src/locales/de.js@@ -2311,4 +2311,21 @@ export default {'Training reminders, only if you switch them on': 'Trainingserinnerungen, nur wenn du sie einschaltest','You can change it anytime in your phone’s settings.': 'Du kannst das jederzeit in den Einstellungen deines Handys ändern.','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': 'openGym tippt dir auf die Schulter, wenn eine Pause vorbei ist, auch wenn das Handy gesperrt in der Tasche steckt.',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': 'Die richtige Größe für diesen Bildschirm.',+ 'Animation quality': 'Animationsqualität',+ 'Auto ({0})': 'Auto ({0})',+ 'Built in ({0} px)': 'Eingebaut ({0} px)',+ 'Download failed. Tap to try again.': 'Download fehlgeschlagen. Tippen zum erneuten Versuch.',+ 'Download over Wi-Fi only': 'Nur über WLAN laden',+ 'Downloaded · {0}': 'Geladen · {0}',+ 'Downloading… {0}%': 'Wird geladen… {0}%',+ 'No animation, just the picture. Easy on battery.': 'Keine Animation, nur das Bild. Schont den Akku.',+ 'Not downloaded': 'Nicht geladen',+ 'On this device': 'Auf diesem Gerät',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': 'Schärfere Animationen gibt es auf diesem Gerät noch nicht. Die eingebauten laufen überall.',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': 'Schärfere Animationen werden einmal pro Figur geladen. Bis sie da sind, siehst du die eingebauten, es bleibt also nie etwas leer.',+ 'Still only': 'Nur Standbild',+ 'Waiting for Wi-Fi': 'Wartet auf WLAN',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.jsindex ea27d59f0..3a7f13d31 100644--- a/frontend/src/locales/es.js+++ b/frontend/src/locales/es.js@@ -2291,4 +2291,21 @@ export default {'Training reminders, only if you switch them on': 'Recordatorios de entreno, solo si los activas','You can change it anytime in your phone’s settings.': 'Puedes cambiarlo cuando quieras en los ajustes del móvil.','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': 'openGym puede darte un toque en el hombro cuando acaba un descanso, aunque el móvil esté bloqueado en tu bolsillo.',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': 'Un buen tamaño para esta pantalla.',+ 'Animation quality': 'Calidad de las animaciones',+ 'Auto ({0})': 'Auto ({0})',+ 'Built in ({0} px)': 'Integradas ({0} px)',+ 'Download failed. Tap to try again.': 'La descarga falló. Toca para reintentar.',+ 'Download over Wi-Fi only': 'Descargar solo con Wi-Fi',+ 'Downloaded · {0}': 'Descargadas · {0}',+ 'Downloading… {0}%': 'Descargando… {0}%',+ 'No animation, just the picture. Easy on battery.': 'Sin animación, solo la imagen. Ahorra batería.',+ 'Not downloaded': 'Sin descargar',+ 'On this device': 'En este dispositivo',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': 'Las animaciones más nítidas aún no están disponibles en este dispositivo. Las integradas funcionan en todas partes.',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': 'Las animaciones más nítidas se descargan una vez por figura. Mientras tanto ves las integradas, así que nunca queda nada en blanco.',+ 'Still only': 'Solo imagen fija',+ 'Waiting for Wi-Fi': 'Esperando Wi-Fi',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.jsindex 654134b75..cc1f080c1 100644--- a/frontend/src/locales/fr.js+++ b/frontend/src/locales/fr.js@@ -2291,4 +2291,21 @@ export default {'Training reminders, only if you switch them on': 'Des rappels d’entraînement, seulement si tu les actives','You can change it anytime in your phone’s settings.': 'Tu peux changer ça à tout moment dans les réglages de ton téléphone.','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': 'openGym peut te taper sur l’épaule quand un repos est fini, même avec le téléphone verrouillé dans ta poche.',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': 'La bonne taille pour cet écran.',+ 'Animation quality': 'Qualité des animations',+ 'Auto ({0})': 'Auto ({0})',+ 'Built in ({0} px)': 'Intégrées ({0} px)',+ 'Download failed. Tap to try again.': 'Le téléchargement a échoué. Touche pour réessayer.',+ 'Download over Wi-Fi only': 'Télécharger en Wi-Fi uniquement',+ 'Downloaded · {0}': 'Téléchargées · {0}',+ 'Downloading… {0}%': 'Téléchargement… {0} %',+ 'No animation, just the picture. Easy on battery.': 'Pas d’animation, juste l’image. Ta batterie te dit merci.',+ 'Not downloaded': 'Pas téléchargées',+ 'On this device': 'Sur cet appareil',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': 'Les animations plus nettes ne sont pas encore disponibles sur cet appareil. Les intégrées marchent partout.',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': 'Les animations plus nettes se téléchargent une fois par silhouette. En attendant, tu vois les intégrées, donc rien ne reste vide.',+ 'Still only': 'Image fixe seulement',+ 'Waiting for Wi-Fi': 'En attente du Wi-Fi',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.jsindex 4a1eb287d..16f9accb9 100644--- a/frontend/src/locales/hi.js+++ b/frontend/src/locales/hi.js@@ -2291,4 +2291,21 @@ export default {'Training reminders, only if you switch them on': 'ट्रेनिंग रिमाइंडर, सिर्फ़ अगर आप चालू करें','You can change it anytime in your phone’s settings.': 'आप इसे कभी भी अपने फ़ोन की सेटिंग्स में बदल सकते हैं।','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': 'फ़ोन लॉक होकर जेब में हो तब भी, रेस्ट खत्म होने पर openGym आपके कंधे पर थपकी दे सकता है।',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': 'इस स्क्रीन के लिए सही आकार।',+ 'Animation quality': 'एनिमेशन की क्वालिटी',+ 'Auto ({0})': 'ऑटो ({0})',+ 'Built in ({0} px)': 'बिल्ट-इन ({0} px)',+ 'Download failed. Tap to try again.': 'डाउनलोड नहीं हुआ। फिर से कोशिश के लिए टैप करें।',+ 'Download over Wi-Fi only': 'सिर्फ़ Wi-Fi पर डाउनलोड करें',+ 'Downloaded · {0}': 'डाउनलोड हो गया · {0}',+ 'Downloading… {0}%': 'डाउनलोड हो रहा है… {0}%',+ 'No animation, just the picture. Easy on battery.': 'कोई एनिमेशन नहीं, बस तस्वीर। बैटरी बचती है।',+ 'Not downloaded': 'डाउनलोड नहीं हुआ',+ 'On this device': 'इस डिवाइस पर',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': 'ज़्यादा साफ़ एनिमेशन इस डिवाइस पर अभी उपलब्ध नहीं हैं। बिल्ट-इन एनिमेशन हर जगह चलते हैं।',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': 'ज़्यादा साफ़ एनिमेशन हर आकृति के लिए एक बार डाउनलोड होते हैं। तब तक आप बिल्ट-इन देखते हैं, इसलिए कुछ भी खाली नहीं रहता।',+ 'Still only': 'सिर्फ़ स्थिर तस्वीर',+ 'Waiting for Wi-Fi': 'Wi-Fi का इंतज़ार',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.jsindex 34aa6e877..9541e461a 100644--- a/frontend/src/locales/hu.js+++ b/frontend/src/locales/hu.js@@ -2294,4 +2294,21 @@ export default {'Training reminders, only if you switch them on': 'Edzésemlékeztetők, csak ha bekapcsolod','You can change it anytime in your phone’s settings.': 'Ezt bármikor megváltoztathatod a telefonod beállításaiban.','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': 'Az openGym megkoppintja a vállad, amikor letelt a pihenő, akkor is, ha a lezárt telefon a zsebedben van.',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': 'Jó méret ehhez a képernyőhöz.',+ 'Animation quality': 'Animációk minősége',+ 'Auto ({0})': 'Auto ({0})',+ 'Built in ({0} px)': 'Beépített ({0} px)',+ 'Download failed. Tap to try again.': 'A letöltés nem sikerült. Koppints az újrapróbáláshoz.',+ 'Download over Wi-Fi only': 'Letöltés csak Wi-Fin',+ 'Downloaded · {0}': 'Letöltve · {0}',+ 'Downloading… {0}%': 'Letöltés… {0}%',+ 'No animation, just the picture. Easy on battery.': 'Nincs animáció, csak a kép. Kíméli az akkut.',+ 'Not downloaded': 'Nincs letöltve',+ 'On this device': 'Ezen az eszközön',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': 'Élesebb animációk ezen az eszközön még nem érhetők el. A beépítettek mindenhol működnek.',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': 'Az élesebb animációk figuránként egyszer töltődnek le. Addig a beépítetteket látod, így semmi sem marad üres.',+ 'Still only': 'Csak állókép',+ 'Waiting for Wi-Fi': 'Wi-Fire vár',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.jsindex 03a57bc07..4381f5adb 100644--- a/frontend/src/locales/it.js+++ b/frontend/src/locales/it.js@@ -2291,4 +2291,21 @@ export default {'Training reminders, only if you switch them on': 'Promemoria di allenamento, solo se li attivi','You can change it anytime in your phone’s settings.': 'Puoi cambiarlo quando vuoi nelle impostazioni del telefono.','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': 'openGym può darti un colpetto sulla spalla quando un recupero è finito, anche con il telefono bloccato in tasca.',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': 'La misura giusta per questo schermo.',+ 'Animation quality': 'Qualità delle animazioni',+ 'Auto ({0})': 'Auto ({0})',+ 'Built in ({0} px)': 'Integrate ({0} px)',+ 'Download failed. Tap to try again.': 'Download non riuscito. Tocca per riprovare.',+ 'Download over Wi-Fi only': 'Scarica solo con Wi-Fi',+ 'Downloaded · {0}': 'Scaricate · {0}',+ 'Downloading… {0}%': 'Download… {0}%',+ 'No animation, just the picture. Easy on battery.': 'Niente animazione, solo l’immagine. La batteria ringrazia.',+ 'Not downloaded': 'Non scaricate',+ 'On this device': 'Su questo dispositivo',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': 'Le animazioni più nitide non sono ancora disponibili su questo dispositivo. Quelle integrate funzionano ovunque.',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': 'Le animazioni più nitide si scaricano una volta per figura. Nel frattempo vedi quelle integrate, quindi non resta mai niente vuoto.',+ 'Still only': 'Solo immagine fissa',+ 'Waiting for Wi-Fi': 'In attesa del Wi-Fi',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.jsindex cc9471f85..ea95f2c02 100644--- a/frontend/src/locales/ko.js+++ b/frontend/src/locales/ko.js@@ -2291,4 +2291,21 @@ export default {'Training reminders, only if you switch them on': '운동 알림은 켰을 때만','You can change it anytime in your phone’s settings.': '언제든 휴대폰 설정에서 바꿀 수 있어요.','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': '휴대폰이 잠긴 채 주머니에 있어도 휴식이 끝나면 openGym이 어깨를 톡 쳐 드려요.',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': '이 화면에 딱 맞는 크기예요.',+ 'Animation quality': '애니메이션 화질',+ 'Auto ({0})': '자동 ({0})',+ 'Built in ({0} px)': '기본 내장 ({0} px)',+ 'Download failed. Tap to try again.': '다운로드에 실패했어요. 탭해서 다시 시도하세요.',+ 'Download over Wi-Fi only': 'Wi-Fi에서만 다운로드',+ 'Downloaded · {0}': '다운로드됨 · {0}',+ 'Downloading… {0}%': '다운로드 중… {0}%',+ 'No animation, just the picture. Easy on battery.': '애니메이션 없이 그림만. 배터리를 아껴요.',+ 'Not downloaded': '다운로드 안 됨',+ 'On this device': '이 기기에 있음',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': '이 기기에서는 아직 더 선명한 애니메이션을 쓸 수 없어요. 기본 내장 애니메이션은 어디서나 돼요.',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': '더 선명한 애니메이션은 체형마다 한 번씩 다운로드돼요. 그전까지는 기본 내장 애니메이션이 보여서 빈칸이 생기지 않아요.',+ 'Still only': '정지 이미지만',+ 'Waiting for Wi-Fi': 'Wi-Fi 기다리는 중',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.jsindex 6fb4ed0a4..c1cd518ca 100644--- a/frontend/src/locales/pl.js+++ b/frontend/src/locales/pl.js@@ -2291,4 +2291,21 @@ export default {'Training reminders, only if you switch them on': 'Przypomnienia o treningu, tylko jeśli je włączysz','You can change it anytime in your phone’s settings.': 'Możesz to zmienić w każdej chwili w ustawieniach telefonu.','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': 'openGym może klepnąć cię w ramię, gdy przerwa się skończy, nawet gdy zablokowany telefon leży w kieszeni.',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': 'Dobry rozmiar dla tego ekranu.',+ 'Animation quality': 'Jakość animacji',+ 'Auto ({0})': 'Auto ({0})',+ 'Built in ({0} px)': 'Wbudowane ({0} px)',+ 'Download failed. Tap to try again.': 'Pobieranie nie powiodło się. Stuknij, aby spróbować ponownie.',+ 'Download over Wi-Fi only': 'Pobieraj tylko przez Wi-Fi',+ 'Downloaded · {0}': 'Pobrane · {0}',+ 'Downloading… {0}%': 'Pobieranie… {0}%',+ 'No animation, just the picture. Easy on battery.': 'Bez animacji, tylko obrazek. Bateria podziękuje.',+ 'Not downloaded': 'Nie pobrano',+ 'On this device': 'Na tym urządzeniu',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': 'Ostrzejsze animacje nie są jeszcze dostępne na tym urządzeniu. Wbudowane działają wszędzie.',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': 'Ostrzejsze animacje pobierają się raz dla każdej sylwetki. Do tego czasu widzisz wbudowane, więc nic nie zostaje puste.',+ 'Still only': 'Tylko obrazek',+ 'Waiting for Wi-Fi': 'Czeka na Wi-Fi',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.jsindex 6ba2f34e5..0de6cba30 100644--- a/frontend/src/locales/pt-BR.js+++ b/frontend/src/locales/pt-BR.js@@ -1451,6 +1451,17 @@ export const PT_BR_OVERRIDES = {'Training reminders, only if you switch them on': 'Lembretes de treino, só se você ativar','You can change it anytime in your phone’s settings.': 'Você pode mudar isso quando quiser nas configurações do celular.','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': 'O openGym pode te dar um toque no ombro quando um descanso acaba, mesmo com o celular bloqueado no bolso.',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': 'Um bom tamanho para esta tela.',+ 'Download failed. Tap to try again.': 'O download falhou. Toque para tentar de novo.',+ 'Download over Wi-Fi only': 'Baixar só pelo Wi-Fi',+ 'Downloaded · {0}': 'Baixadas · {0}',+ 'Downloading… {0}%': 'Baixando… {0}%',+ 'No animation, just the picture. Easy on battery.': 'Sem animação, só a imagem. Economiza bateria.',+ 'Not downloaded': 'Não baixadas',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': 'As animações mais nítidas ainda não estão disponíveis neste dispositivo. As incluídas funcionam em qualquer lugar.',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': 'As animações mais nítidas são baixadas uma vez por figura. Até lá você vê as incluídas, então nada fica em branco.',+ 'Waiting for Wi-Fi': 'Esperando o Wi-Fi',}export default { ...pt, ...PT_BR_OVERRIDES }diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.jsindex 343460cc9..ed432f12f 100644--- a/frontend/src/locales/pt.js+++ b/frontend/src/locales/pt.js@@ -2291,4 +2291,21 @@ export default {'Training reminders, only if you switch them on': 'Lembretes de treino, só se os ligares','You can change it anytime in your phone’s settings.': 'Podes mudar isto quando quiseres nas definições do teu telemóvel.','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': 'O openGym pode dar-te um toque no ombro quando um descanso acaba, mesmo com o telemóvel bloqueado no bolso.',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': 'O tamanho certo para este ecrã.',+ 'Animation quality': 'Qualidade das animações',+ 'Auto ({0})': 'Auto ({0})',+ 'Built in ({0} px)': 'Incluídas ({0} px)',+ 'Download failed. Tap to try again.': 'A transferência falhou. Toca para tentar de novo.',+ 'Download over Wi-Fi only': 'Transferir só por Wi-Fi',+ 'Downloaded · {0}': 'Transferidas · {0}',+ 'Downloading… {0}%': 'A transferir… {0}%',+ 'No animation, just the picture. Easy on battery.': 'Sem animação, só a imagem. Poupa bateria.',+ 'Not downloaded': 'Não transferidas',+ 'On this device': 'Neste dispositivo',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': 'As animações mais nítidas ainda não estão disponíveis neste dispositivo. As incluídas funcionam em todo o lado.',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': 'As animações mais nítidas transferem-se uma vez por figura. Até lá vês as incluídas, por isso nada fica em branco.',+ 'Still only': 'Só imagem fixa',+ 'Waiting for Wi-Fi': 'À espera de Wi-Fi',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.jsindex 669d5d336..d2903e83b 100644--- a/frontend/src/locales/ru.js+++ b/frontend/src/locales/ru.js@@ -2295,4 +2295,21 @@ export default {'Training reminders, only if you switch them on': 'Напоминания о тренировках, только если вы их включите','You can change it anytime in your phone’s settings.': 'Это можно изменить в любой момент в настройках телефона.','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': 'openGym может похлопать вас по плечу, когда отдых закончится, даже если телефон заблокирован и лежит в кармане.',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': 'Хороший размер для этого экрана.',+ 'Animation quality': 'Качество анимаций',+ 'Auto ({0})': 'Авто ({0})',+ 'Built in ({0} px)': 'Встроенные ({0} px)',+ 'Download failed. Tap to try again.': 'Загрузка не удалась. Нажмите, чтобы повторить.',+ 'Download over Wi-Fi only': 'Загружать только по Wi-Fi',+ 'Downloaded · {0}': 'Загружено · {0}',+ 'Downloading… {0}%': 'Загрузка… {0}%',+ 'No animation, just the picture. Easy on battery.': 'Без анимации, только картинка. Бережёт батарею.',+ 'Not downloaded': 'Не загружено',+ 'On this device': 'На этом устройстве',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': 'Более чёткие анимации на этом устройстве пока недоступны. Встроенные работают везде.',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': 'Более чёткие анимации загружаются один раз для каждой фигуры. Пока их нет, вы видите встроенные, так что пусто не бывает.',+ 'Still only': 'Только картинка',+ 'Waiting for Wi-Fi': 'Ждём Wi-Fi',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.jsindex 44ebd54f5..e3f5b990c 100644--- a/frontend/src/locales/th.js+++ b/frontend/src/locales/th.js@@ -2302,4 +2302,21 @@ export default {'Training reminders, only if you switch them on': 'การแจ้งเตือนการฝึก เฉพาะเมื่อคุณเปิดใช้','You can change it anytime in your phone’s settings.': 'เปลี่ยนได้ทุกเมื่อในการตั้งค่าของโทรศัพท์','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': 'openGym สะกิดไหล่คุณได้เมื่อหมดเวลาพัก แม้โทรศัพท์จะล็อกอยู่ในกระเป๋า',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': 'ขนาดที่เหมาะกับหน้าจอนี้',+ 'Animation quality': 'คุณภาพภาพเคลื่อนไหว',+ 'Auto ({0})': 'อัตโนมัติ ({0})',+ 'Built in ({0} px)': 'ในตัวแอป ({0} px)',+ 'Download failed. Tap to try again.': 'ดาวน์โหลดไม่สำเร็จ แตะเพื่อลองอีกครั้ง',+ 'Download over Wi-Fi only': 'ดาวน์โหลดผ่าน Wi-Fi เท่านั้น',+ 'Downloaded · {0}': 'ดาวน์โหลดแล้ว · {0}',+ 'Downloading… {0}%': 'กำลังดาวน์โหลด… {0}%',+ 'No animation, just the picture. Easy on battery.': 'ไม่มีภาพเคลื่อนไหว มีแค่รูป ประหยัดแบตเตอรี่',+ 'Not downloaded': 'ยังไม่ได้ดาวน์โหลด',+ 'On this device': 'ในอุปกรณ์นี้',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': 'ภาพเคลื่อนไหวที่คมชัดกว่ายังไม่มีในอุปกรณ์นี้ ภาพในตัวแอปใช้ได้ทุกที่',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': 'ภาพเคลื่อนไหวที่คมชัดกว่าจะดาวน์โหลดครั้งเดียวต่อรูปร่าง ระหว่างนั้นคุณจะเห็นภาพในตัวแอป จึงไม่มีช่องว่างเลย',+ 'Still only': 'ภาพนิ่งเท่านั้น',+ 'Waiting for Wi-Fi': 'รอ Wi-Fi',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.jsindex 2adc6e9e5..9b3502d0d 100644--- a/frontend/src/locales/tr.js+++ b/frontend/src/locales/tr.js@@ -2291,4 +2291,21 @@ export default {'Training reminders, only if you switch them on': 'Antrenman hatırlatıcıları, sadece açarsan','You can change it anytime in your phone’s settings.': 'Bunu istediğin zaman telefonunun ayarlarından değiştirebilirsin.','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': 'Telefon kilitli halde cebinde olsa bile, dinlenme bitince openGym omzuna dokunabilir.',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': 'Bu ekran için iyi bir boyut.',+ 'Animation quality': 'Animasyon kalitesi',+ 'Auto ({0})': 'Otomatik ({0})',+ 'Built in ({0} px)': 'Yerleşik ({0} px)',+ 'Download failed. Tap to try again.': 'İndirme başarısız. Tekrar denemek için dokun.',+ 'Download over Wi-Fi only': 'Yalnızca Wi-Fi ile indir',+ 'Downloaded · {0}': 'İndirildi · {0}',+ 'Downloading… {0}%': 'İndiriliyor… %{0}',+ 'No animation, just the picture. Easy on battery.': 'Animasyon yok, sadece resim. Pil teşekkür eder.',+ 'Not downloaded': 'İndirilmedi',+ 'On this device': 'Bu cihazda',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': 'Daha net animasyonlar bu cihazda henüz yok. Yerleşik olanlar her yerde çalışır.',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': 'Daha net animasyonlar her figür için bir kez iner. Gelene kadar yerleşik olanları görürsün, yani hiçbir şey boş kalmaz.',+ 'Still only': 'Yalnızca sabit resim',+ 'Waiting for Wi-Fi': 'Wi-Fi bekleniyor',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.jsindex 5e3861e47..a0cd95430 100644--- a/frontend/src/locales/uk.js+++ b/frontend/src/locales/uk.js@@ -2288,4 +2288,21 @@ export default {'Training reminders, only if you switch them on': 'Нагадування про тренування, лише якщо ти їх увімкнеш','You can change it anytime in your phone’s settings.': 'Це можна змінити будь-коли в налаштуваннях телефона.','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': 'openGym може поплескати тебе по плечу, коли відпочинок скінчиться, навіть якщо телефон заблокований і лежить у кишені.',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': 'Гарний розмір для цього екрана.',+ 'Animation quality': 'Якість анімацій',+ 'Auto ({0})': 'Авто ({0})',+ 'Built in ({0} px)': 'Вбудовані ({0} px)',+ 'Download failed. Tap to try again.': 'Завантаження не вдалося. Торкніться, щоб повторити.',+ 'Download over Wi-Fi only': 'Завантажувати лише через Wi-Fi',+ 'Downloaded · {0}': 'Завантажено · {0}',+ 'Downloading… {0}%': 'Завантаження… {0}%',+ 'No animation, just the picture. Easy on battery.': 'Без анімації, лише зображення. Береже батарею.',+ 'Not downloaded': 'Не завантажено',+ 'On this device': 'На цьому пристрої',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': 'Чіткіші анімації на цьому пристрої поки недоступні. Вбудовані працюють усюди.',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': 'Чіткіші анімації завантажуються один раз для кожної фігури. Поки їх немає, ви бачите вбудовані, тож порожньо не буває.',+ 'Still only': 'Лише зображення',+ 'Waiting for Wi-Fi': 'Чекаємо на Wi-Fi',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/zh-TW.js b/frontend/src/locales/zh-TW.jsindex 5e6f3140c..828616b39 100644--- a/frontend/src/locales/zh-TW.js+++ b/frontend/src/locales/zh-TW.js@@ -2284,4 +2284,21 @@ export default {'Training reminders, only if you switch them on': '訓練提醒,只在你開啟時','You can change it anytime in your phone’s settings.': '你隨時可以在手機設定裡更改。','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': '就算手機鎖著放在口袋裡,休息結束時 openGym 也能拍拍你的肩膀。',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': '適合這個螢幕的尺寸。',+ 'Animation quality': '動畫畫質',+ 'Auto ({0})': '自動({0})',+ 'Built in ({0} px)': '內建({0} px)',+ 'Download failed. Tap to try again.': '下載失敗。點一下再試一次。',+ 'Download over Wi-Fi only': '僅透過 Wi-Fi 下載',+ 'Downloaded · {0}': '已下載 · {0}',+ 'Downloading… {0}%': '下載中… {0}%',+ 'No animation, just the picture. Easy on battery.': '不播動畫,只看圖片。更省電。',+ 'Not downloaded': '未下載',+ 'On this device': '此裝置上',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': '此裝置暫時無法使用更清晰的動畫。內建動畫在哪裡都能用。',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': '更清晰的動畫每種體型下載一次。下載好之前會顯示內建動畫,所以永遠不會空白。',+ 'Still only': '僅靜態圖',+ 'Waiting for Wi-Fi': '等待 Wi-Fi',+ '{0} px': '{0} px',}diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.jsindex f4c0a9a8c..a0877d708 100644--- a/frontend/src/locales/zh.js+++ b/frontend/src/locales/zh.js@@ -2291,4 +2291,21 @@ export default {'Training reminders, only if you switch them on': '训练提醒,只在你开启时','You can change it anytime in your phone’s settings.': '你随时可以在手机设置里更改。','openGym can tap you on the shoulder when a rest is over, even with the phone locked in your pocket.': '即使手机锁屏放在口袋里,休息结束时 openGym 也能拍拍你的肩膀。',+ // --- animation quality (store apps) ---+ 'A good size for this screen.': '适合这块屏幕的尺寸。',+ 'Animation quality': '动画清晰度',+ 'Auto ({0})': '自动({0})',+ 'Built in ({0} px)': '内置({0} px)',+ 'Download failed. Tap to try again.': '下载失败。点按重试。',+ 'Download over Wi-Fi only': '仅通过 Wi-Fi 下载',+ 'Downloaded · {0}': '已下载 · {0}',+ 'Downloading… {0}%': '正在下载… {0}%',+ 'No animation, just the picture. Easy on battery.': '不播动画,只看图片。更省电。',+ 'Not downloaded': '未下载',+ 'On this device': '此设备上',+ 'Sharper animations aren’t available on this device yet. The built-in ones work everywhere.': '此设备暂时用不了更清晰的动画。内置动画在哪里都能用。',+ 'Sharper animations download once per figure. Until they’re here you see the built-in ones, so nothing ever goes blank.': '更清晰的动画每种体型下载一次。下载好之前显示内置动画,所以永远不会空白。',+ 'Still only': '仅静态图',+ 'Waiting for Wi-Fi': '等待 Wi-Fi',+ '{0} px': '{0} px',}diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsxindex 3e8f77766..563b1380d 100644--- a/frontend/src/views/Settings.jsx+++ b/frontend/src/views/Settings.jsx@@ -40,6 +40,7 @@ import Icon from '../components/Icon.jsx'import { durationSheet } from '../components/DurationWheel.jsx'import { showsConnection, showsLocalLine } from '../components/SyncBanner.jsx'import BackupFolderRow, { useBackupFolder, autoBackupSubtitle } from '../components/BackupFolderRow.jsx'+import { AnimationQualityRow } from '../components/Animations.jsx'import { ServerSyncSection, KeptChangesRows, leaveServer, connectServer, passkeySignIn } from '../components/ServerSync.jsx'import { passwordOn, PasswordRow, openPasswordSignIn, openPasswordRegister } from '../components/PasswordAuth.jsx'import { usePasskeys, PasskeysRow, DeviceLinkRow, openDeviceLinkRedeem } from '../components/Passkeys.jsx'@@ -517,6 +518,9 @@ export default function Settings({ page = null, find = null, via = null }) {value={S.gifSize === 'mini' || S.gifSize === 'off' ? S.gifSize : 'full'}onChange={v => update(s => { s.gifSize = v })} /></Row>+ {/* Store apps: how sharp the animations are, from packs this device downloads. Per device,+ never synced: the profile is not touched (components/Animations.jsx). */}+ <AnimationQualityRow /></Section><Section><Row icon="wrench" iconTint="var(--grey)" title={t('Fine-tuning')} subtitle={t('Buttons, timed sets')} accessory="chevron" onClick={() => open('advanced')} />diff --git a/frontend/src/views/settings-pages.js b/frontend/src/views/settings-pages.jsindex 9a3614180..88402f8b1 100644--- a/frontend/src/views/settings-pages.js+++ b/frontend/src/views/settings-pages.js@@ -60,6 +60,7 @@ export const SEARCH = [{ page: 'workout', title: 'Weigh in before workouts', icon: 'scale', tint: 'var(--green)', kw: 'body weight weigh scale start' },{ page: 'workout', title: 'Keep screen awake', icon: 'phoneScreen', tint: 'var(--yellow)', kw: 'wake lock screen sleep display on', when: c => c.wakeOK || !c.mobile },{ page: 'workout', title: 'Exercise animations', icon: 'image', tint: 'var(--teal)', kw: 'gif animation video media pictures images', opts: ['Full', 'Small', 'Hidden'] },+ { page: 'workout', title: 'Animation quality', icon: 'image', tint: 'var(--indigo)', kw: 'animation quality resolution sharp hd download pack still px', when: c => c.mobile },{ page: 'workout', title: 'Fine-tuning', icon: 'wrench', tint: 'var(--grey)', kw: 'advanced more options' },// Fine-tuning{ page: 'advanced', title: 'Planned sessions start from', icon: 'clipboard', tint: 'var(--green)', kw: 'start from plan last session reps carry over', opts: ['Your plan', 'Your last session'] },