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.

Weigh-ins: the full list asks before a past weigh-in is deleted, so a stray tap while scrolling no longer takes one for good

Duarte Santos473238fef617
diff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.js
index 8105e9d34..3b0768435 100644
--- a/frontend/src/locales/ar.js
+++ b/frontend/src/locales/ar.js
@@ -1428,6 +1428,7 @@ export default {
'Weekly average': 'المتوسط الأسبوعي',
'Week of {0}': 'أسبوع {0}',
'Average {0}': 'المتوسط {0}',
+ 'Delete weigh-in?': 'حذف قياس الوزن؟',
'Best set': 'أفضل مجموعة',
'Show last time instead': 'اعرض المرة السابقة بدلًا من ذلك',
'Show your best set instead': 'اعرض أفضل مجموعة لك بدلًا من ذلك',
diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js
index 518934616..693c86d1d 100644
--- a/frontend/src/locales/de.js
+++ b/frontend/src/locales/de.js
@@ -1457,6 +1457,7 @@ export default {
'Weekly average': 'Wochendurchschnitt',
'Week of {0}': 'Woche vom {0}',
'Average {0}': 'Schnitt {0}',
+ 'Delete weigh-in?': 'Wiegung löschen?',
// --- last time or best set under each exercise (#173) ---
'Best set': 'Bester Satz',
'Show last time instead': 'Stattdessen das letzte Mal zeigen',
diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js
index 3a4850100..9811c4abb 100644
--- a/frontend/src/locales/es.js
+++ b/frontend/src/locales/es.js
@@ -1437,6 +1437,7 @@ export default {
'Weekly average': 'Media semanal',
'Week of {0}': 'Semana del {0}',
'Average {0}': 'Media {0}',
+ 'Delete weigh-in?': '¿Eliminar pesaje?',
// --- last time or best set under each exercise (#173) ---
'Best set': 'Mejor serie',
'Show last time instead': 'Mostrar la última vez',
diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js
index a5355df5c..8f1a99ead 100644
--- a/frontend/src/locales/fr.js
+++ b/frontend/src/locales/fr.js
@@ -1437,6 +1437,7 @@ export default {
'Weekly average': 'Moyenne hebdomadaire',
'Week of {0}': 'Semaine du {0}',
'Average {0}': 'Moyenne {0}',
+ 'Delete weigh-in?': 'Supprimer la pesée ?',
// --- last time or best set under each exercise (#173) ---
'Best set': 'Meilleure série',
'Show last time instead': 'Afficher plutôt la dernière fois',
diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js
index 7635fc01a..707768fb6 100644
--- a/frontend/src/locales/hi.js
+++ b/frontend/src/locales/hi.js
@@ -1437,6 +1437,7 @@ export default {
'Weekly average': 'साप्ताहिक औसत',
'Week of {0}': '{0} वाला सप्ताह',
'Average {0}': 'औसत {0}',
+ 'Delete weigh-in?': 'वज़न मापन हटाएँ?',
// --- last time or best set under each exercise (#173) ---
'Best set': 'सर्वश्रेष्ठ सेट',
'Show last time instead': 'इसके बजाय पिछली बार दिखाएँ',
diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.js
index 3e46318b6..6963377fb 100644
--- a/frontend/src/locales/hu.js
+++ b/frontend/src/locales/hu.js
@@ -1440,6 +1440,7 @@ export default {
'Weekly average': 'Heti átlag',
'Week of {0}': 'Hét: {0}',
'Average {0}': 'Átlag {0}',
+ 'Delete weigh-in?': 'Törlöd a mérést?',
// --- last time or best set under each exercise (#173) ---
'Best set': 'Legjobb sorozat',
'Show last time instead': 'Inkább a legutóbbit mutasd',
diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js
index 54b7e1dac..63c5941da 100644
--- a/frontend/src/locales/it.js
+++ b/frontend/src/locales/it.js
@@ -1437,6 +1437,7 @@ export default {
'Weekly average': 'Media settimanale',
'Week of {0}': 'Settimana del {0}',
'Average {0}': 'Media {0}',
+ 'Delete weigh-in?': 'Eliminare la pesata?',
// --- last time or best set under each exercise (#173) ---
'Best set': 'Serie migliore',
'Show last time instead': 'Mostra invece l’ultima volta',
diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js
index dca87aa09..98217dd51 100644
--- a/frontend/src/locales/ko.js
+++ b/frontend/src/locales/ko.js
@@ -1437,6 +1437,7 @@ export default {
'Weekly average': '주간 평균',
'Week of {0}': '{0} 주',
'Average {0}': '평균 {0}',
+ 'Delete weigh-in?': '체중 기록을 삭제할까요?',
// --- last time or best set under each exercise (#173) ---
'Best set': '최고 세트',
'Show last time instead': '대신 지난번 보기',
diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js
index 0ab9e37c1..02a177f07 100644
--- a/frontend/src/locales/pl.js
+++ b/frontend/src/locales/pl.js
@@ -1437,6 +1437,7 @@ export default {
'Weekly average': 'Średnia tygodniowa',
'Week of {0}': 'Tydzień od {0}',
'Average {0}': 'Średnio {0}',
+ 'Delete weigh-in?': 'Usunąć ważenie?',
// --- last time or best set under each exercise (#173) ---
'Best set': 'Najlepsza seria',
'Show last time instead': 'Pokaż zamiast tego ostatni raz',
diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.js
index dd434420e..374ad22c9 100644
--- a/frontend/src/locales/pt-BR.js
+++ b/frontend/src/locales/pt-BR.js
@@ -31,6 +31,7 @@ export const PT_BR_OVERRIDES = {
'Start without weighing in': 'Iniciar sem se pesar',
'Choose a different workout': 'Escolher outro treino',
'Recent weigh-ins': 'Pesagens recentes',
+ 'Delete weigh-in?': 'Excluir pesagem?',
'Enter a valid weight': 'Informe um peso válido',
'Weight saved': 'Peso salvo',
'Your goal is drawn as a line through the weight charts, and gains/losses are colored by whether they move toward it.': 'Sua meta aparece como uma linha nos gráficos de peso, e os ganhos ou perdas mudam de cor conforme você se aproxima dela.',
diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js
index ed88fe92f..441776c95 100644
--- a/frontend/src/locales/pt.js
+++ b/frontend/src/locales/pt.js
@@ -1437,6 +1437,7 @@ export default {
'Weekly average': 'Média semanal',
'Week of {0}': 'Semana de {0}',
'Average {0}': 'Média {0}',
+ 'Delete weigh-in?': 'Eliminar pesagem?',
// --- last time or best set under each exercise (#173) ---
'Best set': 'Melhor série',
'Show last time instead': 'Mostrar antes a última vez',
diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js
index dcdd69ebc..db7603eb6 100644
--- a/frontend/src/locales/ru.js
+++ b/frontend/src/locales/ru.js
@@ -1437,6 +1437,7 @@ export default {
'Weekly average': 'Среднее за неделю',
'Week of {0}': 'Неделя с {0}',
'Average {0}': 'В среднем {0}',
+ 'Delete weigh-in?': 'Удалить взвешивание?',
// --- last time or best set under each exercise (#173) ---
'Best set': 'Лучший подход',
'Show last time instead': 'Показать прошлый раз',
diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.js
index 5d2e03de5..58187b48b 100644
--- a/frontend/src/locales/th.js
+++ b/frontend/src/locales/th.js
@@ -1448,6 +1448,7 @@ export default {
'Weekly average': 'ค่าเฉลี่ยรายสัปดาห์',
'Week of {0}': 'สัปดาห์เริ่ม {0}',
'Average {0}': 'เฉลี่ย {0}',
+ 'Delete weigh-in?': 'ลบบันทึกน้ำหนักนี้?',
// --- last time or best set under each exercise (#173) ---
'Best set': 'เซ็ตที่ดีที่สุด',
'Show last time instead': 'แสดงครั้งก่อนแทน',
diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js
index 1d7ac17b7..931c2d2d5 100644
--- a/frontend/src/locales/tr.js
+++ b/frontend/src/locales/tr.js
@@ -1437,6 +1437,7 @@ export default {
'Weekly average': 'Haftalık ortalama',
'Week of {0}': '{0} haftası',
'Average {0}': 'Ortalama {0}',
+ 'Delete weigh-in?': 'Tartım silinsin mi?',
// --- last time or best set under each exercise (#173) ---
'Best set': 'En iyi set',
'Show last time instead': 'Bunun yerine geçen seferi göster',
diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.js
index 66b85acf1..8ecd737db 100644
--- a/frontend/src/locales/uk.js
+++ b/frontend/src/locales/uk.js
@@ -1372,6 +1372,7 @@ export default {
'Weekly average': 'Середнє за тиждень',
'Week of {0}': 'Тиждень з {0}',
'Average {0}': 'У середньому {0}',
+ 'Delete weigh-in?': 'Видалити зважування?',
'Best set': 'Найкращий підхід',
'Show last time instead': 'Показати минулий раз',
'Show your best set instead': 'Показати твій найкращий підхід',
diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js
index e852b6766..7730f1ebc 100644
--- a/frontend/src/locales/zh.js
+++ b/frontend/src/locales/zh.js
@@ -1437,6 +1437,7 @@ export default {
'Weekly average': '每周平均',
'Week of {0}': '{0} 起的一周',
'Average {0}': '平均 {0}',
+ 'Delete weigh-in?': '删除称重记录?',
// --- last time or best set under each exercise (#173) ---
'Best set': '最佳组',
'Show last time instead': '改为显示上次',
diff --git a/frontend/src/sheets.jsx b/frontend/src/sheets.jsx
index e28925426..6d048a872 100644
--- a/frontend/src/sheets.jsx
+++ b/frontend/src/sheets.jsx
@@ -263,12 +263,19 @@ export function bwSheet(opts = {}) {
}
// One weigh-in with its delete button, in the log sheet's recent three and in the full list.
-function WeighInRow({ b, unit }) {
+// The full list asks first (`confirm`): it is months of history scrolled through on a phone, and a
+// stray tap on one of its trash buttons took a past weigh-in with nothing to bring it back. The log
+// sheet's three are the ones just typed, where taking back a typo in one tap is the point.
+function WeighInRow({ b, unit, confirm = false }) {
const delEntry = () => update(s => { s.bodyweight = s.bodyweight.filter(x => x.d !== b.d) })
+ const ask = () => confirmSheet({
+ title: t('Delete weigh-in?'), message: `${fmtDate(b.d, true)} · ${fmtNum(b.w)} ${unit}`,
+ confirmText: t('Delete'), danger: true, onConfirm: delEntry,
+ })
return <div className="row between" style={{ padding: '9px 2px', borderBottom: '1px solid var(--sep)' }}>
<span className="small muted">{fmtDate(b.d, true)}</span>
<span className="row" style={{ gap: 12 }}><b>{fmtNum(b.w)} {unit}</b>
- <button className="iconbtn" style={{ width: 32, height: 30, borderRadius: 8, fontSize: 15, color: 'var(--red)' }} onClick={delEntry} aria-label="delete"><Icon name="trash" /></button></span>
+ <button className="iconbtn" style={{ width: 32, height: 30, borderRadius: 8, fontSize: 15, color: 'var(--red)' }} onClick={confirm ? ask : delEntry} aria-label="delete"><Icon name="trash" /></button></span>
</div>
}
@@ -307,7 +314,7 @@ function WeighIns() {
<span className="muted" style={{ whiteSpace: 'nowrap' }}>{t('Average {0}', fmtNum(w.avg) + ' ' + st.unit)}</span>
</span>
</div>
- <div className="list" style={{ gap: 0 }}>{w.entries.map(b => <WeighInRow key={b.d} b={b} unit={st.unit} />)}</div>
+ <div className="list" style={{ gap: 0 }}>{w.entries.map(b => <WeighInRow key={b.d} b={b} unit={st.unit} confirm />)}</div>
</div>
})}
</>
diff --git a/frontend/src/sheets.weighin-history.test.jsx b/frontend/src/sheets.weighin-history.test.jsx
index 22b54928d..3b69d98c3 100644
--- a/frontend/src/sheets.weighin-history.test.jsx
+++ b/frontend/src/sheets.weighin-history.test.jsx
@@ -61,14 +61,41 @@ describe('weigh-ins sheet', () => {
expect([...mountTopSheet().querySelectorAll('[data-week]')].map(w => w.dataset.week)).toEqual(['2026-09-13', '2026-09-06', '2026-08-30'])
})
- it('deletes a weigh-in from the list', () => {
+ // The list is months of history scrolled on a phone: a stray tap on a trash button there must
+ // not take a past weigh-in with it, so the list asks first.
+ it('deletes a weigh-in from the list once that is confirmed', () => {
weighInsSheet()
const host = mountTopSheet()
act(() => { host.querySelector('[data-week="2026-08-31"] button[aria-label="delete"]').click() })
+ expect(useStore.getState().S.bodyweight).toHaveLength(5)
+ expect(useUI.getState().sheets).toHaveLength(2)
+ const ask = mountTopSheet()
+ expect(ask.querySelector('h3').textContent).toBe('Delete weigh-in?')
+ expect(ask.textContent).toContain('80 kg')
+ act(() => { button(ask, 'Delete').click() })
expect(useStore.getState().S.bodyweight.map(b => b.d)).toEqual(['2026-09-01', '2026-09-07', '2026-09-09', '2026-09-13'])
expect(host.textContent).toContain('4 weigh-ins')
})
+ it('keeps the weigh-in when the question is cancelled', () => {
+ weighInsSheet()
+ const host = mountTopSheet()
+ act(() => { host.querySelector('[data-week="2026-08-31"] button[aria-label="delete"]').click() })
+ const ask = mountTopSheet()
+ act(() => { button(ask, 'Cancel').click() })
+ expect(useUI.getState().sheets).toHaveLength(1)
+ expect(useStore.getState().S.bodyweight).toHaveLength(5)
+ })
+
+ // The log sheet's recent three are the ones just typed: a typo there still goes in one tap.
+ it('still deletes one of the log sheet\'s recent weigh-ins in one tap', () => {
+ bwSheet()
+ const log = mountTopSheet()
+ act(() => { log.querySelector('button[aria-label="delete"]').click() })
+ expect(useUI.getState().sheets).toHaveLength(1)
+ expect(useStore.getState().S.bodyweight).toHaveLength(4)
+ })
+
it('has an empty state', () => {
install({ bodyweight: [] })
weighInsSheet()