Skip to content

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

Merge remote-tracking branch 'origin/pdf-1015' into v143-integration

Duarte Santos5f3c2ffdaecf
diff --cc .gitignore
index 999161f52,0bd52dadf..12f30f77f
--- a/.gitignore
+++ b/.gitignore
@@@ -34,15 -30,5 +34,17 @@@ frontend/bundle-size.jso
# Local planning notes
docs/superpowers/plans/
+
+# Python and Kotlin build leftovers (scripts/, the Android build)
+__pycache__/
+*.pyc
+.kotlin/
+
+# The maintainer's brand material (logo variants, merch, Buy Me a Coffee covers) sits next to the
+# tracked banner and screenshots but is not part of the repository; keep it out of a `git add -A`
+assets/logo/
+assets/merch/
+assets/tee/
+assets/bmc-cover*
+ # scripts/pdf/render-samples.mjs output (npm run pdf:check)
+ frontend/pdf-samples/
diff --cc frontend/src/lib/pt-br-locale.test.js
index 958323aec,b61563148..798a0f153
--- a/frontend/src/lib/pt-br-locale.test.js
+++ b/frontend/src/lib/pt-br-locale.test.js
@@@ -41,7 -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('dbe033c388a42115ae22e6892b907f2cbec7bd8f7a45de04b8fe308c88779646')
- expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('05bed208d1e2b39089adbf4848905fa78fef3743bafb524a70b2ac528865f634')
++ expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('5cf9c5fb0e76896d795983a043205fcd8a7cf0a8a96d0fa57377df73c645e065')
})
// pt-PT labelled Unpair 'Desfazer': Undo, in Portuguese (it is pt-BR's Undo), on the button that
diff --cc frontend/src/sheets.jsx
index f6b9996a4,f2f42c7ab..53f570dcc
--- a/frontend/src/sheets.jsx
+++ b/frontend/src/sheets.jsx
@@@ -34,10 -34,12 +34,12 @@@ import { exerciseMuscleSnapshot, loadOf
import { parseImport, mergeImport } from './lib/import-csv.js'
import { importHevyData, HevyApiError, HEVY_DEV_SETTINGS, mergeHevyRoutines } from './lib/import-hevy.js'
import { buildPlanBundle, parsePlan, mergePlan, printPlan, planPrintHTML } from './lib/plan-share.js'
+ import { printOptions } from './lib/print-doc.js'
+ import { printWorkout } from './lib/report-print.js'
import { estimate1RM, best1RM, is1RMRecord, REP_CAP, formulaOf, FORMULA_NAMES } from './lib/onerm.js'
import { exerciseHistory } from './lib/exercise-history.js'
-import { isBellEx, dbLoadOf, dbLoadFor, withDbLoad, withMeaning, historyAs, entryDbLoad, currentDbLoad, isOneArm, ownedWeightsFor, dumbbellsOf, ownsDumbbells, withDumbbells, presetWeights, cleanWeights } from './lib/dumbbells.js'
-import { policyFor, defaultIncrement, POLICIES_FOR, POLICY_NAME, POLICY_DESC, MAX_BW_SETS, MAX_TRIPLE_SETS, weightIncrement } from './lib/progression.js'
+import { isBellEx, dbLoadOf, dbLoadFor, withDbLoad, entryDbLoad, currentDbLoad, isOneArm, dumbbellsOf, ownsDumbbells, withDumbbells, presetWeights, cleanWeights } from './lib/dumbbells.js'
+import { policyFor, defaultIncrement, POLICIES_FOR, POLICY_NAME, POLICY_DESC, MAX_BW_SETS, MAX_TRIPLE_SETS } from './lib/progression.js'
import { normalizeRepRange } from './lib/rep-range.js'
import { isBackoff, backoffWeights } from './lib/backoff.js'
import { isPyramid, normalizePyramid, normalizePyramidRest, normalizePyramidWeight, pyramidFromFlat, flatFromPyramid, pyramidLabel, PYRAMID_MAX, MAX_PYRAMID_SETS, PYRAMID_PRESETS } from './lib/pyramid.js'
diff --cc frontend/src/views/History.jsx
index 5d39a6089,dbcff9f8e..005c807e1
--- a/frontend/src/views/History.jsx
+++ b/frontend/src/views/History.jsx
@@@ -28,27 -21,14 +29,28 @@@ export default function History()
const nav = useNavigate()
const S = useStore(s => s.S)
const rows = historyRows(S)
+ const [shown, setShown] = useState(() => Math.max(HISTORY_PAGE, grownTo))
+ const end = useRef(null)
+ const more = rows.length > shown
+ useEffect(() => { grownTo = Math.max(grownTo, shown) }, [shown])
+ useEffect(() => {
+ if (!more) return
+ const IO = typeof window !== 'undefined' ? window.IntersectionObserver : undefined
+ // Without an observer (an old engine) the list is simply whole, as before.
+ if (typeof IO !== 'function') { setShown(Infinity); return }
+ const io = new IO(es => { if (es.some(e => e.isIntersecting)) setShown(n => n + HISTORY_PAGE) }, { rootMargin: '0px 0px 1200px 0px' })
+ if (end.current) io.observe(end.current)
+ return () => io.disconnect()
+ }, [more, shown])
return <>
<div className="hdr"><button className="iconbtn" data-back="/stats" onClick={() => nav('/stats')} aria-label={t('Stats')}><Icon name="chevronLeft" /></button>
- <div style={{ flex: 1, marginInlineStart: 12 }}><h1>{t('History')}</h1><div className="sub">{tn('{0} workout', '{0} workouts', S.workouts.length)}</div></div></div>
+ <div style={{ flex: 1, marginInlineStart: 12 }}><h1>{t('History')}</h1><div className="sub">{tn('{0} workout', '{0} workouts', S.workouts.length)}</div></div>
+ {S.workouts.length > 0 && <button className="iconbtn" onClick={reportSheet} aria-label={t('Performance report')} title={t('Performance report')}><Icon name="note" /></button>}</div>
<Button icon="plus" onClick={logPastWorkoutSheet} style={{ marginBottom: 12 }}>{t('Log a past workout')}</Button>
- {rows.length ? <div className="list">{rows.map(r => r.w
+ {rows.length ? <><div className="list">{(more ? rows.slice(0, shown) : rows).map(r => r.w
? <WorkoutRow key={r.w.id} w={r.w} onClick={() => workoutDetailSheet(r.w)} />
: <DayNoteRow key={'note-' + r.d} iso={r.d} note={r.note} />)}</div>
+ {more && <div ref={end} aria-hidden="true" style={{ height: 1 }} />}</>
: <div className="empty"><div className="ico"><Icon name="history" /></div>{t('No workouts yet. Your first one will land here.')}</div>}
</>
}