Skip to content

Commit 2fd7976

Browse files
ozgesolidkeyclaude
andcommitted
Replace minimap level bars with full-width heatmap
Individual per-sample level bars are removed. The density strip now fills the full minimap width as a continuous severity heatmap: - 120 segments, each coloured by the count of error/warning/info samples within that zone (density-weighted opacity) - Error zones: red, proportional intensity up to 0.92 - Warning zones: amber, softer intensity up to 0.65 - Info zones: faint blue at 0.14 - Debug/trace: transparent (dark background shows through) Markers (bookmarks, search results, search-config, annotations, current-line) render on top via explicit z-index layering. Viewport indicator sits at z-index 3, above the heatmap (z-index 1). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 83dfcfd commit 2fd7976

2 files changed

Lines changed: 40 additions & 52 deletions

File tree

src/renderer/renderer.ts

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3445,18 +3445,8 @@ function renderMinimap(): void {
34453445
const totalLines = getTotalLines();
34463446
if (totalLines === 0 || minimapData.length === 0) return;
34473447

3448-
const minimapHeight = minimapElement.clientHeight;
3449-
const lineHeight = minimapHeight / minimapData.length;
3450-
3448+
// Per-line bars removed — the heatmap strip is the sole background layer.
34513449
minimapContentElement.innerHTML = '';
3452-
const frag = document.createDocumentFragment();
3453-
for (let i = 0; i < minimapData.length; i++) {
3454-
const line = document.createElement('div');
3455-
line.className = `minimap-line level-${minimapData[i].level || 'default'}`;
3456-
line.style.height = `${Math.max(1, lineHeight)}px`;
3457-
frag.appendChild(line);
3458-
}
3459-
minimapContentElement.appendChild(frag);
34603450

34613451
renderMinimapDensityStrip();
34623452
renderMinimapMarkers();
@@ -3472,28 +3462,37 @@ function renderMinimapDensityStrip(): void {
34723462
logViewerWrapper?.clientHeight ||
34733463
logViewerElement?.clientHeight ||
34743464
400;
3475-
const SEGMENTS = Math.min(60, minimapData.length);
3465+
3466+
const SEGMENTS = Math.min(120, minimapData.length);
34763467
const segSize = minimapData.length / SEGMENTS;
34773468
const segHeight = minimapHeight / SEGMENTS;
34783469
const frag = document.createDocumentFragment();
34793470

34803471
for (let s = 0; s < SEGMENTS; s++) {
34813472
const start = Math.floor(s * segSize);
34823473
const end = Math.min(minimapData.length - 1, Math.floor((s + 1) * segSize) - 1);
3474+
const total = end - start + 1;
34833475

3484-
let worstSev = 0;
3476+
let errorCount = 0, warnCount = 0, infoCount = 0;
34853477
for (let i = start; i <= end; i++) {
34863478
const sev = LEVEL_SEVERITY[minimapData[i].level || ''] ?? 0;
3487-
if (sev > worstSev) worstSev = sev;
3479+
if (sev >= 5) errorCount++;
3480+
else if (sev === 4) warnCount++;
3481+
else if (sev === 3) infoCount++;
34883482
}
34893483

3490-
if (worstSev < 2) continue; // skip trace/default — too noisy
3491-
34923484
let color: string;
3493-
if (worstSev >= 5) color = `rgba(255,55,55,${0.5 + (worstSev - 5) * 0.3})`; // error/fatal
3494-
else if (worstSev === 4) color = 'rgba(255,150,30,0.75)'; // warning
3495-
else if (worstSev === 3) color = 'rgba(80,140,255,0.55)'; // info
3496-
else color = 'rgba(130,130,130,0.3)'; // debug
3485+
if (errorCount > 0) {
3486+
const intensity = Math.min(0.92, 0.4 + (errorCount / total) * 0.52);
3487+
color = `rgba(210,50,50,${intensity})`;
3488+
} else if (warnCount > 0) {
3489+
const intensity = Math.min(0.65, 0.22 + (warnCount / total) * 0.43);
3490+
color = `rgba(200,140,30,${intensity})`;
3491+
} else if (infoCount > 0) {
3492+
color = `rgba(70,130,210,0.14)`;
3493+
} else {
3494+
continue; // debug/trace/default — transparent
3495+
}
34973496

34983497
const el = document.createElement('div');
34993498
el.className = 'minimap-density-strip-seg';

src/renderer/styles.css

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3071,43 +3071,29 @@ body.platform-darwin .titlebar {
30713071
overflow: hidden;
30723072
}
30733073

3074-
/* ── Density strip: left 6px, colour-coded severity overview per zone ─── */
3074+
/* ── Heatmap: full-width continuous severity zones ────────────────────── */
30753075
.minimap-density-strip-seg {
30763076
position: absolute;
30773077
left: 0;
3078-
width: 6px;
3078+
right: 0;
30793079
pointer-events: none;
3080+
z-index: 1;
30803081
}
30813082

3082-
/* ── Level bars: variable width — errors full-width, noise narrow ──────── */
3083-
/* Bar zone: x=8 to x=108 (right=2px). Full zone = 100px. */
3084-
/* Each level's left margin = 8 + 100 × (1 − relative_width). */
3085-
.minimap-line {
3086-
margin-right: 2px;
3087-
border-radius: 0 1px 1px 0;
3088-
}
3089-
.minimap-line.level-fatal,
3090-
.minimap-line.level-error { background-color: var(--error-color); margin-left: 8px; opacity: 1.0; }
3091-
.minimap-line.level-warning,
3092-
.minimap-line.level-warn { background-color: var(--warning-color); margin-left: 62px; opacity: 0.38; }
3093-
.minimap-line.level-info { background-color: var(--info-color); margin-left: 68px; opacity: 0.32; }
3094-
.minimap-line.level-debug { background-color: var(--debug-color); margin-left: 80px; opacity: 0.22; }
3095-
.minimap-line.level-trace { background-color: var(--text-muted); margin-left: 90px; opacity: 0.15; }
3096-
.minimap-line.level-default { background-color: var(--text-muted); margin-left: 98px; opacity: 0.10; }
3097-
30983083
.minimap-viewport {
30993084
position: absolute;
31003085
left: 0;
31013086
right: 0;
3102-
background-color: rgba(255, 255, 255, 0.08);
3103-
border: 1px solid rgba(255, 255, 255, 0.25);
3087+
background-color: rgba(255, 255, 255, 0.07);
3088+
border: 1px solid rgba(255, 255, 255, 0.35);
31043089
border-radius: 2px;
31053090
pointer-events: none;
31063091
min-height: 20px;
3092+
z-index: 3;
31073093
}
31083094
.minimap:hover .minimap-viewport {
3109-
background-color: rgba(255, 255, 255, 0.14);
3110-
border-color: rgba(255, 255, 255, 0.45);
3095+
background-color: rgba(255, 255, 255, 0.12);
3096+
border-color: rgba(255, 255, 255, 0.55);
31113097
}
31123098

31133099
/* Current selected-line crosshair */
@@ -3116,9 +3102,9 @@ body.platform-darwin .titlebar {
31163102
left: 0;
31173103
right: 0;
31183104
height: 2px;
3119-
background-color: rgba(255, 255, 255, 0.75);
3105+
background-color: rgba(255, 255, 255, 0.85);
31203106
pointer-events: none;
3121-
z-index: 10;
3107+
z-index: 8;
31223108
}
31233109

31243110
/* Line-number tooltip */
@@ -3148,20 +3134,22 @@ body.platform-darwin .titlebar {
31483134
/* Bookmark markers */
31493135
.minimap-bookmark {
31503136
position: absolute;
3151-
left: 8px;
3137+
left: 0;
31523138
right: 0;
31533139
height: 3px;
31543140
background-color: var(--accent-color);
3155-
opacity: 0.85;
3141+
opacity: 0.9;
3142+
z-index: 6;
31563143
}
31573144

31583145
/* Search result markers */
31593146
.minimap-search-marker {
31603147
position: absolute;
3161-
left: 8px;
3148+
left: 0;
31623149
right: 0;
31633150
height: 2px;
3164-
background-color: rgba(255, 255, 0, 0.85);
3151+
background-color: rgba(255, 255, 0, 0.9);
3152+
z-index: 5;
31653153
}
31663154

31673155
/* Saved notes range markers */
@@ -3177,18 +3165,19 @@ body.platform-darwin .titlebar {
31773165
/* Search config markers */
31783166
.minimap-sc-marker {
31793167
position: absolute;
3180-
left: 8px;
3168+
left: 0;
31813169
right: 0;
31823170
height: 2px;
3183-
opacity: 0.8;
3171+
z-index: 5;
31843172
}
31853173

31863174
.minimap-annotation-marker {
31873175
position: absolute;
3188-
left: 8px;
3176+
left: 0;
31893177
right: 0;
31903178
height: 2px;
3191-
background-color: rgba(180, 120, 255, 0.85);
3179+
background-color: rgba(180, 120, 255, 0.9);
3180+
z-index: 5;
31923181
}
31933182

31943183
/* ── Lightweight gutter dot (render loop) ─────────────────────────────── */

0 commit comments

Comments
 (0)