Commit b9d2f55
committed
fix(benchmarks-website): preserve visible center on chart scope change
The toolbar slider's `applyScope` always called `visibleRange` which
unconditionally returned the right-anchored window
`[maxIdx - (scope - 1), maxIdx]`. So any scope change while the user
had pan-scrolled to inspect a historical window snapped the chart back
to the most-recent commits — losing whatever they were looking at.
Pass the chart's current `chart.options.scales.x.{min, max}` into
`visibleRange` so it can preserve the visible CENTER when the chart is
already panned away from the right edge. When the chart is at the
right edge or already covers everything, the right-anchor behavior is
preserved — that is still the right default at first load and after
"show all". Pan/zoom callbacks are unchanged: they go through
`rebuildVisibleAndUpdate` directly, not `applyScope`.
Bump `STATIC_ASSET_VERSION` to `bench-v3-ui-17` so cached browsers
pick up the new JS, and refresh the snapshot tests that reference the
versioned asset URLs.
Signed-off-by: Claude <noreply@anthropic.com>1 parent be65b51 commit b9d2f55
5 files changed
Lines changed: 39 additions & 7 deletions
File tree
- benchmarks-website/server
- src
- static
- tests/snapshots
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1165 | 1165 | | |
1166 | 1166 | | |
1167 | 1167 | | |
1168 | | - | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
1169 | 1175 | | |
1170 | 1176 | | |
1171 | 1177 | | |
1172 | 1178 | | |
1173 | 1179 | | |
1174 | | - | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
1175 | 1202 | | |
1176 | 1203 | | |
1177 | 1204 | | |
| |||
1181 | 1208 | | |
1182 | 1209 | | |
1183 | 1210 | | |
1184 | | - | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
1185 | 1217 | | |
1186 | 1218 | | |
1187 | 1219 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
0 commit comments