From 60df0cf0dd4c4c95fd87f19fc87ddd5738535997 Mon Sep 17 00:00:00 2001 From: Duarte Santos Date: Sun, 30 Aug 2026 20:18:50 +0200 Subject: [PATCH] Touch and scroll polish: chip rows own the horizontal axis, sheets lock an axis before following the finger and close on a flick, the slider drags relative to the knob, steppers repeat on hold, back-navigation restores the scroll position, a dropped row is tappable at once, the picker search stays above the keyboard, tappable rows work from the keyboard, bigger hit areas in the set row --- frontend/src/App.jsx | 31 +++++- frontend/src/components/Heatmap.jsx | 3 +- frontend/src/components/Media.jsx | 4 +- frontend/src/components/Modals.jsx | 79 ++++++++------ frontend/src/components/Modals.test.jsx | 97 ++++++++++++++++- frontend/src/components/ui.jsx | 56 +++++++++- frontend/src/components/ui.test.jsx | 108 +++++++++++++++++++ frontend/src/index.css | 37 +++++-- frontend/src/lib/use-sheet-keyboard.js | 78 ++++++++++++++ frontend/src/lib/use-sheet-keyboard.test.js | 40 +++++++ frontend/src/main.jsx | 3 + frontend/src/sheets.jsx | 58 ++++++---- frontend/src/views/Home.jsx | 7 +- frontend/src/views/Library.jsx | 14 ++- frontend/src/views/Plan.jsx | 5 +- frontend/src/views/RoutineEdit.drag.test.jsx | 30 ++++++ frontend/src/views/RoutineEdit.jsx | 7 +- frontend/src/views/Stats.jsx | 3 +- frontend/src/views/Stats.test.js | 2 +- 19 files changed, 574 insertions(+), 88 deletions(-) create mode 100644 frontend/src/components/ui.test.jsx create mode 100644 frontend/src/lib/use-sheet-keyboard.js create mode 100644 frontend/src/lib/use-sheet-keyboard.test.js diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 84d9d69..b30af2f 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1,5 +1,5 @@ -import { useEffect } from 'react' -import { HashRouter, Routes, Route, Navigate, useNavigate, useLocation } from 'react-router-dom' +import { useEffect, useLayoutEffect, useRef } from 'react' +import { HashRouter, Routes, Route, Navigate, useNavigate, useLocation, useNavigationType } from 'react-router-dom' import { useStore } from './store/useStore.js' import { useUI } from './store/useUI.js' import { bindUI } from './components/ui.jsx' @@ -28,6 +28,9 @@ import Library from './views/Library.jsx' import Settings from './views/Settings.jsx' import Admin from './views/Admin.jsx' +// last known scrollY per route, so back-navigation can put the page where it was +const scrollPositions = new Map() + bindUI(useUI) // lets the shared controls open sheets without importing the store at module scope // theme === 'system' follows the OS/browser preference instead of a fixed choice. @@ -46,6 +49,7 @@ function applyPrefs(theme, accent) { function Shell() { const navigate = useNavigate() const loc = useLocation() + const navType = useNavigationType() const { S, user, ready } = useStore() const isGuest = useStore(s => s.isGuest()) const needsMobileOnboarding = useStore(s => s.needsMobileOnboarding) @@ -64,8 +68,27 @@ function Shell() { }, [S.theme, S.accent]) useEffect(() => { setLang(S.lang || 'en') }, [S.lang]) useEffect(() => { document.documentElement.lang = S.lang || 'en' }, [langV, S.lang]) - // every tab/route change starts at the top of the page - useEffect(() => { window.scrollTo(0, 0) }, [loc.pathname]) + // Forward navigation starts at the top; going back lands where you left off. + // The position is recorded from scroll events rather than read at route + // change, because by then a shorter page may already have clamped it. + const pathRef = useRef(loc.pathname) + useEffect(() => { + const onScroll = () => { + // Modals pins the body while a sheet is open; scrollY is 0 then, not a position. + if (document.body.style.position === 'fixed') return + scrollPositions.set(pathRef.current, window.scrollY) + } + window.addEventListener('scroll', onScroll, { passive: true }) + return () => window.removeEventListener('scroll', onScroll) + }, []) + useLayoutEffect(() => { + pathRef.current = loc.pathname + if (navType !== 'POP') { window.scrollTo(0, 0); return } + const y = scrollPositions.get(loc.pathname) || 0 + // the restored view needs a layout pass before it is tall enough to scroll to y + const frame = window.requestAnimationFrame(() => window.scrollTo(0, y)) + return () => window.cancelAnimationFrame(frame) + }, [loc.pathname, navType]) // bound to the workout, not to the route — checking Stats mid-session keeps the screen on useWakeLock(!!S.active && S.keepAwake !== false) diff --git a/frontend/src/components/Heatmap.jsx b/frontend/src/components/Heatmap.jsx index 16f799d..03c6179 100644 --- a/frontend/src/components/Heatmap.jsx +++ b/frontend/src/components/Heatmap.jsx @@ -1,6 +1,7 @@ import { useEffect, useRef } from 'react' import { fmtVol, isoOf, todayISO, MONTHS } from '../lib/format.js' import { t } from '../lib/i18n.js' +import { tappable } from '../lib/use-sheet-keyboard.js' // GitHub-style activity heatmap, shaded by time trained per day. export default function Heatmap({ S, onDay }) { @@ -38,7 +39,7 @@ export default function Heatmap({ S, onDay }) { const cls = 'hm-c l' + level(a) + (key === todayISO() ? ' today' : '') + (day > today ? ' future' : '') cells.push(
onDay(key) : undefined} />) + {...tappable(a ? () => onDay(key) : undefined)} />) } cols.push(
{cells}
) } diff --git a/frontend/src/components/Media.jsx b/frontend/src/components/Media.jsx index cbada4f..db813f4 100644 --- a/frontend/src/components/Media.jsx +++ b/frontend/src/components/Media.jsx @@ -18,7 +18,7 @@ export default function Media({ ex, id, compact, minimizable }) { const toggleSize = e => { e.stopPropagation(); update(s => { s.gifSize = mini ? 'full' : 'mini' }) } return (
setPlaying(p => !p)}> - {exerciseNameFor(ex)} + {exerciseNameFor(ex)} {minimizable && ( + {unit && {unit}} - +
) if (!label) return inner @@ -136,9 +172,13 @@ export function Stepper({ value, step = 1, onChange, decimal = true, className = // Pointer-driven so the fill, track and thumb are all ours — no ::-webkit-* // pseudo-elements, which is the only way the control looks identical on every // platform and can pick up the accent colour. +export const SLIDER_GRAB_PX = 22 export function Slider({ value, min = 0, max = 100, step = 1, onChange, className = '' }) { const ref = useRef(null) const [drag, setDrag] = useState(false) + // Grabbing the knob drags it relative to where the finger landed; a finger + // is ~22px wide, so a touch that far off still means "the knob", not "jump". + const offset = useRef(0) const pct = Math.min(100, Math.max(0, ((value - min) / (max - min)) * 100)) const posToValue = useCallback(clientX => { @@ -156,7 +196,7 @@ export function Slider({ value, min = 0, max = 100, step = 1, onChange, classNam if (!drag) return const move = e => { e.preventDefault() - onChange(posToValue(e.touches ? e.touches[0].clientX : e.clientX)) + onChange(posToValue((e.touches ? e.touches[0].clientX : e.clientX) - offset.current)) } const up = () => setDrag(false) window.addEventListener('pointermove', move) @@ -186,7 +226,15 @@ export function Slider({ value, min = 0, max = 100, step = 1, onChange, classNam aria-valuenow={value} aria-valuemin={min} aria-valuemax={max} data-nodrag /* keeps the sheet from swipe-dismissing */ onKeyDown={key} - onPointerDown={e => { e.currentTarget.setPointerCapture?.(e.pointerId); setDrag(true); onChange(posToValue(e.clientX)) }} + onPointerDown={e => { + e.currentTarget.setPointerCapture?.(e.pointerId) + const r = e.currentTarget.getBoundingClientRect() + const knobX = r.left + (pct / 100) * r.width + const d = e.clientX - knobX + offset.current = Math.abs(d) <= SLIDER_GRAB_PX ? d : 0 + setDrag(true) + if (!offset.current) onChange(posToValue(e.clientX)) + }} > diff --git a/frontend/src/components/ui.test.jsx b/frontend/src/components/ui.test.jsx new file mode 100644 index 0000000..0c89d86 --- /dev/null +++ b/frontend/src/components/ui.test.jsx @@ -0,0 +1,108 @@ +// @vitest-environment happy-dom +import React, { act } from 'react' +import { createRoot } from 'react-dom/client' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { Slider, Stepper, SLIDER_GRAB_PX } from './ui.jsx' + +globalThis.IS_REACT_ACT_ENVIRONMENT = true + +let host, root +beforeEach(() => { + vi.useFakeTimers() + host = document.createElement('div') + document.body.appendChild(host) + root = createRoot(host) +}) +afterEach(() => { + act(() => root.unmount()) + host.remove() + vi.useRealTimers() +}) + +function pointer(target, type, { x = 0, y = 0, button = 0 } = {}) { + const event = new Event(type, { bubbles: true, cancelable: true }) + for (const [k, v] of Object.entries({ pointerId: 1, pointerType: 'touch', isPrimary: true, button, clientX: x, clientY: y })) { + Object.defineProperty(event, k, { configurable: true, value: v }) + } + act(() => target.dispatchEvent(event)) + return event +} + +describe('Slider', () => { + // 300px track from x=100 to x=400 over 0..300 so 1px == 1 unit + const mountSlider = (value, onChange) => { + act(() => root.render()) + const el = host.querySelector('.sld') + vi.spyOn(el, 'getBoundingClientRect').mockReturnValue({ left: 100, right: 400, width: 300, top: 0, bottom: 20, height: 20, x: 100, y: 0 }) + return el + } + + it('drags relative to the grab point when the touch lands on the knob', () => { + const onChange = vi.fn() + const el = mountSlider(80, onChange) // knob at x=180 + pointer(el, 'pointerdown', { x: 180 + SLIDER_GRAB_PX - 2 }) + expect(onChange).not.toHaveBeenCalled() // grabbing must not jump + pointer(window, 'pointermove', { x: 180 + SLIDER_GRAB_PX - 2 + 60 }) + expect(onChange).toHaveBeenLastCalledWith(140) // moved by 60, not to the finger + pointer(window, 'pointerup') + }) + + it('still jumps to the touched position away from the knob', () => { + const onChange = vi.fn() + const el = mountSlider(80, onChange) + pointer(el, 'pointerdown', { x: 350 }) + expect(onChange).toHaveBeenLastCalledWith(250) + pointer(window, 'pointermove', { x: 360 }) + expect(onChange).toHaveBeenLastCalledWith(260) + pointer(window, 'pointerup') + }) +}) + +describe('Stepper', () => { + // controlled like every real caller: the parent re-renders with the new value + function Host({ initial, onChange, step }) { + const [v, setV] = React.useState(initial) + return { setV(n); onChange(n) }} /> + } + const mountStepper = (value, onChange, step = 1) => { + act(() => root.render()) + return host.querySelector('button[aria-label="Increase"]') + } + + it('steps once for a short tap (pointerdown, pointerup, click)', () => { + const onChange = vi.fn() + const plus = mountStepper(10, onChange) + pointer(plus, 'pointerdown'); pointer(plus, 'pointerup') + act(() => plus.click()) + expect(onChange).toHaveBeenCalledTimes(1) + expect(onChange).toHaveBeenCalledWith(11) + }) + + it('repeats while held and swallows the trailing click', () => { + let value = 10 + const onChange = vi.fn(v => { value = v }) + const plus = mountStepper(value, onChange) + pointer(plus, 'pointerdown') + act(() => vi.advanceTimersByTime(399)) + expect(onChange).not.toHaveBeenCalled() + // one act per tick: in the browser every interval callback is its own task + act(() => vi.advanceTimersByTime(1 + 80)) + act(() => vi.advanceTimersByTime(80)) + act(() => vi.advanceTimersByTime(80)) + expect(onChange).toHaveBeenCalledTimes(3) + // each repeat builds on the latest value, not the one the hold started with + expect(onChange).toHaveBeenLastCalledWith(13) + pointer(plus, 'pointerup') + act(() => plus.click()) + expect(onChange).toHaveBeenCalledTimes(3) + act(() => vi.advanceTimersByTime(1000)) + expect(onChange).toHaveBeenCalledTimes(3) // nothing keeps ticking after release + }) + + it('keeps working from the keyboard (click without a pointer)', () => { + const onChange = vi.fn() + const plus = mountStepper(10, onChange) + act(() => plus.click()) + expect(onChange).toHaveBeenCalledWith(11) + }) +}) diff --git a/frontend/src/index.css b/frontend/src/index.css index e3971ae..ca0528e 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -183,6 +183,13 @@ body.resting #app{padding-bottom:calc(250px + var(--sab))} transition:background var(--fast),transform var(--fast); } .iconbtn:active{background:var(--surface-2);transform:scale(.92)} +/* invisible hit-area extension: these look right at their size but fall short of a + finger-sized target, so the pseudo element widens what the tap lands on without + changing the painted box. Segmented buttons sit flush against each other, so they + only grow vertically or the neighbour would steal the edge of the tap. */ +.iconbtn,.chip,.seg button,.helpbtn{position:relative} +.iconbtn::before,.chip::before,.seg button::before,.helpbtn::before{content:'';position:absolute;inset:-6px} +.seg button::before{inset:-6px 0} .iconbtn.on-ss{background:var(--acc-soft);color:var(--acc)} .iconbtn:disabled{opacity:.32} @@ -392,6 +399,9 @@ h4.sec{ background:var(--acc);transform:translateY(-50%);pointer-events:none;z-index:3; } .thumb{width:50px;height:50px;border-radius:9px;object-fit:cover;background:#fff;flex:none} +/* exercise pictures are decoration inside tappable rows/cards: no save-image callout on + a long press and no drag ghost when a scroll starts on the picture */ +.thumb,.exmedia img{-webkit-touch-callout:none;-webkit-user-drag:none;user-select:none;-webkit-user-select:none} .thumb-x{ display:flex;align-items:center;justify-content:center;font-size:21px; background:var(--surface-2);color:var(--label-2); @@ -413,6 +423,14 @@ h4.sec{ scrollbar-width:none;-webkit-overflow-scrolling:touch; } .chips::-webkit-scrollbar{display:none} +/* horizontal strips: keep a sideways overscroll from chaining to the page and leave a + margin when a chip is scrolled into view. The chip row also claims the horizontal axis + (touch-action:pan-x): on a phone a slightly diagonal swipe along the chips used to hand + the gesture to the page, which scrolled down instead. The row is 32px tall, so losing a + vertical scroll that happens to start on it costs nothing; the ~130px heatmap wrap keeps + both axes, there the trade-off goes the other way. */ +.chips,.hm-wrap{overscroll-behavior-x:contain;scroll-padding-inline:16px} +.chips{touch-action:pan-x} .chip{ flex:none;padding:6px 13px;border-radius:99px;background:var(--surface); font-size:14px;font-weight:400;color:var(--label);text-transform:capitalize; @@ -533,12 +551,16 @@ h4.sec{ .stp button:active{background:var(--surface-3)} .stp .val{ flex:1;min-width:0;display:flex;align-items:baseline;justify-content:center;gap:3px;padding:0 2px; + align-self:stretch; } .stp .val i{font-style:normal;font-size:12px;color:var(--label-2);flex:none} .stp .num{ width:100%;min-width:0;text-align:center;background:none;border:none;outline:none; font-size:17px;font-weight:500;letter-spacing:-.012em;padding:0; -moz-appearance:textfield;appearance:textfield; + /* the field is the whole height of the stepper, not just its 18px text line, so a tap + anywhere between the two buttons focuses it */ + height:100%;min-height:40px;cursor:text; } .stp .num::-webkit-inner-spin-button{display:none} .stp.invalid{box-shadow:inset 0 0 0 1px var(--red)} @@ -560,12 +582,15 @@ h4.sec{ /* --- checkbox --- */ .chk,.ck{ - width:30px;height:30px;border-radius:50%;flex:none; + width:30px;height:30px;border-radius:50%;flex:none;position:relative; display:flex;align-items:center;justify-content:center; background:none;box-shadow:inset 0 0 0 1.8px var(--label-4);color:transparent; transition:background var(--fast),box-shadow var(--fast),color var(--fast),transform var(--fast); } .chk .icn{font-size:16px;--icon-stroke:2.6} +/* 30px is the right look next to a stepper but a poor target: extend the tap area to 44px + without painting it; the left side stays shorter so the stepper's + button keeps its edge */ +.chk::before,.ck::before{content:'';position:absolute;inset:-7px -7px -7px -4px} .chk.on{background:var(--acc);box-shadow:none;color:var(--on-acc)} .chk:active,.ck:active{transform:scale(.9)} .ck svg{ @@ -621,16 +646,16 @@ h4.sec{ .setrow .stp button{width:32px;height:40px} /* a 3rd stepper (RIR) needs narrower buttons and a tighter row gap to fit next to weight+reps on narrow phones, same technique as the exercise-config sheet's three-steppers-in-a-row - (.cfgrow below) — RIR's own value is short ("1.5") so its buttons shrink the most, weight/reps - just enough to make room since their values ("82.5", "12") need more of what's left. + (.cfgrow below). The buttons stay 28px wide — anything narrower is a miss-prone target — + so the room comes from the smaller glyphs and from the value fields giving up their padding. The header shares the numbers so its labels stay centred over the steppers they name. */ .setrow.eff3,.sethead.eff3{gap:6px} .setrow.eff3 .stp.w,.sethead.eff3 .w-sp{flex:1.2} .setrow.eff3 .stp.r,.sethead.eff3 .r-sp{flex:1} .setrow.eff3 .stp.eff,.sethead.eff3 .eff-sp{flex:.85} -.setrow.eff3 .stp button{width:23px} -.setrow.eff3 .stp.eff button{width:20px} +.setrow.eff3 .stp button{width:28px;font-size:14px} .setrow.eff3 .stp .num{font-size:14px} +.setrow.eff3 .stp .val{padding:0} .setrow.done .n{background:var(--acc);color:var(--on-acc)} .setrow.done{opacity:.45} /* drop-set drops / rest-pause bursts riding on a work row, editable like the row itself @@ -639,7 +664,7 @@ h4.sec{ .subrow .subn{font-size:11px;color:var(--label-3);flex:none;width:46px} .subrow .stp.mini{flex:1;min-width:0} .subrow .stp.mini button{width:26px;height:30px} -.subrow .stp.mini .num{font-size:13px} +.subrow .stp.mini .num{font-size:13px;min-height:30px} .subrow .iconbtn{width:26px;height:26px;font-size:11px;flex:none} .setextra{display:flex;flex-wrap:wrap;gap:6px;margin:2px 0 8px 32px} .setextra .chip.add{display:inline-flex;align-items:center;gap:4px;color:var(--acc)} diff --git a/frontend/src/lib/use-sheet-keyboard.js b/frontend/src/lib/use-sheet-keyboard.js new file mode 100644 index 0000000..fd5753b --- /dev/null +++ b/frontend/src/lib/use-sheet-keyboard.js @@ -0,0 +1,78 @@ +import { useCallback, useEffect } from 'react' + +/* Keyboard-aware sheets. When the mobile keyboard comes up the layout viewport keeps its + size, only the visual viewport shrinks — so a bottom sheet with a text input near its + foot ends up half under the keys. index.css reads two custom properties on the sheet + (--picker-keyboard-bottom / --picker-visual-height) to lift and cap it. SelectSheet in + components/ui.jsx does exactly this sync inline; the exercise picker, the custom-exercise + form and the note sheets need the same thing, hence this hook. The logic is deliberately + duplicated rather than imported so ui.jsx keeps no public surface for it. + + `inputRef` points at the text input (or textarea) whose closest `.sheet` gets the vars. + `enabled` lets a caller switch the sync off (e.g. a picker without a search box). */ +export function useSheetKeyboard(inputRef, enabled = true) { + const sync = useCallback(() => { + const input = inputRef.current + const sheet = input?.closest?.('.sheet') + const viewport = typeof window !== 'undefined' ? window.visualViewport : null + if (!sheet || !viewport) return + const visualHeight = Math.max(0, viewport.height || window.innerHeight) + const visualBottom = (viewport.offsetTop || 0) + visualHeight + const bottomInset = Math.max(0, window.innerHeight - visualBottom) + sheet.style.setProperty('--picker-keyboard-bottom', `${bottomInset}px`) + sheet.style.setProperty('--picker-visual-height', `${visualHeight}px`) + }, [inputRef]) + + useEffect(() => { + if (!enabled) return + const viewport = typeof window !== 'undefined' ? window.visualViewport : null + if (!viewport) return + sync() + viewport.addEventListener('resize', sync) + viewport.addEventListener('scroll', sync) + return () => { + viewport.removeEventListener('resize', sync) + viewport.removeEventListener('scroll', sync) + // The sheet element outlives this input when the sheet swaps content, so leave it + // the way we found it rather than pinning a stale keyboard inset on it. + const sheet = inputRef.current?.closest?.('.sheet') + sheet?.style.removeProperty('--picker-keyboard-bottom') + sheet?.style.removeProperty('--picker-visual-height') + } + }, [enabled, sync, inputRef]) + + // Hand back as onFocus so the first measurement happens as the keyboard opens, before + // the visualViewport events land (on iOS they can arrive a frame late). + return sync +} + +/* Chip strips scroll sideways, and a filter set from code ("★ Chosen", a reset) can land the + active chip off-screen. Pull it into view along the strip only — block:'nearest' never moves + the page when the strip is already visible, which is the case for every strip we have. */ +export function useRevealActiveChip(stripRef, active) { + useEffect(() => { + const strip = stripRef.current + const chip = strip?.querySelector?.('.chip.on') + if (!chip || typeof chip.scrollIntoView !== 'function') return + chip.scrollIntoView({ inline: 'nearest', block: 'nearest' }) + }, [stripRef, active]) +} + +/* Props that make a clickable
behave like a button for keyboard and screen-reader + users. Kept as a div because some rows nest a real )}
@@ -666,6 +669,9 @@ function ExercisePicker({ onPick, close }) { const [eq, setEq] = useState('') // '' = any equipment const [showAll, setShowAll] = useState(false) const [shown, setShown] = useState(50) + const searchRef = useRef(null) + const bpStrip = useRef(null), eqStrip = useRef(null) + const onSearchFocus = useSheetKeyboard(searchRef) const all = allExercises(st) const profile = activeProfile(st) let base = all.filter(e => @@ -678,10 +684,14 @@ function ExercisePicker({ onPick, close }) { const eqOn = eqOpts.includes(eq) ? eq : '' const f = eqOn ? eqFiltered.filter(e => e.eq === eqOn) : eqFiltered const chosenCount = Object.keys(usage).length + useRevealActiveChip(bpStrip, bp) + useRevealActiveChip(eqStrip, eqOn) return <>

{t('Add exercise')}

-
- { setQ(e.target.value); setShown(50) }} />
+ {/* .picker-search is what index.css keys the keyboard-aware sheet layout on: the sheet + lifts above the keys and the search stays put while the list scrolls under it. */} +
+ { setQ(e.target.value); setShown(50) }} />
{profile &&
{showAll ? t('Showing all equipment') : t('Showing what you have in "{0}"', profile.name)} @@ -689,21 +699,21 @@ function ExercisePicker({ onPick, close }) { {showAll ? t('Filter by "{0}"', profile.name) : t('Show all equipment')}
} -
1 ? '10px 0 6px' : '10px 0' }}> +
1 ? '10px 0 6px' : '10px 0' }}> {chosenCount > 0 && } {BODYPARTS.map(b => )}
- {eqOpts.length > 1 &&
+ {eqOpts.length > 1 &&
{eqOpts.map(x => )}
}
- {bp !== '★' &&
customExSheet(null, ex => onPick(ex), q.trim())}> + {bp !== '★' &&
customExSheet(null, ex => onPick(ex), q.trim()))}>
{t('Create your own exercise')}
{t('name + body part, no animation')}
} - {f.slice(0, shown).map(e =>
onPick(e)}> + {f.slice(0, shown).map(e =>
onPick(e))}>
{exerciseNameFor(e)}
{t(e.tg || e.bp)} · {t(e.eq)}
{usage[e.id] && }
)} @@ -1226,12 +1236,12 @@ function DayOverride({ iso, close }) {

{fmtDate(iso, true)}

{t('Weekly plan:')} {weeklyR ? weeklyR.name : t('Rest')}{hasOvr && · {t('changed for this day')}}
{t('Sick, missed a day or want a different session? Pick what to train instead.')}
- {st.routines.map(r =>
set(r.id)}> + {st.routines.map(r =>
set(r.id))}>
{r.name}
{exCount(r.ex.length)}
{effId === r.id && }
)} -
set('rest')}>
{t('Rest / skip this day')}
{effId === null && }
- {hasOvr &&
set('')}>
{t('Back to weekly plan')}
} +
set('rest'))}>
{t('Rest / skip this day')}
{effId === null && }
+ {hasOvr &&
set(''))}>
{t('Back to weekly plan')}
}
} @@ -1243,8 +1253,8 @@ function DayAssign({ day, close }) { return <>

{t(DAYN[day])}

-
set('')}>
{t('Rest day')}
{!st.week[day] && }
- {st.routines.map(r =>
set(r.id)}> +
set(''))}>
{t('Rest day')}
{!st.week[day] && }
+ {st.routines.map(r =>
set(r.id))}>
{r.name}
{exCount(r.ex.length)}
{st.week[day] === r.id && }
)} @@ -1255,6 +1265,8 @@ export const dayAssignSheet = day => ui().openSheet(close => s.S) const update = useStore(s => s.update) // The session note is editable here rather than only at the finish sheet: what you want to @@ -1297,9 +1309,9 @@ function WorkoutDetail({ w, close }) {
})}
{t('Session note')}
-