Skip to content

Commit 0b58e23

Browse files
committed
ui: flakes: hide branch prefixes which have no branches with results
Now that we have multiple branch prefixes flakes often shows completely empty columns. Hide branch prefixes which have no results. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 77e4b2b commit 0b58e23

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

ui/flakes.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ function load_result_table(data_raw)
2121
$.each(data_raw, function(i, v) {
2222
branch_set.add(v.branch);
2323
});
24-
let br_cnt = document.getElementById("br-cnt").value;
25-
const branches = Array.from(branch_set).slice(0, br_cnt);
2624

2725
// Populate the load filters with prefixes
2826
let select_br_pfx = document.getElementById("br-pfx");
29-
for (const br of branches) {
27+
for (const br of branch_set) {
3028
const br_pfx = nipa_br_pfx_get(br);
3129

3230
if (select_br_pfx.length == 0)
@@ -41,6 +39,7 @@ function load_result_table(data_raw)
4139
var pw_n = document.getElementById("pw-n").checked;
4240
var pw_y = document.getElementById("pw-y").checked;
4341
let needle = document.getElementById("tn-needle").value;
42+
let br_pfx_with_data = new Set();
4443

4544
$.each(data_raw, function(i, v) {
4645
$.each(v.results, function(j, r) {
@@ -56,9 +55,20 @@ function load_result_table(data_raw)
5655
return 1;
5756

5857
r.visible = true;
58+
59+
const br_pfx = nipa_br_pfx_get(v.branch);
60+
br_pfx_with_data.add(br_pfx);
5961
});
6062
});
6163

64+
// Hide all the branches with prefixes which saw no data
65+
let br_cnt = document.getElementById("br-cnt").value;
66+
var branches = Array.from(branch_set);
67+
branches = branches.filter(
68+
(name) => br_pfx_with_data.has(nipa_br_pfx_get(name))
69+
);
70+
branches = branches.slice(0, br_cnt);
71+
6272
// Build the result map
6373
var test_row = {};
6474
let tn_urls = {};

0 commit comments

Comments
 (0)