Commit Graph
596 Commits
Author SHA1 Message Date
Space-Hermes 1a763b3e81 fix: preserve weight units when sharing and importing plans 2026-09-15 06:55:49 +02:00
Space-Hermes 736d743043 test: use the local calendar date for Coach daily cap 2026-09-15 00:19:24 +02:00
Space-Hermes a1b2d31e04 fix: classify audited Olympic lift families across primary muscles 2026-09-15 00:17:11 +02:00
Space-Hermes 8b75ae9b30 fix: tolerate minor typos in longer exercise search words 2026-09-15 00:14:32 +02:00
Mirko Köster 530c1bbe55 i18n(de): use standard ß, not Swiss ss
The German locale spelled the same word both ways: 'Glutes' was Gesäß while
'glutes' was Gesäss, ausschließen sat beside abschliessen, and großen beside
Gross. Eight values are normalised to standard German ß — the schließen forms,
Gesäß, Füße, Vergrößern, Groß — which is also what DATE_LOCALES already
declares by mapping de to de-DE.

The 59 legitimate ss words (Schlüssel, Arbeitssätze, Latissimus, Multipresse…)
are unchanged, and no code outside locales/ references any of these strings.
2026-09-13 11:27:16 +02:00
Boris Kurktchiev 46988c3bfc fix: fetch the manifest with cookies (crossorigin=use-credentials) so the Home Screen icon survives an auth proxy
Browsers request the web app manifest without credentials, even from the same
origin — the spec's default; Safari follows it, Chromium sends cookies anyway.
Behind a login proxy (Authelia, Cloudflare Access, Teleport…) that request gets
the proxy's redirect instead of manifest.json. iOS 26 picks the Home Screen icon
from the manifest ("If you define your icons in the manifest, they're used"), so
Add to Home Screen ends with the generic icon.

crossorigin="use-credentials" is the attribute the spec provides for this; MDN
documents it for exactly this case, Home Assistant and GitLab ship it. No effect
on a deployment without a proxy: same origin, same file.

