Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Commit 0cfe7c2

Browse files
Hide empty entity profile panel when no metrics to display
When an entity has no line count, calls, imports, edges, or file position data, hide the Entity Profile chart panel instead of showing an empty rectangle.
1 parent 919932c commit 0cfe7c2

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

templates/_main.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,16 @@ window.addEventListener("load", function() {
227227

228228
var hasMetrics = metrics.length > 0;
229229
var hasEdges = edgeTypes.length > 0;
230+
var hasFileBar = ep.sl > 0 && ep.el > 0;
231+
232+
if (!hasMetrics && !hasEdges && !hasFileBar) {
233+
var epPanel = epChartEl.closest(".chart-panel, .entity-profile-panel");
234+
if (epPanel) epPanel.style.display = "none";
235+
}
236+
230237
var metricsH = hasMetrics ? metrics.length * 32 + 8 : 0;
231238
var edgesH = hasEdges ? Math.max(edgeTypes.length * 22 + 40, 56) : 0;
232-
var fileBarH = (ep.sl > 0 && ep.el > 0) ? 44 : 0;
239+
var fileBarH = hasFileBar ? 44 : 0;
233240
var totalH = metricsH + edgesH + fileBarH + 4;
234241
if (totalH < 40) totalH = 40;
235242

0 commit comments

Comments
 (0)