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
Settings > Data: Export as spreadsheet (CSV) sheet with range, workouts and body files (#647)
Duarte Santosc257fa227793
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex a6c16ace1..d9b72dba0 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -43,6 +43,12 @@ per muscle. Settings → Workout → Fine-tuning turns it off.- Push addresses that hide a private IPv4 address inside an IPv6 one are refused like the plainones.+**Export as a spreadsheet** (#647). Settings → Data & backup → Export as spreadsheet (CSV): your+workouts with one row per set (date, workout, exercise, set, weight, reps, RPE or RIR, warm-ups,+drops, supersets, cardio distance and time) and, as a second file, body weight and measurements.+Pick everything or a stretch of days. Opens in Excel or Sheets, makes your coach happy, and openGym+reads it straight back in without losing a set. The importer also learned GymMane's CSV.+**Support openGym.** Settings → About & updates has the coffee jar: Buy Me a Coffee, Ko-fi andGitHub Sponsors, and on the iPhone a straight line to writing an App Store review. No pop-upsasking for anything, promise.diff --git a/frontend/src/components/CsvExportSheet.jsx b/frontend/src/components/CsvExportSheet.jsxnew file mode 100644index 000000000..a5c52e5c4--- /dev/null+++ b/frontend/src/components/CsvExportSheet.jsx@@ -0,0 +1,66 @@+// "Export as spreadsheet (CSV)" (#647): pick a stretch of days, then the workouts (one row per+// set) or body weight and measurements (one row per day) as a CSV file (lib/export-csv.js). The+// phone hands the file to the share sheet, the browser downloads it, the same way the JSON backup goes.+import { useState } from 'react'+import { useStore } from '../store/useStore.js'+import { useUI } from '../store/useUI.js'+import { t, tn } from '../lib/i18n.js'+import { todayISO, fmtDate } from '../lib/format.js'+import { reportRange } from '../lib/report.js'+import { workoutsCSV, bodyCSV, csvCounts } from '../lib/export-csv.js'+import { MOBILE, shareExport } from '../lib/mobile.js'+import { Button, Segmented, Row } from './ui.jsx'++/** Save a text file: the share sheet on the phone (WKWebView can't download a blob), a download on the web. */+export async function saveCSV(text, name) {+ if (MOBILE) { await shareExport(text, name); return }+ const blob = new Blob([text], { type: 'text/csv;charset=utf-8' })+ const a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = name; a.click()+ setTimeout(() => URL.revokeObjectURL(a.href), 60000)+}++export function CsvExportSheet({ close }) {+ const S = useStore(s => s.S)+ const toast = useUI(s => s.toast)+ const today = todayISO()+ const [range, setRange] = useState('all')+ const [from, setFrom] = useState(() => reportRange('4w', { today }).from)+ const [to, setTo] = useState(today)+ // "All" is no range at all, so a first workout from years ago is in without picking a date.+ const r = range === 'all' ? { from: null, to: null } : reportRange(range, { from, to, today })+ const counts = csvCounts(S, r)+ const save = async (kind) => {+ const st = useStore.getState().S+ const text = kind === 'body' ? bodyCSV(st, r) : workoutsCSV(st, r)+ const name = 'opengym-' + (kind === 'body' ? 'body' : 'workouts') + '-' + today + '.csv'+ close()+ try { await saveCSV(text, name); toast?.(t('CSV exported')) } catch (e) { /* share sheet dismissed */ }+ }+ return <>+ <h3>{t('Export as spreadsheet (CSV)')}</h3>+ <div className="muted small" style={{ marginBottom: 12 }}>+ {t('One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.')}+ </div>+ <Segmented value={range} onChange={setRange} options={[+ { value: 'all', label: t('All') },+ { value: '3m', label: t('3 months') },+ { value: '4w', label: t('4 weeks') },+ { value: 'custom', label: t('Custom') },+ ]} />+ {range === 'custom' && <div style={{ marginTop: 10 }}>+ <Row icon="calendar" title={t('From')}>+ <input type="date" className="timef" value={from} max={to || today} onChange={e => setFrom(e.target.value)} /></Row>+ <Row icon="calendar" title={t('To')}>+ <input type="date" className="timef" value={to} min={from} max={today} onChange={e => setTo(e.target.value)} /></Row>+ </div>}+ <div className="small dim" style={{ margin: '10px 2px 14px' }} data-csv-summary>+ {(range === 'all' ? t('All') : r.from === r.to ? fmtDate(r.from, true, true) : fmtDate(r.from, false, true) + ' – ' + fmtDate(r.to, false, true))+ + ' · ' + tn('{0} workout', '{0} workouts', counts.workouts) + ' · ' + tn('{0} set', '{0} sets', counts.sets)}+ </div>+ <Button variant="primary" icon="share" onClick={() => save('workouts')}>{t('Workouts (CSV)')}</Button>+ <div style={{ height: 8 }} />+ <Button icon="share" onClick={() => save('body')}>{t('Body weight & measurements (CSV)')}</Button>+ </>+}++export const csvExportSheet = () => useUI.getState().openSheet(close => <CsvExportSheet close={close} />)diff --git a/frontend/src/components/CsvExportSheet.test.jsx b/frontend/src/components/CsvExportSheet.test.jsxnew file mode 100644index 000000000..ef9aa5928--- /dev/null+++ b/frontend/src/components/CsvExportSheet.test.jsx@@ -0,0 +1,74 @@+// @vitest-environment happy-dom+// "Export as spreadsheet (CSV)" (#647): the range picker says what the file will hold, and each+// button saves its own file through the share sheet on the phone (as the JSON backup does).+import React, { act } from 'react'+import { createRoot } from 'react-dom/client'+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'++globalThis.IS_REACT_ACT_ENVIRONMENT = true++const mocks = vi.hoisted(() => ({ S: null, share: vi.fn(async () => {}), toast: vi.fn() }))+vi.mock('../store/useStore.js', () => {+ const snap = () => ({ S: mocks.S })+ const useStore = selector => (selector ? selector(snap()) : snap())+ useStore.getState = snap+ return { useStore }+})+vi.mock('../store/useUI.js', () => {+ const snap = () => ({ toast: mocks.toast, openSheet: vi.fn() })+ const useUI = selector => (selector ? selector(snap()) : snap())+ useUI.getState = snap+ return { useUI }+})+vi.mock('../lib/mobile.js', () => ({ MOBILE: true, shareExport: (...a) => mocks.share(...a) }))++const { CsvExportSheet } = await import('./CsvExportSheet.jsx')+const { todayISO } = await import('../lib/format.js')++let root, host, close+const iso = n => { const d = new Date(); d.setHours(12); d.setDate(d.getDate() - n); return d.toISOString().slice(0, 10) }+const wk = (id, n) => ({ id, d: iso(n), start: new Date(iso(n) + 'T18:00:00').getTime(), entries: [{ id: '0025', sets: [{ w: 60, r: 5, done: true }, { w: 60, r: 5, done: true }] }] })++beforeEach(() => {+ mocks.share.mockClear(); mocks.toast.mockClear()+ mocks.S = { unit: 'kg', workouts: [wk('a', 2), wk('b', 200)], bodyweight: [{ d: iso(1), w: 80 }] }+ close = vi.fn()+ host = document.createElement('div')+ document.body.appendChild(host)+ root = createRoot(host)+ act(() => root.render(<CsvExportSheet close={close} />))+})+afterEach(() => { act(() => root.unmount()); host.remove() })++const button = text => [...host.querySelectorAll('button')].find(b => b.textContent.trim() === text)+const summary = () => host.querySelector('[data-csv-summary]').textContent+const flush = () => act(async () => { await Promise.resolve() })++describe('CsvExportSheet', () => {+ it('starts on everything and counts workouts and sets', () => {+ expect(button('All').getAttribute('aria-pressed')).toBe('true')+ expect(summary()).toContain('2 workouts')+ expect(summary()).toContain('4 sets')+ act(() => button('4 weeks').click())+ expect(summary()).toContain('1 workout')+ })++ it('shares the workouts file on the phone, named by the day', async () => {+ act(() => button('4 weeks').click())+ act(() => button('Workouts (CSV)').click())+ await flush()+ expect(close).toHaveBeenCalled()+ const [text, name] = mocks.share.mock.calls[0]+ expect(name).toBe('opengym-workouts-' + todayISO() + '.csv')+ expect(text.trim().split('\r\n')).toHaveLength(3)+ expect(mocks.toast).toHaveBeenCalledWith('CSV exported')+ })++ it('shares body weight as its own file', async () => {+ act(() => button('Body weight & measurements (CSV)').click())+ await flush()+ const [text, name] = mocks.share.mock.calls[0]+ expect(name).toBe('opengym-body-' + todayISO() + '.csv')+ expect(text).toContain('weight_kg')+ })+})diff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.jsindex 6126fef59..a59f6ad0d 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('f777373f78708f7a1f91571d27da9e7d1b9c09ca7deed8f0b4f821c55d414228')+ expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('4185c7d255735414e97eaca7abf2de59a7acfb543fd69f84bdc312df75573e1e')})// 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 d2e1d8939..5a8a23bc4 100644--- a/frontend/src/locales/ar.js+++ b/frontend/src/locales/ar.js@@ -521,7 +521,7 @@ export default {'Calves': 'السمانة','Shins': 'عضلات الساق الأمامية','Import from another app': 'استيراد من تطبيق آخر',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes أو Strong أو Hevy، أو وزن الجسم من Apple Health',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes أو Strong أو Hevy أو GymMane أو openGym CSV، أو وزن الجسم من Apple Health','Import from {0}': 'استيراد من {0}','Import history': 'استيراد السجل','Weigh-ins': 'قياسات الوزن',@@ -2598,4 +2598,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'openGym مجاني: بلا إعلانات ولا اشتراكات ولا تتبّع. فنجان قهوة يُبقيه كذلك.','Rate openGym on the App Store': 'قيّم openGym في App Store','Buy me a coffee': 'اشترِ لي قهوة',+ 'Export as spreadsheet (CSV)': 'تصدير كجدول بيانات (CSV)',+ 'Workouts, body weight and measurements': 'التمارين ووزن الجسم والقياسات',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': 'صف لكل مجموعة، لـ Excel أو Sheets أو مدربك أو تطبيق آخر. ويقرأه openGym من جديد أيضًا.',+ 'Workouts (CSV)': 'التمارين (CSV)',+ 'Body weight & measurements (CSV)': 'وزن الجسم والقياسات (CSV)',+ 'CSV exported': 'تم تصدير CSV',}diff --git a/frontend/src/locales/bn.js b/frontend/src/locales/bn.jsindex 3fd5f7cb0..a018e23e9 100644--- a/frontend/src/locales/bn.js+++ b/frontend/src/locales/bn.js@@ -715,7 +715,7 @@ export default {'Shins': 'শিন',// --- import from another app ---'Import from another app': 'অন্য অ্যাপ থেকে ইমপোর্ট করুন',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes, Strong, Hevy, অথবা Apple Health থেকে শরীরের ওজন',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes, Strong, Hevy, GymMane, openGym CSV, অথবা Apple Health থেকে শরীরের ওজন','Import from {0}': '{0} থেকে ইমপোর্ট করুন','Import history': 'ইতিহাস ইমপোর্ট করুন','Weigh-ins': 'ওজন মাপা',@@ -2622,4 +2622,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'openGym বিনামূল্যে: কোনো বিজ্ঞাপন, সাবস্ক্রিপশন বা ট্র্যাকিং নেই। এক কাপ কফি এটাকে এভাবেই রাখে।','Rate openGym on the App Store': 'App Store-এ openGym-কে রেটিং দিন','Buy me a coffee': 'আমাকে একটা কফি কিনে দিন',+ 'Export as spreadsheet (CSV)': 'স্প্রেডশিট হিসেবে এক্সপোর্ট করুন (CSV)',+ 'Workouts, body weight and measurements': 'ওয়ার্কআউট, শরীরের ওজন আর মাপ',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': 'প্রতি সেটে একটি সারি, Excel, Sheets, আপনার কোচ বা অন্য অ্যাপের জন্য। openGym-ও এটা আবার পড়তে পারে।',+ 'Workouts (CSV)': 'ওয়ার্কআউট (CSV)',+ 'Body weight & measurements (CSV)': 'শরীরের ওজন আর মাপ (CSV)',+ 'CSV exported': 'CSV এক্সপোর্ট হয়েছে',}diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.jsindex b2ba2f5fb..49fe57c06 100644--- a/frontend/src/locales/de.js+++ b/frontend/src/locales/de.js@@ -651,7 +651,7 @@ export default {'Shins': 'Schienbein',// --- import from another app ---'Import from another app': 'Aus anderer App importieren',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes, Strong, Hevy oder Körpergewicht aus Apple Health',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes, Strong, Hevy, GymMane, openGym CSV oder Körpergewicht aus Apple Health','Import from {0}': 'Aus {0} importieren','Import history': 'Verlauf importieren','Weigh-ins': 'Wiegungen',@@ -2563,4 +2563,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'openGym ist gratis: keine Werbung, kein Abo, kein Tracking. Ein Kaffee hält das so.','Rate openGym on the App Store': 'openGym im App Store bewerten','Buy me a coffee': 'Spendier mir einen Kaffee',+ 'Export as spreadsheet (CSV)': 'Als Tabelle exportieren (CSV)',+ 'Workouts, body weight and measurements': 'Workouts, Körpergewicht und Maße',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': 'Eine Zeile pro Satz, für Excel, Sheets, deinen Coach oder eine andere App. openGym liest sie auch wieder ein.',+ 'Workouts (CSV)': 'Workouts (CSV)',+ 'Body weight & measurements (CSV)': 'Körpergewicht & Maße (CSV)',+ 'CSV exported': 'CSV exportiert',}diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.jsindex 0c5cb0289..a90e91f18 100644--- a/frontend/src/locales/es.js+++ b/frontend/src/locales/es.js@@ -632,7 +632,7 @@ export default {'Shins': 'Tibiales',// --- import from another app ---'Import from another app': 'Importar de otra app',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes, Strong, Hevy o peso corporal de Apple Health',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes, Strong, Hevy, GymMane, openGym CSV o peso corporal de Apple Health','Import from {0}': 'Importar de {0}','Import history': 'Importar historial','Weigh-ins': 'Pesajes',@@ -2543,4 +2543,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'openGym es gratis: sin anuncios, sin suscripciones, sin rastreo. Un café hace que siga así.','Rate openGym on the App Store': 'Valora openGym en la App Store','Buy me a coffee': 'Invítame a un café',+ 'Export as spreadsheet (CSV)': 'Exportar como hoja de cálculo (CSV)',+ 'Workouts, body weight and measurements': 'Entrenos, peso corporal y medidas',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': 'Una fila por serie, para Excel, Sheets, tu entrenador u otra app. openGym también la vuelve a leer.',+ 'Workouts (CSV)': 'Entrenos (CSV)',+ 'Body weight & measurements (CSV)': 'Peso corporal y medidas (CSV)',+ 'CSV exported': 'CSV exportado',}diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.jsindex 4f4d8dde2..b470a95e8 100644--- a/frontend/src/locales/fr.js+++ b/frontend/src/locales/fr.js@@ -632,7 +632,7 @@ export default {'Shins': 'Tibiaux',// --- import from another app ---'Import from another app': 'Importer depuis une autre app',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes, Strong, Hevy ou le poids depuis Apple Santé',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes, Strong, Hevy, GymMane, openGym CSV ou le poids depuis Apple Santé','Import from {0}': 'Importer depuis {0}','Import history': 'Importer l\'historique','Weigh-ins': 'Pesées',@@ -2543,4 +2543,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'openGym est gratuit : sans pub, sans abonnement, sans pistage. Un café l’aide à le rester.','Rate openGym on the App Store': 'Noter openGym sur l’App Store','Buy me a coffee': 'Offre-moi un café',+ 'Export as spreadsheet (CSV)': 'Exporter en tableur (CSV)',+ 'Workouts, body weight and measurements': 'Séances, poids et mensurations',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': 'Une ligne par série, pour Excel, Sheets, ton coach ou une autre app. openGym sait aussi la relire.',+ 'Workouts (CSV)': 'Séances (CSV)',+ 'Body weight & measurements (CSV)': 'Poids et mensurations (CSV)',+ 'CSV exported': 'CSV exporté',}diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.jsindex d33dfaeda..2a11c2ce3 100644--- a/frontend/src/locales/hi.js+++ b/frontend/src/locales/hi.js@@ -632,7 +632,7 @@ export default {'Shins': 'पिंडली की हड्डी',// --- import from another app ---'Import from another app': 'दूसरे ऐप से आयात करें',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes, Strong, Hevy, या Apple Health से शरीर का वज़न',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes, Strong, Hevy, GymMane, openGym CSV, या Apple Health से शरीर का वज़न','Import from {0}': '{0} से आयात करें','Import history': 'इतिहास आयात करें','Weigh-ins': 'वज़न मापन',@@ -2543,4 +2543,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'openGym मुफ़्त है: न विज्ञापन, न सब्सक्रिप्शन, न ट्रैकिंग। एक कॉफ़ी इसे ऐसा ही बनाए रखती है।','Rate openGym on the App Store': 'App Store पर openGym को रेट करें','Buy me a coffee': 'मुझे एक कॉफ़ी पिलाएँ',+ 'Export as spreadsheet (CSV)': 'स्प्रेडशीट के रूप में एक्सपोर्ट करें (CSV)',+ 'Workouts, body weight and measurements': 'वर्कआउट, शरीर का वज़न और माप',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': 'हर सेट की एक पंक्ति, Excel, Sheets, आपके कोच या किसी दूसरे ऐप के लिए। openGym भी इसे वापस पढ़ लेता है।',+ 'Workouts (CSV)': 'वर्कआउट (CSV)',+ 'Body weight & measurements (CSV)': 'शरीर का वज़न और माप (CSV)',+ 'CSV exported': 'CSV एक्सपोर्ट हो गया',}diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.jsindex 6f64dc200..9890d9493 100644--- a/frontend/src/locales/hu.js+++ b/frontend/src/locales/hu.js@@ -633,7 +633,7 @@ export default {'Shins': 'Sípcsont',// --- import from another app ---'Import from another app': 'Importálás másik appból',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes, Strong, Hevy vagy testsúly az Apple Healthből',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes, Strong, Hevy, GymMane, openGym CSV vagy testsúly az Apple Healthből','Import from {0}': 'Importálás innen: {0}','Import history': 'Előzmények importálása','Weigh-ins': 'Mérések',@@ -2546,4 +2546,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'Az openGym ingyenes: nincs reklám, előfizetés vagy követés. Egy kávé segít, hogy így maradjon.','Rate openGym on the App Store': 'Értékeld az openGymet az App Store-ban','Buy me a coffee': 'Hívj meg egy kávéra',+ 'Export as spreadsheet (CSV)': 'Exportálás táblázatként (CSV)',+ 'Workouts, body weight and measurements': 'Edzések, testsúly és testméretek',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': 'Szériánként egy sor, Excelhez, Sheetshez, az edződnek vagy egy másik appnak. Az openGym is vissza tudja olvasni.',+ 'Workouts (CSV)': 'Edzések (CSV)',+ 'Body weight & measurements (CSV)': 'Testsúly és testméretek (CSV)',+ 'CSV exported': 'CSV exportálva',}diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.jsindex dcd98f124..91f6bf8f8 100644--- a/frontend/src/locales/it.js+++ b/frontend/src/locales/it.js@@ -632,7 +632,7 @@ export default {'Shins': 'Tibiali',// --- import from another app ---'Import from another app': 'Importa da un\'altra app',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes, Strong, Hevy o il peso da Apple Salute',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes, Strong, Hevy, GymMane, openGym CSV o il peso da Apple Salute','Import from {0}': 'Importa da {0}','Import history': 'Importa lo storico','Weigh-ins': 'Pesate',@@ -2543,4 +2543,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'openGym è gratis: niente pubblicità, abbonamenti o tracciamento. Un caffè lo mantiene così.','Rate openGym on the App Store': 'Valuta openGym sull’App Store','Buy me a coffee': 'Offrimi un caffè',+ 'Export as spreadsheet (CSV)': 'Esporta come foglio di calcolo (CSV)',+ 'Workouts, body weight and measurements': 'Allenamenti, peso corporeo e misure',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': 'Una riga per serie, per Excel, Sheets, il tuo coach o un\'altra app. Anche openGym la rilegge.',+ 'Workouts (CSV)': 'Allenamenti (CSV)',+ 'Body weight & measurements (CSV)': 'Peso corporeo e misure (CSV)',+ 'CSV exported': 'CSV esportato',}diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.jsindex a0165e4f3..2fc5e73e5 100644--- a/frontend/src/locales/ko.js+++ b/frontend/src/locales/ko.js@@ -632,7 +632,7 @@ export default {'Shins': '정강이',// --- import from another app ---'Import from another app': '다른 앱에서 가져오기',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes, Strong, Hevy 또는 Apple 건강의 체중',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes, Strong, Hevy, GymMane, openGym CSV 또는 Apple 건강의 체중','Import from {0}': '{0}에서 가져오기','Import history': '기록 가져오기','Weigh-ins': '체중 기록',@@ -2543,4 +2543,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'openGym은 무료예요: 광고도, 구독도, 추적도 없어요. 커피 한 잔이 계속 그렇게 지켜줘요.','Rate openGym on the App Store': 'App Store에서 openGym 평가하기','Buy me a coffee': '커피 한 잔 사주기',+ 'Export as spreadsheet (CSV)': '스프레드시트로 내보내기 (CSV)',+ 'Workouts, body weight and measurements': '운동, 체중, 신체 치수',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': '세트마다 한 줄, Excel, Sheets, 코치나 다른 앱에서 열 수 있어요. openGym도 다시 읽을 수 있어요.',+ 'Workouts (CSV)': '운동 (CSV)',+ 'Body weight & measurements (CSV)': '체중 및 신체 치수 (CSV)',+ 'CSV exported': 'CSV를 내보냈어요',}diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.jsindex fd4be8897..377575f13 100644--- a/frontend/src/locales/pl.js+++ b/frontend/src/locales/pl.js@@ -632,7 +632,7 @@ export default {'Shins': 'Piszczele',// --- import from another app ---'Import from another app': 'Importuj z innej aplikacji',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes, Strong, Hevy albo masa ciała z Apple Health',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes, Strong, Hevy, GymMane, openGym CSV albo masa ciała z Apple Health','Import from {0}': 'Importuj z {0}','Import history': 'Importuj historię','Weigh-ins': 'Ważenia',@@ -2543,4 +2543,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'openGym jest darmowy: bez reklam, subskrypcji i śledzenia. Kawa pomaga, żeby tak zostało.','Rate openGym on the App Store': 'Oceń openGym w App Store','Buy me a coffee': 'Postaw mi kawę',+ 'Export as spreadsheet (CSV)': 'Eksportuj jako arkusz (CSV)',+ 'Workouts, body weight and measurements': 'Treningi, masa ciała i pomiary',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': 'Jeden wiersz na serię, dla Excela, Sheets, trenera albo innej aplikacji. openGym też go wczyta z powrotem.',+ 'Workouts (CSV)': 'Treningi (CSV)',+ 'Body weight & measurements (CSV)': 'Masa ciała i pomiary (CSV)',+ 'CSV exported': 'Wyeksportowano CSV',}diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.jsindex afc59ff71..65f50e756 100644--- a/frontend/src/locales/pt-BR.js+++ b/frontend/src/locales/pt-BR.js@@ -1615,6 +1615,8 @@ export const PT_BR_OVERRIDES = {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'O openGym é grátis: sem anúncios, sem assinaturas, sem rastreamento. Um café ajuda a manter assim.','Buy me a coffee': 'Me pague um café','A tiny body that lights up as you tick sets. Tap it for the details.': 'Um corpinho que acende a cada série marcada. Toque para ver os detalhes.',+ 'Export as spreadsheet (CSV)': 'Exportar como planilha (CSV)',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': 'Uma linha por série, para o Excel, o Sheets, seu treinador ou outro app. O openGym também lê de volta.',}export default { ...pt, ...PT_BR_OVERRIDES }diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.jsindex c5dc10bdb..2cf460131 100644--- a/frontend/src/locales/pt.js+++ b/frontend/src/locales/pt.js@@ -632,7 +632,7 @@ export default {'Shins': 'Tibiais',// --- import from another app ---'Import from another app': 'Importar de outra app',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes, Strong, Hevy, ou o peso da Apple Saúde',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes, Strong, Hevy, GymMane, openGym CSV, ou o peso da Apple Saúde','Import from {0}': 'Importar de {0}','Import history': 'Importar histórico','Weigh-ins': 'Pesagens',@@ -2543,4 +2543,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'O openGym é grátis: sem anúncios, sem subscrições, sem rastreio. Um café ajuda a manter assim.','Rate openGym on the App Store': 'Avaliar o openGym na App Store','Buy me a coffee': 'Paga-me um café',+ 'Export as spreadsheet (CSV)': 'Exportar como folha de cálculo (CSV)',+ 'Workouts, body weight and measurements': 'Treinos, peso corporal e medidas',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': 'Uma linha por série, para o Excel, o Sheets, o teu treinador ou outra app. O openGym também a volta a ler.',+ 'Workouts (CSV)': 'Treinos (CSV)',+ 'Body weight & measurements (CSV)': 'Peso corporal e medidas (CSV)',+ 'CSV exported': 'CSV exportado',}diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.jsindex 7c744ab8c..1e9780e62 100644--- a/frontend/src/locales/ru.js+++ b/frontend/src/locales/ru.js@@ -622,7 +622,7 @@ export default {'Shins': 'Голени',// --- import from another app ---'Import from another app': 'Импорт из другого приложения',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes, Strong, Hevy или вес тела из Apple Health',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes, Strong, Hevy, GymMane, openGym CSV или вес тела из Apple Health','Import from {0}': 'Импорт из {0}','Import history': 'Импорт истории','Weigh-ins': 'Взвешивания',@@ -2547,4 +2547,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'openGym бесплатный: без рекламы, подписок и слежки. Чашка кофе помогает так и оставаться.','Rate openGym on the App Store': 'Оценить openGym в App Store','Buy me a coffee': 'Угостить кофе',+ 'Export as spreadsheet (CSV)': 'Экспорт в таблицу (CSV)',+ 'Workouts, body weight and measurements': 'Тренировки, вес тела и замеры',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': 'Одна строка на подход: для Excel, Sheets, тренера или другого приложения. openGym тоже умеет прочитать её обратно.',+ 'Workouts (CSV)': 'Тренировки (CSV)',+ 'Body weight & measurements (CSV)': 'Вес тела и замеры (CSV)',+ 'CSV exported': 'CSV экспортирован',}diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.jsindex 0d3872847..be5fb8b5c 100644--- a/frontend/src/locales/th.js+++ b/frontend/src/locales/th.js@@ -633,7 +633,7 @@ export default {'Shins': 'หน้าแข้ง',// --- import from another app ---'Import from another app': 'นำเข้าจากแอปอื่น',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes, Strong, Hevy หรือน้ำหนักตัวจาก Apple Health',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes, Strong, Hevy, GymMane, openGym CSV หรือน้ำหนักตัวจาก Apple Health','Import from {0}': 'นำเข้าจาก {0}','Import history': 'นำเข้าประวัติ','Weigh-ins': 'บันทึกน้ำหนัก',@@ -2554,4 +2554,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'openGym ใช้ฟรี: ไม่มีโฆษณา ไม่มีสมาชิกรายเดือน ไม่มีการติดตาม กาแฟสักแก้วช่วยให้เป็นแบบนี้ต่อไป','Rate openGym on the App Store': 'ให้คะแนน openGym ใน App Store','Buy me a coffee': 'เลี้ยงกาแฟสักแก้ว',+ 'Export as spreadsheet (CSV)': 'ส่งออกเป็นสเปรดชีต (CSV)',+ 'Workouts, body weight and measurements': 'การออกกำลังกาย น้ำหนักตัว และสัดส่วน',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': 'หนึ่งแถวต่อเซ็ต สำหรับ Excel, Sheets, โค้ชของคุณ หรือแอปอื่น openGym ก็อ่านกลับได้เหมือนกัน',+ 'Workouts (CSV)': 'การออกกำลังกาย (CSV)',+ 'Body weight & measurements (CSV)': 'น้ำหนักตัวและสัดส่วน (CSV)',+ 'CSV exported': 'ส่งออก CSV แล้ว',}diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.jsindex a69304806..3e85c7e8e 100644--- a/frontend/src/locales/tr.js+++ b/frontend/src/locales/tr.js@@ -632,7 +632,7 @@ export default {'Shins': 'İncik',// --- import from another app ---'Import from another app': 'Başka uygulamadan içe aktar',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes, Strong, Hevy ya da Apple Health’ten vücut ağırlığı',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes, Strong, Hevy, GymMane, openGym CSV ya da Apple Health’ten vücut ağırlığı','Import from {0}': '{0} uygulamasından içe aktar','Import history': 'Geçmişi içe aktar','Weigh-ins': 'Tartımlar',@@ -2543,4 +2543,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'openGym ücretsiz: reklam yok, abonelik yok, takip yok. Bir kahve bunu böyle tutar.','Rate openGym on the App Store': 'openGym\'i App Store\'da değerlendir','Buy me a coffee': 'Bana bir kahve ısmarla',+ 'Export as spreadsheet (CSV)': 'Tablo olarak dışa aktar (CSV)',+ 'Workouts, body weight and measurements': 'Antrenmanlar, vücut ağırlığı ve ölçüler',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': 'Set başına bir satır; Excel, Sheets, koçun ya da başka bir uygulama için. openGym da geri okuyabilir.',+ 'Workouts (CSV)': 'Antrenmanlar (CSV)',+ 'Body weight & measurements (CSV)': 'Vücut ağırlığı ve ölçüler (CSV)',+ 'CSV exported': 'CSV dışa aktarıldı',}diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.jsindex 4cd5a9c2d..801ae4081 100644--- a/frontend/src/locales/uk.js+++ b/frontend/src/locales/uk.js@@ -458,7 +458,7 @@ export default {'Shins': 'Гомілки',// --- import from another app ---'Import from another app': 'Імпорт з іншого застосунку',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes, Strong, Hevy або вага з Apple Health',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes, Strong, Hevy, GymMane, openGym CSV або вага з Apple Health','Import from {0}': 'Імпорт з {0}','Import history': 'Імпорт історії','Weigh-ins': 'Зважування',@@ -2540,4 +2540,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'openGym безкоштовний: без реклами, підписок і стеження. Кава допомагає, щоб так і лишалося.','Rate openGym on the App Store': 'Оцінити openGym в App Store','Buy me a coffee': 'Пригостити кавою',+ 'Export as spreadsheet (CSV)': 'Експорт у таблицю (CSV)',+ 'Workouts, body weight and measurements': 'Тренування, вага тіла й заміри',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': 'Один рядок на підхід: для Excel, Sheets, тренера чи іншого застосунку. openGym теж уміє прочитати його назад.',+ 'Workouts (CSV)': 'Тренування (CSV)',+ 'Body weight & measurements (CSV)': 'Вага тіла й заміри (CSV)',+ 'CSV exported': 'CSV експортовано',}diff --git a/frontend/src/locales/zh-TW.js b/frontend/src/locales/zh-TW.jsindex fd1210dd8..c1bf024bd 100644--- a/frontend/src/locales/zh-TW.js+++ b/frontend/src/locales/zh-TW.js@@ -621,7 +621,7 @@ export default {'Shins': '脛前肌',// --- import from another app ---'Import from another app': '從其他 App 匯入',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes、Strong、Hevy,或 Apple 健康中的體重紀錄',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes、Strong、Hevy、GymMane、openGym CSV,或 Apple 健康中的體重紀錄','Import from {0}': '從 {0} 匯入','Import history': '匯入歷史紀錄','Weigh-ins': '體重紀錄',@@ -2536,4 +2536,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'openGym 免費:沒有廣告、沒有訂閱、沒有追蹤。一杯咖啡讓它保持這樣。','Rate openGym on the App Store': '在 App Store 為 openGym 評分','Buy me a coffee': '請我喝杯咖啡',+ 'Export as spreadsheet (CSV)': '匯出為試算表 (CSV)',+ 'Workouts, body weight and measurements': '訓練、體重和身體圍度',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': '每組一列,可用於 Excel、Sheets、你的教練或其他 App。openGym 也能再讀回來。',+ 'Workouts (CSV)': '訓練 (CSV)',+ 'Body weight & measurements (CSV)': '體重和身體圍度 (CSV)',+ 'CSV exported': 'CSV 已匯出',}diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.jsindex 5ae1a235c..2a6160ed0 100644--- a/frontend/src/locales/zh.js+++ b/frontend/src/locales/zh.js@@ -632,7 +632,7 @@ export default {'Shins': '胫前肌',// --- import from another app ---'Import from another app': '从其他应用导入',- 'FitNotes, Strong, Hevy, or body weight from Apple Health': 'FitNotes、Strong、Hevy,或来自 Apple 健康的体重',+ 'FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health': 'FitNotes、Strong、Hevy、GymMane、openGym CSV,或来自 Apple 健康的体重','Import from {0}': '从 {0} 导入','Import history': '导入历史记录','Weigh-ins': '称重记录',@@ -2543,4 +2543,10 @@ export default {'openGym is free: no ads, no subscriptions, no tracking. A coffee keeps it that way.': 'openGym 免费:没有广告、没有订阅、没有追踪。一杯咖啡让它保持这样。','Rate openGym on the App Store': '在 App Store 为 openGym 评分','Buy me a coffee': '请我喝杯咖啡',+ 'Export as spreadsheet (CSV)': '导出为表格 (CSV)',+ 'Workouts, body weight and measurements': '训练、体重和围度',+ 'One row per set, for Excel, Sheets, your coach or another app. openGym reads it back too.': '每组一行,可用于 Excel、Sheets、你的教练或其他应用。openGym 也能再读回来。',+ 'Workouts (CSV)': '训练 (CSV)',+ 'Body weight & measurements (CSV)': '体重和围度 (CSV)',+ 'CSV exported': 'CSV 已导出',}diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsxindex 3f5ac6246..a08a30008 100644--- a/frontend/src/views/Settings.jsx+++ b/frontend/src/views/Settings.jsx@@ -52,6 +52,7 @@ import { platformNow } from '../lib/platform-now.js'import { pathBefore } from '../lib/nav.js'import WatchSettingsPage from './WatchSettings.jsx'import { reportSheet } from '../components/ReportSheet.jsx'+import { csvExportSheet } from '../components/CsvExportSheet.jsx'import GymReminderPage, { GymEditPage } from './GymReminder.jsx'import { readGymConfig } from '../lib/gym-reminder.js'@@ -847,6 +848,8 @@ export default function Settings({ page = null, find = null, via = null, entryKe<Row icon="share" iconTint="var(--blue)" title={t('Export backup (JSON)')} subtitle={hasMedia ? t('Without photos and videos') : undefined} accessory="chevron" onClick={doExport} />{hasMedia && <Row icon="share" iconTint="var(--blue)" title={t('Export with photos & videos (.zip)')} accessory="chevron" onClick={doExportZip} />}<Row icon="note" iconTint="var(--green)" title={t('Performance report (PDF)')} subtitle={t('Charts, totals and every workout of the last days or weeks.')} accessory="chevron" onClick={reportSheet} />+ {/* One row per set for spreadsheets and other apps (#647); our own importer reads it back. */}+ <Row icon="share" iconTint="var(--green)" title={t('Export as spreadsheet (CSV)')} subtitle={t('Workouts, body weight and measurements')} accessory="chevron" onClick={csvExportSheet} />{/* 14 is AUTO_BACKUP_KEEP in lib/mobile.js, written out because the Settings tests mockthat module wholesale; mobile.autobackup.test.js pins the two together. */}{MOBILE && <Row icon="folder" iconTint="var(--blue)" title={t('Auto-backup on changes')}@@ -860,7 +863,7 @@ export default function Settings({ page = null, find = null, via = null, entryKe<Section title={t('Bring data in')}><Row icon="download" iconTint="var(--teal)" title={t('Import backup')} accessory="chevron" onClick={() => fileRef.current.click()} /><Row icon="download" iconTint="var(--teal)" title={t('Import from another app')}- subtitle={t('FitNotes, Strong, Hevy, or body weight from Apple Health')}+ subtitle={t('FitNotes, Strong, Hevy, GymMane, openGym CSV, or body weight from Apple Health')}accessory="chevron" onClick={() => importRef.current.click()} /><Row icon="key" iconTint="var(--teal)" title={t('Import from Hevy')}subtitle={t('Pull your history with a Hevy Pro API key')}diff --git a/frontend/src/views/settings-pages.js b/frontend/src/views/settings-pages.jsindex b7774560a..7d772f798 100644--- a/frontend/src/views/settings-pages.js+++ b/frontend/src/views/settings-pages.js@@ -127,10 +127,11 @@ export const SEARCH = [{ page: 'data', title: 'Export backup (JSON)', icon: 'share', tint: 'var(--blue)', kw: 'export backup json download save' },{ page: 'data', title: 'Export with photos & videos (.zip)', icon: 'share', tint: 'var(--blue)', kw: 'zip media export backup', when: c => c.hasMedia },{ page: 'data', title: 'Performance report (PDF)', icon: 'note', tint: 'var(--green)', kw: 'pdf print report performance progress summary charts export paper' },+ { page: 'data', title: 'Export as spreadsheet (CSV)', icon: 'share', tint: 'var(--green)', kw: 'csv spreadsheet excel sheets export workouts sets body weight measurements' },{ page: 'data', title: 'Auto-backup on changes', icon: 'folder', tint: 'var(--blue)', kw: 'auto backup automatic', when: c => c.mobile },{ page: 'data', title: 'Backup folder', icon: 'folder', tint: 'var(--blue)', kw: 'auto backup folder location directory', when: c => c.mobile && c.android && c.autoBackup },{ page: 'data', title: 'Import backup', icon: 'download', tint: 'var(--teal)', kw: 'import restore backup json zip' },- { page: 'data', title: 'Import from another app', icon: 'download', tint: 'var(--teal)', kw: 'strong hevy fitnotes apple health csv import' },+ { page: 'data', title: 'Import from another app', icon: 'download', tint: 'var(--teal)', kw: 'strong hevy fitnotes gymmane apple health csv import' },{ page: 'data', title: 'Import from Hevy', icon: 'key', tint: 'var(--teal)', kw: 'hevy api import' },{ page: 'data', title: 'Photos & videos', icon: 'image', tint: 'var(--teal)', kw: 'media storage photos videos upload', when: c => c.hasMedia },{ page: 'data', title: 'Reset everything', icon: 'trash', tint: 'var(--red)', kw: 'delete wipe reset erase' },