Merge !72: Exercise picker: the "+" adds now instead of opening the detail sheet

# Conflicts:
#	frontend/src/views/RoutineEdit.jsx
This commit is contained in:
Duarte Santos committed 2026-09-04 16:54:08 +02:00
commit d8130443a9
3 files changed
+29 -6

No files matched your search

+8 -1
View File
@@ -758,7 +758,14 @@ function ExercisePicker({ onPick, close }) {
</div>}
{f.slice(0, shown).map(e => <div key={e.id} className="item" {...tappable(() => onPick(e))}>
<Thumb ex={e} /><div className="grow"><div className="tt capitalize">{exerciseNameFor(e)}</div><div className="ss capitalize">{t(e.tg || e.bp)} · {t(e.eq)}</div></div>
{usage[e.id] && <span className="tag acc"><Icon name="starFill" /></span>}<Icon name="plus" className="chev" />
{usage[e.id] && <span className="tag acc"><Icon name="starFill" /></span>}
{/* A "+" glyph reads as "add this now" — it used to just open the same detail sheet as
tapping the row, so it added nothing until you'd scrolled past the sets/reps config
and found the real button. Now it does what it looks like: adds with the default
config right away. Tapping the row itself still opens the detail/config sheet, for
when you want to set sets/reps before adding. */}
<button className="iconbtn chev" aria-label={t('Add “{0}”', exerciseNameFor(e))} style={{ padding: 8, margin: -8 }}
onClick={ev => { ev.stopPropagation(); onPick(e, true) }}><Icon name="plus" /></button>
</div>)}
{f.length === 0 && bp === '★' && <div className="empty">{t('Nothing chosen yet — add exercises and they’ll show up here.')}</div>}
</div>