UI fixes found while testing the workout flow
· The rest timer floats above the tab bar, so it covered the set rows underneath it — during a rest, the next set was behind the bar. The page now gets enough bottom padding while a rest runs to scroll clear of it. · "Skip today", sitting right under "Save & start workout", reads like skipping the session rather than the weigh-in. It says "Start without weighing in". · The calendar legend drew "Planned" in blue while planned days have always had a grey dot. · Body weight showed "− 0" when it hadn't moved since the last weigh-in. · In a superset both exercises are on screen at once, so their animations give way: 180px meant scrolling a full screen between two exercises you are meant to alternate.
This commit is contained in:
1 parent
43d5495007
commit
827c0f8505
4 files changed
+17
-5
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { useEffect } from 'react'
|
||||
import { useUI } from '../store/useUI.js'
|
||||
import { t } from '../lib/i18n.js'
|
||||
import { Button } from './ui.jsx'
|
||||
@@ -5,6 +6,12 @@ import { Button } from './ui.jsx'
|
||||
export default function RestTimer() {
|
||||
const timer = useUI(s => s.timer)
|
||||
const { addRest, stopRest } = useUI()
|
||||
// The bar is fixed above the tab bar and floats over whatever is beneath it — during a
|
||||
// rest that was the next set's row. Extra bottom padding lets the page scroll clear.
|
||||
useEffect(() => {
|
||||
document.body.classList.toggle('resting', !!timer)
|
||||
return () => document.body.classList.remove('resting')
|
||||
}, [!!timer])
|
||||
if (!timer) return null
|
||||
const pct = (timer.left / timer.total) * 100
|
||||
const m = Math.floor(timer.left / 60), s = String(timer.left % 60).padStart(2, '0')
|
||||
|
||||
@@ -165,6 +165,8 @@ button,.chip,.tile,.item,.wday,.cal-d,.swatch,.hm-c,.lrow,.seg button,.stp butto
|
||||
padding:calc(var(--sat) + 8px) var(--pad) calc(128px + var(--sab));
|
||||
max-width:560px;margin:0 auto;
|
||||
}
|
||||
/* while the rest timer floats above the tab bar, keep its height scrollable-past */
|
||||
body.resting #app{padding-bottom:calc(206px + var(--sab))}
|
||||
@keyframes viewfade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
|
||||
#app.vfade{animation:viewfade var(--med) var(--ease)}
|
||||
|
||||
@@ -525,7 +527,9 @@ h4.sec{
|
||||
.exmedia .gifhint{right:9px}
|
||||
.exmedia .giftoggle{left:9px}
|
||||
.exmedia .gifhint .icn,.exmedia .giftoggle .icn{font-size:13px}
|
||||
.exmedia.compact img{height:180px}
|
||||
/* superset: both exercises are on screen together, so the animations have to give way —
|
||||
at 180px you had to scroll a full screen between two exercises done back-to-back */
|
||||
.exmedia.compact img{height:120px}
|
||||
.exmedia.mini img{height:84px}
|
||||
|
||||
.sethead{
|
||||
|
||||
@@ -108,7 +108,7 @@ function BwSheet({ required, onDone, close }) {
|
||||
<div style={{ height: 14 }} />
|
||||
<Button variant="primary" onClick={save}>{required ? t('Save & start workout') : t('Save')}</Button>
|
||||
{required && <>
|
||||
<div style={{ height: 8 }} /><Button variant="ghost" className="dim" onClick={() => { close(); onDone && onDone(null) }}>{t('Skip today')}</Button>
|
||||
<div style={{ height: 8 }} /><Button variant="ghost" className="dim" onClick={() => { close(); onDone && onDone(null) }}>{t('Start without weighing in')}</Button>
|
||||
<div style={{ height: 2 }} /><Button variant="ghost" className="dim" icon="reset" onClick={() => { close(); nav('/workout') }}>{t('Choose a different workout')}</Button>
|
||||
</>}
|
||||
{!required && recent.length > 0 && <>
|
||||
@@ -652,7 +652,7 @@ function Calendar({ start, close }) {
|
||||
<div className="cal-grid">{['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'].map(l => <div key={l} className="cal-h">{t(l)}</div>)}{cells}</div>
|
||||
<div className="cal-legend">
|
||||
<span><i style={{ background: 'var(--acc)' }} />{t('Trained')}</span>
|
||||
<span><i style={{ background: 'var(--blue)' }} />{t('Planned')}</span>
|
||||
<span><i style={{ background: 'var(--label-3)' }} />{t('Planned')}</span>
|
||||
<span><i style={{ background: 'var(--orange)' }} />{t('Rescheduled')}</span>
|
||||
</div>
|
||||
<div className="small dim" style={{ textAlign: 'center', marginTop: 10 }}>{t('Tap a trained day for details · tap any other day to plan a session')}</div>
|
||||
|
||||
@@ -97,9 +97,10 @@ export default function Home() {
|
||||
{bw ? <>
|
||||
<div className="row" style={{ gap: 8, alignItems: 'baseline' }}>
|
||||
<div className="big">{fmtNum(bw.w)} <span className="muted" style={{ fontSize: '1rem' }}>{S.unit}</span></div>
|
||||
{delta !== null && (
|
||||
{/* only when it actually moved — an unchanged weight used to read as "− 0" */}
|
||||
{!!delta && (
|
||||
<span className="small row" style={{ gap: 2, fontWeight: 500, color: bwDeltaColor(delta, bw.w) }}>
|
||||
<Icon name={delta > 0 ? 'arrowUp' : delta < 0 ? 'arrowDown' : 'minus'} style={{ fontSize: 12 }} />
|
||||
<Icon name={delta > 0 ? 'arrowUp' : 'arrowDown'} style={{ fontSize: 12 }} />
|
||||
{fmtNum(Math.abs(delta))}
|
||||
</span>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user