Rebase: drop the warm-up half, keep swipe-to-delete on routine rows

The warm-up side of this is gone rather than updated: the active
workout's set-number is now its own menu (drop set / rest-pause burst
/ remove this set) for every set, not just warm-ups, which already
solves the "only removal control is a tiny X squeezed among six tap
targets" problem this was meant to fix — better than a swipe would
have, since the menu is unambiguous and works the same for every set
type. Layering a swipe on top of that now would just be two ways to
do the same easy thing.

The routine-editor half is untouched in substance, only rebased: the
exercise row didn't change shape, so this is the same SwipeToDelete
component and the same reasoning about why it coexists with the
long-press drag-to-reorder that landed since (data-nodrag would
opt every row out of dragging entirely, confirmed by
RoutineEdit.drag.test.jsx — the axis lock already separates a fast
horizontal swipe from a long-press-then-vertical-drag without needing
that).

Full suite passing except the one pre-existing failure unrelated to
this (a coach-device quota test that fails identically on a clean
checkout of main).
This commit is contained in:
Horus Gonzalez committed 2026-09-05 22:22:55 -06:00
1 parent 95654b4f55
commit 2a64c4bd8f
2 files changed
+99 -4

No files matched your search

+8 -4
View File
@@ -12,6 +12,7 @@ import { glyphPicker, exercisePicker, exConfigSheet, confirmSheet } from '../she
import Icon from '../components/Icon.jsx'
import { glyphOf } from '../lib/glyphs.js'
import { Button, Row, SelectRow, Switch } from '../components/ui.jsx'
import SwipeToDelete from '../components/SwipeToDelete.jsx'
import { copyRoutine } from '../lib/routines.js'
import { POLICIES_FOR, POLICY_NAME, POLICY_DESC } from '../lib/progression.js'
import BodyMap from '../components/BodyMap.jsx'
@@ -392,9 +393,12 @@ export default function RoutineEdit() {
className={'routine-drag-row' + (isDragging ? ' is-dragging' : '')}
style={isDragging ? { transform: `translate3d(0, ${reorder.drag.deltaY}px, 0)` } : undefined}>
{unitFirst.has(i) && <div className="ss-label"><Icon name="link" />{t('Superset')}</div>}
<div className={'item' + (inSS.has(i) ? ' in-ss' : '')} onClick={() => {
exConfigSheet(ex, e, cfg => edit(x => { x[i] = { id: x[i].id, sg: x[i].sg, ...cfg } }), () => edit(x => { x.splice(i, 1); cleanupSg(x) }), r)
}}>
<SwipeToDelete className={'item' + (inSS.has(i) ? ' in-ss' : '')}
deleteLabel={t('Remove from routine')}
onDelete={() => edit(x => { x.splice(i, 1); cleanupSg(x) })}
onClick={() => {
exConfigSheet(ex, e, cfg => edit(x => { x[i] = { id: x[i].id, sg: x[i].sg, ...cfg } }), () => edit(x => { x.splice(i, 1); cleanupSg(x) }), r)
}}>
<Thumb ex={ex} />
<div className="grow"><div className="tt capitalize">{exerciseNameFor(ex)}</div><div className="ss">{exLine(e, S.unit)}</div>
{e.note && <div className="small dim" style={{ marginTop: 2 }}>{e.note}</div>}</div>
@@ -406,7 +410,7 @@ export default function RoutineEdit() {
<button className="iconbtn" aria-label={t('Move down')} title={t('Move down')} disabled={unitIndex.get(i) === units.length - 1} style={{ width: 28, height: 24, borderRadius: 7, fontSize: 12 }} onClick={ev => { ev.stopPropagation(); move(i, 1) }}><Icon name="chevronDown" /></button>
</div>
</div>
</div>
</SwipeToDelete>
</div>
})}{reorder.drag && <div className="routine-drop-indicator" data-testid="routine-drop-indicator"
aria-hidden="true" style={{ top: `${reorder.drag.indicatorTop}px` }} />}</div> : <div className="empty"><div className="ico"><Icon name="dumbbell" /></div>{t('No exercises yet — add your first one.')}</div>}