Verified: `npm run build` keeps the attribute in dist/index.html; frontend suite
109 files / 1613 tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 8b82a5d2571c79c92c08f03f17d16cd0c445d70b)
2026-09-12 19:13:39 -04:00
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 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 32111dcad3 v1.3.6: sync you can trust (server revisions, sign-in adopts the profile, polling, offline mode), self-healing push, the phone fixes, the Astra findings, eleven community merges 2026-09-12 23:11:27 +02:00
Duarte Santos 631d01b1b2 After the merges: four combine-routines / custom-exercise strings in all 14 packs, the de-CH number test accepts either Swiss apostrophe (ICU versions differ), changelog for the merged PRs and MRs 2026-09-12 22:58:25 +02:00
Duarte Santos 86f28acb17 Merge !133: per-side data preserved across progression and session flows (ErrorUsernameAlreadyTaken)
# Conflicts:
#	frontend/src/lib/history.js
2026-09-12 22:55:11 +02:00
Duarte Santos f472f37c3d Merge !120: the equipment filter survives a body-part change in the exercise picker, #150 (ErrorUsernameAlreadyTaken) 2026-09-12 22:54:14 +02:00
Duarte Santos f7e69ac6df Merge !118: plan sharing prints as PDF on the mobile app, #149 (HenryByte)
# Conflicts:
#	frontend/ios/App/App.xcodeproj/project.pbxproj
2026-09-12 22:54:14 +02:00
Duarte Santos 7b9c54bc7f Merge #162: custom exercise improvements — equipment, muscle names, cardio target (LuckaPow)
# Conflicts:
#	frontend/src/index.css
2026-09-12 22:53:22 +02:00
Duarte Santos 2240499793 Merge #174: a switch to skip the weigh-in when a workout starts, #137 (kurktchiev)
# Conflicts:
#	frontend/src/lib/pt-br-locale.test.js
2026-09-12 22:52:39 +02:00
Duarte Santos 6c8bc51d18 Merge #164: a per-exercise rest for warm-up ramp sets, warmupRestSec (kurktchiev) 2026-09-12 22:52:15 +02:00
Duarte Santos e36a1222a1 Merge !125: iOS deployment target 15.5 (thedandano) 2026-09-12 22:52:15 +02:00
Duarte Santos 1977a6427b Merge #117: iOS adopts the UIScene lifecycle for Xcode 26+ / iOS 26+ (shailantani) 2026-09-12 22:52:15 +02:00
Duarte Santos c385025385 Merge #171: de-CH as a derived locale (mkoester) 2026-09-12 22:52:15 +02:00
Duarte Santos b1d79d54c7 Service worker: the shell and the built assets are precached at install and the copy for the cache is cloned before the page reads the response (it was cloned too late and never stored, so an offline reload of the home-screen app failed); the cache is named after the build; starting the app offline raises the offline line at once 2026-09-12 22:20:48 +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
Duarte Santos 14c454f5c1 The "back online" toast fires on the real reconnect path: the pull that runs first cleared the offline flag before the owed push looked at it 2026-09-12 21:56:15 +02:00
Duarte Santos 826432a3a2 Signed in, the server's profile is the truth: sign-in and pairing adopt it and ask once about workouts logged while signed out (Add them / Keep profile as is); the app polls the revision every 30 s and on every resume (GET /api/data/rev) and fetches only what moved; offline and unsynced states show a banner, retry on reconnect and confirm with a toast; pagehide flushes a pending change 2026-09-12 21:51:36 +02:00
Duarte Santos bff87930d8 Progression adds the step the way a stepper tap does — a weight off the increment grid keeps its offset (397 + 10 = 407, not 410; #175); the service worker closes the previous notification of the same kind before showing the next (#172) 2026-09-12 21:21:13 +02:00
Duarte Santos 06f1c007a7 Chip rows: the chips' enlarged tap area gave the 32px strip a 36px scroll height, so a diagonal swipe or a wheel tick shifted the whole row up 4px and left it there — the slop is clipped to the strip vertically 2026-09-12 21:08:40 +02:00
Boris Kurktchiev ebe00a1122 feat(settings): a switch to skip the weigh-in when a workout starts (#137)
Settings → During a workout → "Weigh in before workouts", on by default. Off, tapping Start
begins the session straight away with no body weight on it — what "Start without weighing
in" did, without the sheet. Home and Stats still log weight by hand, and the Home
body-weight footer stops promising "it's also asked before every workout" while it is off.

S.weighIn (DEF true, read as `!== false` so older profiles keep asking, same as checkIn).
startFlow is the single entry point for every Start button, so the check lives there;
"log a past workout" never asked and is unchanged. Three new strings in all 14 locales,
pt-BR as explicit overrides (inherited set and fingerprint unchanged). Test:
sheets.weighin.test.jsx — on / legacy profile / off, through the real store and sheet stack.

Closes #137.
2026-09-12 08:12:00 -04:00
Boris Kurktchiev 82db21100a feat(workout): a per-exercise rest for warm-up ramp sets (warmupRestSec)
An exercise's restSec runs after every set, warm-up ramp included, so a heavy lift with a
150 s working rest also puts 150 s between two light ramp sets. Exercises may now carry a
second optional field, warmupRestSec: the rest between warm-up ramp sets.

- The break after the LAST ramp set (into the first work set) stays the working rest, because
  that is the rest the first heavy set actually needs.
- Without the field nothing changes: ramp sets rest like work sets, exactly as before.
- Like restSec, the field is set by plan files (and by external planners writing routines);
  no new UI, no new string, no locale change. It travels with a shared plan the same way
  restSec does and is dropped when unset.

Where:
- src/lib/supersetFlow.js: warmupRestSecFor(entry, setIdx, workRestSec), the pure rule,
  tested beside it (supersetFlow.test.js)
- src/views/Workout.jsx: the rest started after a checked set goes through it, at all four
  start sites (re-check, singleton, unit done, superset round done)
- src/lib/plan-share.js: export/import passthrough with the same clamp as restSec
  (plan-share.test.js)
- src/views/Workout.test.jsx: 45 s between ramp sets, 150 s after the last ramp set and
  after work sets

Why: a lifter asked for it after two sessions ("warm-up sets have way too large of a rest
period, it should only be 60-90 seconds max") while wanting 90-150 s on the working sets.
The only lever today is one number per exercise.

Tests: cd frontend && npm test -> 1338 passing (93 files), including the new cases.

Compatibility: additive. Old routines, old plan files and old sessions have no field and
behave exactly as before. The API stores routines as opaque JSON, so nothing server-side
changes. The AI Coach's payload allowlist does not include the field (not needed there).
2026-09-12 08:12:00 -04:00
Duarte Santos 35c810a663 Settings and Library QA: a segmented control that does not fit next to its row title wraps under it instead of painting over it (translated packs at 390px), the today title takes two lines, the Language row shows the whole pack name, swipe-to-delete rows share the card radius (no red corners), Best value does not wrap before its unit, FitNotes' stock bench-press name matches on import 2026-09-12 13:41:13 +02:00
Duarte Santos 33be28b8e6 Workout QA: the per-side set number is a real button again, a unilateral set's volume is each side's weight × reps, timed and cardio sets from older data read as time again, finish summary tiles stay 2×2 in the dialog on desktop, exercise names in menu titles and toasts are capitalised (Kg no longer is) 2026-09-12 13:37:59 +02:00
Duarte Santos c2adb17511 Locales: the seven UI strings that landed with combine routines, the layout switch and the 1RM deload were in no pack (they showed in English in every language); pt-BR guard 635/639 2026-09-12 13:26:59 +02:00
Duarte Santos 477fc07f8b Push: reminders owed within 15 minutes still arrive, the subscription heals itself on every boot, rest-timer alerts belong to the device that started the rest
- reminder tick: a due reminder is sent for up to 15 minutes after its time (once per local
  date) instead of only on the exact minute — a restart across that minute used to lose the day;
  state files are stat'ed and re-read only when they changed
- sendPush prunes 403 (stale VAPID key) like 404/410; optional device targeting
- POST /api/push/subscribe is an upsert that keeps created and stores a deviceId;
  GET /api/push/status says whether the server holds an endpoint
- rest timers keyed per user+device; cancel without a device id keeps the old account-wide
  behaviour
- sw.js: payload parsed inside waitUntil (never a silent push), pushsubscriptionchange
  re-subscribes and registers the new endpoint
- lib/push.js: syncPushSubscription() (called once per signed-in boot from App.jsx and when
  Settings opens) re-registers a lost row, replaces a subscription made against another key,
  pushSupported() is false off https; deviceId() per browser
- Settings: the notifications switch shows what the server holds
- tests: server-reminder (window, dedupe, trained day), server-push-status (upsert, status,
  per-device timers), lib/push.test.js
2026-09-12 13:18:29 +02:00
Duarte Santos c92cfc372a sync: pushes are conditional on the revision this device last saw and a refused push merges both copies (lib/sync-merge.js — no workout, routine or weigh-in is dropped, the newer copy decides settings); the store pulls when the tab, window, app or network comes back, one push and one pull at a time, and nothing pushes before boot has pulled 2026-09-12 13:15:48 +02:00
Duarte Santos d58a98e768 Phone layout: chip strips no longer scroll the page, sheets stop short of the Dynamic Island, tab bar stays at the bottom after the keyboard
- useRevealActiveChip sets the strip's own scrollLeft instead of scrollIntoView, which
  walked every scrollable ancestor and jumped the page when the strip sat above the fold;
  .chips contain overscroll on both axes.
- Every .sheet cap (and .center) carries env(safe-area-inset-top); the dead
  -webkit-overflow-scrolling is gone.
- viewport-guard: with the keyboard down and the page displaced, a text field that kept
  focus (WebKit does not blur on button taps) is blurred and the correction runs; while
  Modals has the body pinned it unpins for one scroll and pins back where it was.
  Modals blurs a page field when a sheet opens; ticking a set blurs the row's input.
- Android: shortEdges cutout mode so --sat is real, adjustResize for the keyboard.
2026-09-12 13:11:17 +02:00
Duarte Santos 413bce5bf8 Merge !119: drag a horizontal chip strip to scroll it on a pointer device (HenryByte, #147) 2026-09-12 13:05:21 +02:00
Duarte Santos 124eda6890 Merge !121: tighten mobile workout bottom scroll (mflova) 2026-09-12 13:05:21 +02:00
Mirko Köster 702a40aac8 i18n: add de-CH as a derived locale 2026-09-11 17:28:03 +02:00
Boris Kurktchiev 8b2fc43c8a frontend: #160 findings 1/2/9/10 — the local copy remembers its owner and is wiped when another profile signs in (open tabs follow), a copy adopted from the server keeps its timestamp, Reset everything says what it deletes and forgets the server-side Coach record, a 413 on sync is shown instead of swallowed 2026-09-11 10:23:13 -04:00
Dror Amsalem 42d5272b0b choose equipment for custom exercises 2026-09-11 16:08:51 +03:00
Dror Amsalem 8ae5cdb060 custom cardio exercises now have a default target muscle and an option add secondary muscles 2026-09-11 16:08:51 +03:00
Dror Amsalem 3f538268e8 fix: how muscles show on library and sheets 2026-09-11 16:08:36 +03:00
Dror Amsalem 9ca4d28d5f fix: hovered body parts clipping in sheets 2026-09-11 16:02:24 +03:00
shailantaniandClaude Sonnet 5 2a369e38bd iOS: adopt UIScene lifecycle for Xcode 26+ / iOS 26+ SDK
Apps built with the iOS 26+ SDK must adopt the UIScene-based app
lifecycle; the AppDelegate-only lifecycle this project's iOS shell
uses is no longer supported and crashes on launch:

  Application failed to launch: UIScene life cycle is required for
  apps built with this SDK.

This adds a SceneDelegate (window/root VC still come from
Main.storyboard, it just forwards deep links / Universal Links to
Capacitor's ApplicationDelegateProxy, since AppDelegate's own
open-url/continue-activity callbacks aren't invoked under the scene
lifecycle), wires AppDelegate's
application(_:configurationForConnecting:) to use it, and adds the
UIApplicationSceneManifest to Info.plist.

No deployment target, bundle id, or signing settings changed — apps
built with older Xcode/SDKs are unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-11 16:50:26 +05:30
Sebastian G 195db73600 fix(workout): preserve per-side data across progression and session flows
- Apply progression targets to each unfinished side
- Convert per-side weights and drops between kg and lb
- Preserve partially completed sets when finishing early
- Calculate volume from each side's actual completed work
- Keep L/R tracking for planned rest-pause sets
- Auto-complete the rated side when logging RIR/RPE
- Add regression tests for these flows

Validation: 1341 frontend tests passed; production build passed.
2026-09-09 16:53:03 +02:00
Dan Sedano 037c214578 fix(ios): raise deployment target to 15.5 2026-09-08 20:31:40 +00:00
Manuel 21049e9328 fix: tighten mobile workout bottom scroll 2026-09-08 19:13:27 +02:00
Sebastian G a257bf2945 test: cover equipment filter surviving a muscle-group switch
Reproduces issue #71 in the exercise picker: pick lower arms + dumbbell,
switch to upper arms, and assert the dumbbell filter stays selected since
both body parts have dumbbell exercises.
2026-09-08 16:03:13 +02:00
Sebastian G 4c21b647bc fix: keep equipment filter when changing muscle group in exercise picker
Selecting a body part after choosing an equipment type reset the
equipment filter to 'all equipment', even when the new muscle group
still had exercises for that equipment. The body-part chips called
setEq('') unconditionally.

Remove those resets from the per-body-part chips in the exercise picker
and the library. The existing eqOn fallback (eqOpts.includes(eq) ? eq : '')
already drops the filter for the current view when the new body part has
nothing under it, without discarding the user's choice. The 'All',
Favourites and Chosen chips still clear it, since they span every body part.

Fixes #71
2026-09-08 15:56:46 +02:00
HenryandClaude Sonnet 5 fc555f57ce Library: drag a horizontal chip strip to scroll it on a pointer device
The body-part and equipment filters in the Library (and the exercise
picker, the muscle explorer) are `.chips` rows that overflow sideways.
On a phone you swipe them; index.css hides the scrollbar. On a desktop
browser there was no way to reach the chips past the right edge — a
mouse wheel scrolls the page, and there's no visible handle.

lib/hchips.js adds a click-drag: press anywhere on a strip and pull it
along, the way a swipe does on a phone. One delegated pointerdown
listener on the document.

- 6px slop before a press becomes a drag, so a click still selects a chip
- the click the browser fires after a drag is swallowed, so releasing
  over a chip doesn't toggle that filter
- mouse only (pointerType 'touch'/'pen' already scroll natively);
  primary button only; non-overflowing rows are left alone
- grab / grabbing cursor as the hint, on rows that actually overflow
  (data-xscroll, set on hover), gated to (hover:hover) and (pointer:fine)

Closes #68

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DBkhHLqWtSYrPdsNE11PiP
2026-09-08 12:27:58 +01:00
HenryandClaude Sonnet 5 8e18e77437 Plan sharing: "Print / Save as PDF" on the mobile app
The printable one-page plan layout (lib/plan-share.js planPrintHTML) was
web-only: printPlan() renders it into a hidden iframe and calls
window.print(), which Android's WebView does not implement.

On mobile the same HTML is handed to the OS print flow via a small
first-party `Print` Capacitor plugin (one method, printHtml), which is
where the user picks "Save as PDF" / "Save to Files" or a real printer.
Web is unchanged.

- Android (PrintPlugin.java): load the HTML into an off-screen WebView and,
  once loaded, drive it through the system PrintManager. A strong ref keeps
  the WebView alive until the job spools. Registered in MainActivity next
  to InstallPlugin.
- iOS (PrintPlugin.swift + .m): UIPrintInteractionController with a
  UIMarkupTextPrintFormatter. Files added to App.xcodeproj.
- lib/mobile.js: printHtml() wrapper (registerPlugin('Print')).
- sheets.jsx: the MOBILE branch of "Print / Save as PDF" calls printHtml;
  the web branch still calls printPlan.

No new dependency — the OS renders the PDF. Native code is not exercised by
the pipeline; run the manual APK job and check on device.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DBkhHLqWtSYrPdsNE11PiP
2026-09-08 11:19:25 +01:00
Duarte Santos bf9764e3a2 Settings: an Updates section as the last thing on the page (check and install on Android, APK link on the web); changelog for the merged MRs
The deload-demo.html page from !103 does not ship: frontend/public/ lands in every dist.
2026-09-07 19:45:19 +02:00