diff --git a/frontend/src/components/Media.jsx b/frontend/src/components/Media.jsx
index f18bafb..fb9db2c 100644
--- a/frontend/src/components/Media.jsx
+++ b/frontend/src/components/Media.jsx
@@ -1,11 +1,11 @@
import { useState } from 'react'
import { imgSrc, gifSrc } from '../lib/exercises.js'
-// Big autoplaying animation; tap toggles to the still frame.
-export default function Media({ ex, id }) {
+// Big autoplaying animation; tap toggles to the still frame. `compact` shrinks it (superset cards).
+export default function Media({ ex, id, compact }) {
const [playing, setPlaying] = useState(true)
return (
-
setPlaying(p => !p)}>
+
setPlaying(p => !p)}>
{playing ? '⏸ tap to pause' : '▶ tap to play'}
diff --git a/frontend/src/index.css b/frontend/src/index.css
index ff97fe0..7d2d3e2 100644
--- a/frontend/src/index.css
+++ b/frontend/src/index.css
@@ -306,3 +306,18 @@ h4.sec{font-size:.8rem;text-transform:uppercase;letter-spacing:.08em;color:var(-
.exmedia img{height:400px}
.hm-wrap{display:flex;flex-direction:column;align-items:center}
}
+
+/* ---------- supersets ---------- */
+/* editor: grouped exercises get a left accent + a label */
+.ss-label{font-size:.66rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;
+ color:var(--acc);margin:6px 0 4px 4px;display:flex;align-items:center;gap:5px}
+.item.in-ss{border-left:3px solid var(--acc)}
+.iconbtn.on-ss{background:var(--accT);border-color:var(--acc);color:var(--acc)}
+/* workout: superset card holds both exercises */
+.ss-card{border:1.5px solid var(--acc);border-radius:var(--r);padding:14px;
+ background:color-mix(in srgb, var(--acc) 6%, var(--card))}
+.ss-hd{font-size:.72rem;font-weight:800;letter-spacing:.04em;color:var(--acc);
+ margin-bottom:12px;text-align:center}
+.ss-ex{position:relative}
+.ss-amp{text-align:center;font-size:1.3rem;font-weight:800;color:var(--acc);margin:14px 0 8px}
+.exmedia.compact img{height:190px}
diff --git a/frontend/src/lib/history.js b/frontend/src/lib/history.js
index 329ad61..8404b47 100644
--- a/frontend/src/lib/history.js
+++ b/frontend/src/lib/history.js
@@ -57,6 +57,19 @@ export function setsDoneActive(A) {
}
export const lastBW = S => (S.bodyweight.length ? S.bodyweight[S.bodyweight.length - 1] : null)
+// Group consecutive items sharing a superset id (sg) into "units" of indices.
+// items may be routine exercises ({sg}) or active-workout entries ({sg}).
+export function supersetUnits(items) {
+ const units = []
+ items.forEach((e, i) => {
+ const prev = items[i - 1]
+ if (i > 0 && e.sg && prev && prev.sg && e.sg === prev.sg) units[units.length - 1].push(i)
+ else units.push([i])
+ })
+ return units
+}
+export function unitOf(units, idx) { return units.find(u => u.includes(idx)) || [idx] }
+
export function streakWeeks(S) {
if (!S.workouts.length) return 0
const weeks = new Set(S.workouts.map(w => weekKey(w.d)))
diff --git a/frontend/src/sheets.jsx b/frontend/src/sheets.jsx
index d65016a..a5867eb 100644
--- a/frontend/src/sheets.jsx
+++ b/frontend/src/sheets.jsx
@@ -3,7 +3,7 @@ import { useStore } from './store/useStore.js'
import { useUI } from './store/useUI.js'
import { EXDB, EXIDX, BODYPARTS } from './lib/exercises.js'
import { fmtDate, fmtNum, fmtVol, fmtDur, todayISO, uid, DAYN, MONTHS_LONG, ACCENTS } from './lib/format.js'
-import { lastEntryFor, bestWeightFor, buildSets, effectiveRoutineId, workoutVolume, setsDone, setsDoneActive, lastBW } from './lib/history.js'
+import { lastEntryFor, bestWeightFor, buildSets, effectiveRoutineId, workoutVolume, setsDone, setsDoneActive, lastBW, supersetUnits, unitOf } from './lib/history.js'
import { beep, vibrate } from './lib/sound.js'
import { nav } from './lib/nav.js'
import Media, { Thumb } from './components/Media.jsx'
@@ -145,25 +145,40 @@ function AddToRoutine({ ex, close }) {
export const addToRoutineSheet = ex => ui().openSheet(close => )
/* ============================ exercise picker ============================ */
+// Exercises already used in your routines or past workouts (for the "Chosen" filter + a marker).
+function usageMap(st) {
+ const u = {}
+ st.routines.forEach(r => r.ex.forEach(e => { u[e.id] = (u[e.id] || 0) + 1 }))
+ st.workouts.forEach(w => w.entries.forEach(e => { u[e.id] = (u[e.id] || 0) + 1 }))
+ return u
+}
function ExercisePicker({ onPick, close }) {
+ const st = useStore(s => s.S)
+ const usage = usageMap(st)
const [q, setQ] = useState('')
- const [bp, setBp] = useState('')
+ const [bp, setBp] = useState('') // '' = all, '★' = chosen, else a body part
const [shown, setShown] = useState(50)
const ql = q.toLowerCase().trim()
- const f = EXDB.filter(e => (!bp || e.bp === bp) && (!ql || e.n.includes(ql) || e.tg.includes(ql) || e.eq.includes(ql)))
+ let f = EXDB.filter(e =>
+ (bp === '★' ? usage[e.id] : (!bp || e.bp === bp)) &&
+ (!ql || e.n.includes(ql) || e.tg.includes(ql) || e.eq.includes(ql)))
+ if (bp === '★') f = [...f].sort((a, b) => (usage[b.id] - usage[a.id]) || (a.n < b.n ? -1 : 1))
+ const chosenCount = Object.keys(usage).length
return <>
Add exercise
{ setQ(e.target.value); setShown(50) }} />
+ {chosenCount > 0 && }
{BODYPARTS.map(b => )}
- {f.slice(0, shown).map(e =>
{ close(); onPick(e) }}>
-
{e.n}
{(e.tg || e.bp)} · {e.eq}
+
+ {f.slice(0, shown).map(e =>
onPick(e)}>
+
{e.n}
{(e.tg || e.bp)} · {e.eq}
+ {usage[e.id] && ⭐}+
)}
- {f.length === 0 &&
No match 🤷
}
+ {f.length === 0 &&
{bp === '★' ? 'Nothing chosen yet — add exercises and they’ll show up here.' : 'No match 🤷'}
Confirm the weight you worked with — your highest becomes the default next time.
+
Confirm the weight you worked with — your highest becomes the default next time.{!unitDone && unit.length > 1 ? ' Then finish the superset partner.' : ''}