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
React warnings: keys written out instead of spread (AdminCoach steps, Plan loop rows); admin Remove is a real danger button
Duarte Santos729276c912aa
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex b0f0c6eb9..e9167879e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -81,6 +81,8 @@ you leave it alone. Handy for deciding whether those legs are really ready (thantheir settings now offer Cardio, Reps and Time, Cardio still the default (#678).- Add exercise → By muscle has the Favourites chip too, for the muscle you picked (#669).- A weight change too small to show (say 0.03 kg) reads 0 instead of a lonely "-0".+- Admin → AI Coach: the Remove button for the stored key is red now, like every other button+ that deletes something for good.- Focus mode stays on the screen with lots of sets or a long exercise name (#655).- Chart dates under the graph say each day once over a short span, and months get their yearonce a chart covers more than twelve of them (thanks @lodepav).diff --git a/frontend/src/views/AdminCoach.jsx b/frontend/src/views/AdminCoach.jsxindex 05b2f05bc..a7122a695 100644--- a/frontend/src/views/AdminCoach.jsx+++ b/frontend/src/views/AdminCoach.jsx@@ -159,7 +159,7 @@ export default function AdminCoach() {let n = 1let idx = 0const num = () => n++- const stepAt = () => { const i = idx++; return { open: i === (firstTodo === -1 ? -1 : firstTodo), key: i + ':' + (i === firstTodo) } }+ const stepAt = () => { const i = idx++; return { open: i === (firstTodo === -1 ? -1 : firstTodo), stepKey: i + ':' + (i === firstTodo) } }// Off = a quiet, optional feature: one clean pitch and one button, no half-dimmed controls.if (!d.enabled) return <div className="card">@@ -243,7 +243,7 @@ export default function AdminCoach() {{/* The key is encrypted at rest and never shown again, so this is the one action on thecard that cannot be walked back. Every other irreversible action in the app asks first;until 2026-09-22 this one did not. */}- <Button size="sm" danger disabled={busy} onClick={() => confirmSheet({+ <Button size="sm" variant="danger" disabled={busy} onClick={() => confirmSheet({title: 'Remove this credential?',message: 'The Coach stops working for everyone on this instance until a new key is added. The stored key cannot be recovered.',confirmText: 'Remove', danger: true, onConfirm: disconnect,@@ -390,9 +390,10 @@ export default function AdminCoach() {/* ---------------------------------- pieces ---------------------------------- */-function Step({ n, title, hint, done, open, forceOpen, children }) {- // `key` remounts the <details> when the wizard advances, so the next step unfolds itself.- return <details className={'adm-step ' + (done ? 'done' : 'todo')} open={open || forceOpen}>+function Step({ n, title, hint, done, open, forceOpen, stepKey, children }) {+ // `stepKey` remounts the <details> when the wizard advances, so the next step unfolds itself.+ // On the element itself: React wants a key written out, not spread in with the other props.+ return <details key={stepKey} className={'adm-step ' + (done ? 'done' : 'todo')} open={open || forceOpen}><summary><span className="adm-num">{done ? <Icon name="check" /> : n}</span><span className="adm-step-t"><b>{title}</b><span>{hint}</span></span>diff --git a/frontend/src/views/AdminCoach.test.jsx b/frontend/src/views/AdminCoach.test.jsxindex 8cf7ce874..c54af480f 100644--- a/frontend/src/views/AdminCoach.test.jsx+++ b/frontend/src/views/AdminCoach.test.jsx@@ -270,6 +270,14 @@ describe('AdminCoach — removing the stored credential (irreversible: the key iexpect(sent('/api/admin/coach/disconnect')).toHaveLength(before + 1)expect(mocks.toast).toHaveBeenCalledWith('Credential removed')})++ // The button wore `danger` as a bare prop, which Button handed to the DOM as an attribute:+ // no red, and a React warning on every render.+ it('the Remove button itself is red, like every other destructive button', async () => {+ await mount()+ expect(btn('Remove').classList.contains('danger')).toBe(true)+ expect(btn('Remove').hasAttribute('danger')).toBe(false)+ })})describe('AdminCoach — switching provider', () => {diff --git a/frontend/src/views/Plan.jsx b/frontend/src/views/Plan.jsxindex 5a2d3a6ae..f8540b727 100644--- a/frontend/src/views/Plan.jsx+++ b/frontend/src/views/Plan.jsx@@ -346,7 +346,7 @@ function Schedule({ S, update, nav, mode }) {// nothing to copy. The row the reorder measures is the swipe's outer element.const reorderProps = { 'data-reorder-row': '', style: loopReorder.rowStyle(i) }const name = rest ? t('Rest day') : r?.name ?? id- const row = <div {...(swipe ? {} : { key, ...reorderProps })} className={'item rotation-row' + (item?.state === 'done' ? ' is-done' : '') + (rest ? ' is-rest' : '')}>+ const row = <div key={swipe ? undefined : key} {...(swipe ? {} : reorderProps)} className={'item rotation-row' + (item?.state === 'done' ? ' is-done' : '') + (rest ? ' is-rest' : '')}>{editing && <button className="plan-minus" aria-label={t('Remove {0}', name)} title={t('Remove')}onClick={() => takeOut(i)}><Icon name="minus" /></button>}<span className={'plan-order' + (item?.state === 'next' ? ' next' : '')}>{item?.state === 'done' ? <Icon name="check" /> : i + 1}</span>