Skip to content
This repository was archived by the owner on Apr 21, 2023. It is now read-only.

Commit 7b1b9a2

Browse files
committed
Make PRs that need testing more prominent
Might need to revert if implication that grayed out PRs cannot be applied is too strong.
1 parent ba0fce5 commit 7b1b9a2

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

src/app.rs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,33 @@ impl eframe::App for TemplateApp {
214214
}
215215
}
216216
} else {
217-
ui.label(format!("{}: {}", pr_number, pr_title));
217+
// This is a quick and dirty way to colour PR that don't have a testing labels as lighter colour to indicate no need for testing.
218+
// In the future this should be rewritten more nicely and maybe allow filtering by label
219+
// Also the hardcoded value should be a constant at the top of the source file.
220+
let labels = elem
221+
.get("labels")
222+
.and_then(|value| value.as_array())
223+
.unwrap();
224+
let mut temp_bool = false;
225+
for elem in labels {
226+
let label_name =
227+
elem.get("name").and_then(|value| value.as_str()).unwrap();
228+
if label_name == "needs testing" {
229+
temp_bool = true;
230+
}
231+
// dbg!(label_name);
232+
}
233+
if temp_bool {
234+
ui.label(
235+
egui::RichText::new(format!("{}: {}", pr_number, pr_title))
236+
.strong(),
237+
);
238+
} else {
239+
ui.label(
240+
egui::RichText::new(format!("{}: {}", pr_number, pr_title))
241+
.color(egui::Color32::GRAY),
242+
);
243+
}
218244
}
219245
});
220246
}

0 commit comments

Comments
 (0)