Skip to content

Commit 42bc9a9

Browse files
committed
Fix minimap with hot only toggle
1 parent 2f9f433 commit 42bc9a9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/profiling/sampling/_heatmap_assets/heatmap.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ function buildScrollMarker() {
177177

178178
if (document.body.scrollHeight <= window.innerHeight) return;
179179

180-
const lines = document.querySelectorAll('.code-line');
180+
const allLines = document.querySelectorAll('.code-line');
181+
const lines = Array.from(allLines).filter(line => line.style.display !== 'none');
181182
const markerScale = window.innerHeight / document.body.scrollHeight;
182183
const lineHeight = Math.min(Math.max(3, window.innerHeight / lines.length), 10);
183184
const maxSamples = Math.max(...Array.from(lines, getSampleCount));
@@ -236,6 +237,7 @@ function toggleColdCode() {
236237
coldCodeHidden = !coldCodeHidden;
237238
applyHotFilter();
238239
updateToggleUI('toggle-cold', coldCodeHidden);
240+
buildScrollMarker();
239241
}
240242

241243
function applyHotFilter() {

0 commit comments

Comments
 (0)