stats: keep the e1RM chart's points stable, and note where stackedValue stops
Two follow-ups to !24 and !25, both about the same screen. !25 makes LineChart drop its hover whenever `points` changes identity, which is right — a new dataset has different coordinates and the old marker describes nothing. But the e1RM branch built its array inline with .map(), so every render of Stats handed the chart a brand-new array and cleared the tooltip out from under the pointer. Hovering itself only re-renders LineChart, so it survives that; anything else touching this screen did not. Memoising the .map() alone would not have fixed it, because e1rmSeries was itself called fresh on every render, so the memo's own dependency changed identity every time. Both are memoised now, which also stops walking the whole workout history on every render. !24's grid is two columns, label/value and chevron, and does not place .lrow-i. On a row that has an icon it would auto-place and shove the layout around. The one call site has no icon, so this is latent rather than live — written down in the rule so the next person to reach for stackedValue sees the limit first.
This commit is contained in:
1 parent
651b03cbd1
commit
fa879a8b40
2 files changed
+15
-3
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user