Skip to content

Commit 6b2e90b

Browse files
Convert "View Mode" to section, adjust CSS so collapse works for all cards and transition is smoother. Remove inconsistent margin between legend and rest.
1 parent f00e637 commit 6b2e90b

File tree

3 files changed

+20
-22
lines changed

3 files changed

+20
-22
lines changed

Lib/profiling/sampling/_flamegraph_assets/flamegraph.css

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,8 @@ body.resizing-sidebar {
275275
}
276276

277277
/* View Mode Section */
278-
.view-mode-section {
279-
padding-bottom: 20px;
280-
border-bottom: 1px solid var(--border);
281-
}
282-
283-
.view-mode-section .section-title {
284-
margin-bottom: 12px;
285-
}
286-
287-
.view-mode-section .toggle-switch {
278+
.view-mode-section .section-content {
279+
display: flex;
288280
justify-content: center;
289281
}
290282

@@ -316,15 +308,17 @@ body.resizing-sidebar {
316308
}
317309

318310
.section-content {
319-
transition: max-height var(--transition-normal), opacity var(--transition-normal);
311+
transition: max-height var(--transition-slow) ease-out, opacity var(--transition-normal) ease-out, padding var(--transition-normal) ease-out;
320312
max-height: 1000px;
321313
opacity: 1;
322314
}
323315

324316
.collapsible.collapsed .section-content {
325317
max-height: 0;
326318
opacity: 0;
327-
margin-bottom: -10px;
319+
padding-top: 0;
320+
pointer-events: none;
321+
transition: max-height var(--transition-slow) ease-in, opacity var(--transition-normal) ease-in, padding var(--transition-normal) ease-in;
328322
}
329323

330324
/* --------------------------------------------------------------------------
@@ -634,10 +628,6 @@ body.resizing-sidebar {
634628
Legend
635629
-------------------------------------------------------------------------- */
636630

637-
.legend-section {
638-
margin-top: auto;
639-
padding-top: 12px;
640-
}
641631

642632
.legend {
643633
display: flex;

Lib/profiling/sampling/_flamegraph_assets/flamegraph_template.html

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,19 @@
102102
</div>
103103

104104
<!-- View Mode Section -->
105-
<section class="sidebar-section view-mode-section">
106-
<h3 class="section-title">View Mode</h3>
107-
<div class="toggle-switch" id="toggle-invert" title="Toggle between standard and inverted flamegraph view" tabindex="0">
108-
<span class="toggle-label active" data-text="Flamegraph">Flamegraph</span>
109-
<div class="toggle-track"></div>
110-
<span class="toggle-label" data-text="Inverted Flamegraph">Inverted Flamegraph</span>
105+
<section class="sidebar-section view-mode-section collapsible" id="view-mode-section">
106+
<button class="section-header" onclick="toggleSection('view-mode-section')">
107+
<h3 class="section-title">View Mode</h3>
108+
<svg class="section-chevron" width="12" height="12" viewBox="0 0 12 12" fill="none">
109+
<path d="M3 4.5L6 7.5L9 4.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
110+
</svg>
111+
</button>
112+
<div class="section-content">
113+
<div class="toggle-switch" id="toggle-invert" title="Toggle between standard and inverted flamegraph view" tabindex="0">
114+
<span class="toggle-label active" data-text="Flamegraph">Flamegraph</span>
115+
<div class="toggle-track"></div>
116+
<span class="toggle-label" data-text="Inverted Flamegraph">Inverted Flamegraph</span>
117+
</div>
111118
</div>
112119
</section>
113120

Lib/profiling/sampling/_shared_assets/base.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
/* Transitions */
3838
--transition-fast: 0.15s ease;
3939
--transition-normal: 0.25s ease;
40+
--transition-slow: 0.3s ease;
4041
}
4142

4243
/* Light theme (default) */

0 commit comments

Comments
 (0)