Skip to content

Commit 0d6dba2

Browse files
mattipclaude
andcommitted
make normalization pulldown reflect checked exes, default to horizontal
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 7f6f6c1 commit 0d6dba2

3 files changed

Lines changed: 35 additions & 8 deletions

File tree

codespeed/static/js/comparison.js

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,22 @@ function savedata(data) {
7272
refreshContent();
7373
}
7474

75+
function updateBaselineDropdown() {
76+
var $baseline = $("#baseline");
77+
var current = $baseline.val();
78+
$baseline.find("option:not([value='none'])").remove();
79+
$("input[name='executables']:checked").each(function() {
80+
var key = $(this).val();
81+
var name = $(this).next('label').text().trim();
82+
$baseline.append($('<option>').val(key).text(name));
83+
});
84+
if ($baseline.find("option[value='" + current + "']").length) {
85+
$baseline.val(current);
86+
} else {
87+
$baseline.val('none');
88+
}
89+
}
90+
7591
function loadData() {
7692
var conf = getConfiguration();
7793
if (!conf.exe || !conf.ben) { return; }
@@ -399,7 +415,6 @@ function init(defaults) {
399415

400416
// Set default values
401417
$("#chart_type").val(defaults.chart_type);
402-
$("#baseline").val(defaults.baseline);
403418
$("#direction").prop('checked', defaults.direction === "True");
404419

405420
/*
@@ -414,9 +429,23 @@ function init(defaults) {
414429
sel.filter("[value='" + env + "']").prop('checked', true);
415430
});
416431

417-
// Re-fetch when exe or benchmark selection changes
418-
$("input[name='executables'], input[name='benchmarks']").change(loadData);
419-
$('.checkall, .uncheckall').click(loadData);
432+
// Populate baseline dropdown from initially-checked executables
433+
updateBaselineDropdown();
434+
$("#baseline").val(defaults.baseline);
435+
436+
// Exe changes: rebuild baseline dropdown + re-fetch
437+
$("input[name='executables']").change(function() {
438+
updateBaselineDropdown();
439+
loadData();
440+
});
441+
$("#executable .checkall, #executable .uncheckall").click(function() {
442+
updateBaselineDropdown();
443+
loadData();
444+
});
445+
446+
// Benchmark changes: re-fetch only
447+
$("input[name='benchmarks']").change(loadData);
448+
$("#benchmark .checkall, #benchmark .uncheckall").click(loadData);
420449

421450
// Re-render without re-fetching for other controls
422451
$("#chart_type, #baseline, #direction, input[name='environments']").change(refreshContent);

codespeed/templates/codespeed/comparison.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,7 @@
7171
</span>
7272
<span class="options" title="Select baseline for normalization">Normalization:
7373
<select id="baseline">
74-
<option value="none">None</option>{% for proj, exes in executables.items %}
75-
{% for exe in exes %}
76-
<option value="{{ exe.key }}">{{ exe.name }}</option>{% endfor %}
77-
{% endfor %}
74+
<option value="none">None</option>
7875
</select>
7976
</span>
8077
<span class="options">

speed_pypy/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
{'name': 'pypy3.9-jit-64', 'project': 'PyPy3.9'},
100100
]
101101
DEF_ENVIRONMENT = 'benchmarker'
102+
CHART_ORIENTATION = 'horizontal'
102103

103104

104105
from .local_settings import *

0 commit comments

Comments
 (0)