diff --git a/frontend/src/index.css b/frontend/src/index.css index 12a1643..c35aa7d 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -1149,6 +1149,8 @@ body.chips-dragging *{cursor:inherit} border-radius:var(--r-lg);padding:14px 14px 4px; background:var(--surface-2); } +/* scrolled to when the list opens (#224): clear the sticky header above it */ +.wl-unit{scroll-margin-top:calc(var(--sat) + 96px)} .wl-unit.cur{box-shadow:inset 0 0 0 1.5px var(--acc-line)} .wl-hd{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px} @media (max-width:400px){ diff --git a/frontend/src/views/Workout.jsx b/frontend/src/views/Workout.jsx index 8e772d0..89a474b 100644 --- a/frontend/src/views/Workout.jsx +++ b/frontend/src/views/Workout.jsx @@ -578,6 +578,16 @@ function ActiveWorkout() { const el = (setIdx >= 0 && setRefs.current.get(entry)?.get(setIdx)) || exRefs.current.get(entry) if (el && typeof el.scrollIntoView === 'function') el.scrollIntoView({ behavior: 'smooth', block: 'center' }) }, [cur, isSuperset, listMode, A.entries.length]) + // The list opens at the exercise you are on, not at the top of the session (issue #224): you + // switch to it mid-workout to look at what comes before and after. Only on the way in — once + // the list is open, "current" moves because you tick rows in it, and a list that scrolls + // itself under your thumb is worse than one that stays put. + const listRef = useRef(null) + useEffect(() => { + if (!listMode) return + const el = listRef.current?.querySelector('.wl-unit.cur') + if (el && typeof el.scrollIntoView === 'function') el.scrollIntoView({ block: 'start' }) + }, [listMode]) const total = setUnitsTotal(A.entries) const done = setsDoneActive(A) @@ -946,7 +956,7 @@ function ActiveWorkout() { {A.backfill &&