Skip to content

Commit 7f6f6c1

Browse files
mattipclaude
andcommitted
comparison: add arrows and pre-fold exe headings
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 3ba0525 commit 7f6f6c1

4 files changed

Lines changed: 22 additions & 6 deletions

File tree

codespeed/static/css/main.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,17 @@ div.about_content { text-align: left; }
235235
#options li { margin-bottom: 0.8em; }
236236
.seriescolor { float: right; margin-top: 2px; height: 13px; width: 14px; }
237237
a.togglefold { font-size: normal; color: #000000; }
238+
a.togglefold::before {
239+
content: '▶';
240+
display: inline-block;
241+
margin-right: 0.3em;
242+
font-size: 0.7em;
243+
transition: transform 0.2s ease;
244+
transform: rotate(90deg);
245+
}
246+
a.togglefold.folded::before {
247+
transform: rotate(0deg);
248+
}
238249
a.checkall, a.uncheckall { font-size: small; color: #AAAAAA; }
239250

240251
p.errormessage { line-height: 10em; margin-bottom: 10em; }

codespeed/static/js/codespeed.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,14 @@ $(function() {
4343

4444
$('.togglefold').each(function() {
4545
var lis = $(this).parent().children("li");
46+
var allUnchecked = lis.find("input[type='checkbox']").filter(':checked').length === 0;
47+
if (allUnchecked) {
48+
lis.hide();
49+
$(this).addClass('folded');
50+
}
4651
$(this).click(function() {
4752
lis.slideToggle();
53+
$(this).toggleClass('folded');
4854
return false;
4955
});
5056
});

codespeed/static/js/comparison.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -409,11 +409,6 @@ function init(defaults) {
409409
});
410410
*/
411411

412-
sel = $("input[name='benchmarks']");
413-
$.each(defaults.benchmarks, function(i, bench) {
414-
sel.filter("[value='" + bench + "']").prop('checked', true);
415-
});
416-
417412
sel = $("input[name='environments']");
418413
$.each(defaults.environments, function(i, env) {
419414
sel.filter("[value='" + env + "']").prop('checked', true);

codespeed/templates/codespeed/comparison.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@
5151
<ul><a href="#" class="togglefold">{{ key }}</a> <a href="#" class="checkall">(All</a>, <a href="#" class="uncheckall">None)</a>
5252
{% for bench in benchlist|dictsort:"name" %}
5353
<li title="{{ bench.description }}">
54-
<input id="benchmark_{{ bench.id }}" type="checkbox" name="benchmarks" value="{{ bench.id }}" />
54+
{% if bench in checkedbenchmarks %}
55+
<input id="benchmark_{{ bench.id }}" type="checkbox" name="benchmarks" value="{{ bench.id }}" checked />
56+
{% else %}
57+
<input id="benchmark_{{ bench.id }}" type="checkbox" name="benchmarks" value="{{ bench.id }}" />
58+
{% endif %}
5559
<label for="benchmark_{{ bench.id }}">{{ bench }}</label>
5660
</li>{% endfor %}
5761
</ul>{% endfor %}

0 commit comments

Comments
 (0)