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.

Workout summary: use the width of the phone

Daniel Patrón Gómez2fe658e44dc4
diff --git a/frontend/src/components/Modals.jsx b/frontend/src/components/Modals.jsx
index 666fa9bc9..b734b00ee 100644
--- a/frontend/src/components/Modals.jsx
+++ b/frontend/src/components/Modals.jsx
@@ -130,7 +130,7 @@ function Sheet({ sheet }) {
return (
<div>
<div className="mback" onClick={() => { if (!sheet.locked) close() }} />
- <div className="center">{sheet.render(close)}</div>
+ <div className={'center' + (sheet.wide ? ' wide' : '')}>{sheet.render(close)}</div>
</div>
)
}
diff --git a/frontend/src/index.css b/frontend/src/index.css
index 875f25be3..6eb66341d 100644
--- a/frontend/src/index.css
+++ b/frontend/src/index.css
@@ -1535,6 +1535,8 @@ body.no-tabbar #timer.working{box-shadow:inset 0 var(--hair) 0 var(--acc),0 -10p
animation:pop .28s var(--ease);
}
:root[data-theme="light"] .center{background:#fff}
+/* a dialog with real content in it (the workout summary) takes the width of the phone */
+.center.wide{width:min(94vw,440px);padding:18px}
/* a dialog with a field centres in what the Android 15 keyboard leaves */
:root[data-native-kb] .center{
top:calc((100% - var(--native-kb)) / 2);
@@ -1698,6 +1700,12 @@ body.no-tabbar #timer.working{box-shadow:inset 0 var(--hair) 0 var(--acc),0 -10p
.tile .l .icn{font-size:14px;color:var(--label)}
.tile .v{font-size:26px;font-weight:600;letter-spacing:-.026em;margin-top:5px;line-height:1.1}
.tile.tappable:active{background:var(--surface-2)}
+/* the workout summary: time and volume share the first row, sets get the wider cell of the second
+ because "15 sets · 15 work" does not fit a half */
+.center .tiles.fin{grid-template-columns:repeat(6,1fr)}
+.tiles.fin .tile{grid-column:span 3;min-width:0}
+.tiles.fin .tile.wide{grid-column:span 4}
+.tiles.fin .tile.narrow{grid-column:span 2}
/* --- PR badge --- */
.pr{
@@ -1931,6 +1939,7 @@ button.wl-summary{width:100%;padding:0 0 10px;text-align:start;border-radius:var
#tabbar button.start{margin-top:-26px}
.sheet{left:50%;right:auto;margin-left:-320px;width:640px;border-radius:var(--r-xl) var(--r-xl) 0 0}
.center{width:340px}
+ .center.wide{width:440px}
#timer{left:50%;right:auto;margin-left:-260px;width:520px;bottom:112px}
body.no-tabbar #timer{left:50%;right:auto;bottom:16px;border-radius:var(--r-xl);padding-bottom:10px;box-shadow:0 12px 40px -10px rgba(0,0,0,.5)}
.exmedia img,.exmedia video{height:380px}
diff --git a/frontend/src/sheets.jsx b/frontend/src/sheets.jsx
index be03e49ef..3514d31d0 100644
--- a/frontend/src/sheets.jsx
+++ b/frontend/src/sheets.jsx
@@ -3310,15 +3310,15 @@ function FinishSummary({ w, prs, e1prs = [], close }) {
return <div style={{ textAlign: 'center', padding: '8px 0' }}>
<div style={{ fontSize: 44, display: 'flex', justifyContent: 'center', color: 'var(--acc)' }}><Icon name="trophy" /></div>
<h3 style={{ margin: '8px 0' }}>{t('Workout complete!')}</h3>
- <div className="tiles" style={{ textAlign: 'start' }}>
+ <div className="tiles fin" style={{ textAlign: 'start' }}>
<div className="tile"><div className="l">{t('Duration')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{fmtDur(w.end - w.start)}</div></div>
<div className="tile"><div className="l">{t('Volume')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{fmtVol(w.vol, st.unit)}</div></div>
- <div className="tile"><div className="l">{t('Sets')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{setsWorkCount(setsDone(w), workSetsDone(w))}</div></div>
- <div className="tile"><div className="l">{t('PRs')}</div><div className="v" style={{ fontSize: 20 }}>{prs.length || '–'}</div></div>
+ <div className="tile wide"><div className="l">{t('Sets')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{setsWorkCount(setsDone(w), workSetsDone(w))}</div></div>
+ <div className="tile narrow"><div className="l">{t('PRs')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{prs.length || '–'}</div></div>
</div>
{(prs.length > 0 || e1prs.length > 0) && <div style={{ textAlign: 'start', marginBottom: 12 }}>
- {prs.map(id => <div key={id} className="small accent row" style={{ gap: 5 }}><Icon name="trophy" style={{ fontSize: 13 }} />{t('New PR:')} <span className={exerciseNameClass(EXIDX[id])}>{EXIDX[id] ? exerciseNameFor(EXIDX[id]) : id}</span></div>)}
- {e1prs.map(p => <div key={p.id} className="small accent row" style={{ gap: 5 }}><Icon name="chartLine" style={{ fontSize: 13 }} />{t('Best estimated 1RM:')} <span className={exerciseNameClass(EXIDX[p.id])}>{EXIDX[p.id] ? exerciseNameFor(EXIDX[p.id]) : p.id}</span> · {fmtNum(p.est)} {st.unit}</div>)}
+ {prs.map(id => <div key={id} className="small accent row" style={{ gap: 6, alignItems: 'flex-start' }}><Icon name="trophy" style={{ fontSize: 13, marginTop: 2, flex: 'none' }} /><span>{t('New PR:')} <span className={exerciseNameClass(EXIDX[id])}>{EXIDX[id] ? exerciseNameFor(EXIDX[id]) : id}</span></span></div>)}
+ {e1prs.map(p => <div key={p.id} className="small accent row" style={{ gap: 6, alignItems: 'flex-start' }}><Icon name="chartLine" style={{ fontSize: 13, marginTop: 2, flex: 'none' }} /><span>{t('Best estimated 1RM:')} <span className={exerciseNameClass(EXIDX[p.id])}>{EXIDX[p.id] ? exerciseNameFor(EXIDX[p.id]) : p.id}</span> · {fmtNum(p.est)} {st.unit}</span></div>)}
</div>}
<h4 className="sec" style={{ textAlign: 'start' }}>{t('What you just trained')}</h4>
<BodyMap load={loadOfWorkouts([w])} body={st.body} />
@@ -3418,5 +3418,5 @@ function doFinishWorkout() {
// into s.active, which is gone. What it held is not logged, like any set left unchecked.
useUI.getState().stopWork()
beep(snd(), 880, 0.15); beep(snd(), 1100, 0.15, 0.18); beep(snd(), 1320, 0.3, 0.36)
- ui().openSheet(close => <FinishSummary w={shown} prs={prs} e1prs={e1prs} close={close} />, { kind: 'center', locked: true })
+ ui().openSheet(close => <FinishSummary w={shown} prs={prs} e1prs={e1prs} close={close} />, { kind: 'center', locked: true, wide: true })
}
diff --git a/frontend/src/store/useUI.js b/frontend/src/store/useUI.js
index 8b5cbe3b2..183615393 100644
--- a/frontend/src/store/useUI.js
+++ b/frontend/src/store/useUI.js
@@ -214,7 +214,7 @@ function endTone(enabled, kind) {
}
export const useUI = create((set, get) => ({
- sheets: [], // { id, render:(close)=>JSX, kind:'sheet'|'center', locked }
+ sheets: [], // { id, render:(close)=>JSX, kind:'sheet'|'center', locked, wide }
toastMsg: '',
toastAction: null, // { label, run, id } while the toast offers an action (Undo)
swipeHint: null, // { idx, i, id }: the set row showing the one-time swipe hint (Workout.jsx)
@@ -232,9 +232,9 @@ export const useUI = create((set, get) => ({
set(s => ({ timerFlashId: s.timerFlashId + 1 }))
},
- openSheet(render, { kind = 'sheet', locked = false } = {}) {
+ openSheet(render, { kind = 'sheet', locked = false, wide = false } = {}) {
const id = uid()
- set(s => ({ sheets: [...s.sheets, { id, render, kind, locked }] }))
+ set(s => ({ sheets: [...s.sheets, { id, render, kind, locked, wide }] }))
const close = () => get().closeSheet(id)
return { id, close, lock: v => set(s => ({ sheets: s.sheets.map(x => x.id === id ? { ...x, locked: v } : x) })) }
},