diff --git a/frontend/src/index.css b/frontend/src/index.css index 3259df5..a348459 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -241,7 +241,11 @@ h4.sec{ .lrow-c{color:var(--label);font-size:15px;flex:none;--icon-stroke:2.4} .lrow-k{color:var(--acc);font-size:17px;flex:none;--icon-stroke:2.4} .lrow.danger,.lrow.danger .lrow-t{color:var(--red)} -/* The Stats exercise name gets its own line so long names cannot run into the title. */ +/* The Stats exercise name gets its own line so long names cannot run into the title. + Two columns only — label/value on the left, chevron on the right — so this is for rows + WITHOUT an icon. `.lrow-i` is not placed here; on a row that has one it would auto-place + into the grid and push the layout around. Give it a leading column before using this + anywhere else. */ .lrow.lrow-stack-value{ display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto; } diff --git a/frontend/src/views/Stats.jsx b/frontend/src/views/Stats.jsx index a7de297..3622b7b 100644 --- a/frontend/src/views/Stats.jsx +++ b/frontend/src/views/Stats.jsx @@ -360,7 +360,15 @@ export default function Stats() { } // Estimated 1RM (issue #18) — only reps-mode training produces one, so cardio and timed // work simply have no points and the toggle stays hidden. - const e1Pts = curEx && curMode === 'reps' ? e1rmSeries(S, curEx) : [] + // Both memoised on the same inputs, and it has to start at e1rmSeries: LineChart clears its + // hover whenever `points` changes identity, so a chart array rebuilt on every render made the + // tooltip vanish under your finger the moment anything else on this screen re-rendered. + // Memoising only the .map() would not have helped — its dependency was itself rebuilt each time. + const e1Pts = useMemo( + () => (curEx && curMode === 'reps' ? e1rmSeries(S, curEx) : []), + [S, curEx, curMode], + ) + const e1ChartPts = useMemo(() => e1Pts.map(p => ({ t: p.t, y: p.y, d: p.d })), [e1Pts]) const e1Best = curEx && curMode === 'reps' ? best1RM(S, curEx) : null const showE1 = e1Pts.length > 0 // Effort on this exercise, per session. It rides on the top-set curve as well as having a @@ -426,7 +434,7 @@ export default function Stats() {