diff --git a/Lib/profiling/sampling/_heatmap_assets/heatmap.css b/Lib/profiling/sampling/_heatmap_assets/heatmap.css index ac1c2d460f997a..f90792e0a0eea2 100644 --- a/Lib/profiling/sampling/_heatmap_assets/heatmap.css +++ b/Lib/profiling/sampling/_heatmap_assets/heatmap.css @@ -691,6 +691,15 @@ flex-shrink: 0; } +/* Legend Controls Group - wraps toggles and bytecode button together */ +.legend-controls { + display: flex; + align-items: center; + gap: 20px; + flex-shrink: 0; + margin-left: auto; +} + /* Toggle Switch Styles */ .toggle-switch { display: inline-flex; @@ -726,11 +735,6 @@ cursor: not-allowed; } -/* Push toggles to the right */ -#toggle-color-mode { - margin-left: auto; -} - .toggle-track { position: relative; width: 36px; @@ -1147,6 +1151,15 @@ .stats-summary { grid-template-columns: repeat(2, 1fr); } + + .legend-content { + flex-wrap: wrap; + justify-content: center; + } + + .legend-controls { + margin-left: 0; + } } @media (max-width: 900px) { @@ -1166,6 +1179,7 @@ .legend-content { flex-direction: column; + align-items: center; gap: 12px; } @@ -1173,6 +1187,57 @@ width: 100%; max-width: none; } + + .legend-separator { + width: 80%; + height: 1px; + } + + .legend-controls { + flex-direction: column; + gap: 12px; + } + + .legend-controls .toggle-switch { + justify-content: center; + } + + .legend-controls .toggle-switch .toggle-label:first-child { + width: 70px; + text-align: right; + } + + .legend-controls .toggle-switch .toggle-label:last-child { + width: 90px; + text-align: left; + } + + /* Compact code columns on small screens */ + .header-line-number, + .line-number { + width: 40px; + } + + .header-samples-self, + .header-samples-cumulative, + .line-samples-self, + .line-samples-cumulative { + width: 55px; + font-size: 10px; + } + + /* Adjust padding - headers need vertical, data rows don't */ + .header-line-number, + .header-samples-self, + .header-samples-cumulative { + padding: 8px 4px; + } + + .line-number, + .line-samples-self, + .line-samples-cumulative { + padding: 0 4px; + } } .bytecode-toggle { diff --git a/Lib/profiling/sampling/_heatmap_assets/heatmap_pyfile_template.html b/Lib/profiling/sampling/_heatmap_assets/heatmap_pyfile_template.html index 888bb795c8a1cb..cad0d16ed47685 100644 --- a/Lib/profiling/sampling/_heatmap_assets/heatmap_pyfile_template.html +++ b/Lib/profiling/sampling/_heatmap_assets/heatmap_pyfile_template.html @@ -69,25 +69,27 @@ Hot -
- Self Time -
- Total Time +
+
+ Self Time +
+ Total Time +
+
+ Show All +
+ Hot Only +
+
+ Heat +
+ Specialization +
+ +
-
- Show All -
- Hot Only -
-
- Heat -
- Specialization -
- -