- Built is the miss count, as sccache counts timeouts, cache errors and forced recaches inside it. The bar under the headline has five shares that add up to every compiler call and always to 100%; what happened inside the built share is one line under the bar. - The time saved shows its 90% range in small print under the figure. - Speed gains "How long builds take, by language": one fixed-height histogram per language on a shared log scale of build time, with the mean, median and p90 marked. - The api crate's Range helpers replace the page's own copies. - Drawing is built only for the browser, so the tests (and the rest of the crate) build anywhere without eframe's native backends. - Tables are drawn row by row; egui's Grid lost its rows when a cell held more than a plain widget. Fold-away bodies are held to the width of the page, and the charts fit their data every frame. - mise.toml takes trunk 0.22.2 as a release binary; building it from source took over half an hour.
43 lines
1.5 KiB
Rust
43 lines
1.5 KiB
Rust
//! Problems: what is wrong, most serious first.
|
|
|
|
use eframe::egui::{self, RichText, Stroke, Ui};
|
|
use sccache_dash_api::{Severity, View};
|
|
|
|
use crate::style;
|
|
|
|
pub fn section(ui: &mut Ui, view: &View, dark: bool) {
|
|
style::section(ui, "problems", "Problems", |ui| {
|
|
if view.problems.is_empty() {
|
|
ui.label("No problems.");
|
|
return;
|
|
}
|
|
let [_, warn, bad] = style::marks(dark);
|
|
for problem in &view.problems {
|
|
let color = match problem.severity {
|
|
Severity::Error => bad,
|
|
Severity::Warning => warn,
|
|
};
|
|
let kind = match problem.severity {
|
|
Severity::Error => "Error",
|
|
Severity::Warning => "Warning",
|
|
};
|
|
// As wide as there is room, minus a little (see `banner`).
|
|
let width = ui.available_rect_before_wrap().width() - 2.0 * 8.0;
|
|
egui::Frame::NONE
|
|
.fill(color.gamma_multiply(0.14))
|
|
.stroke(Stroke::new(1.0, color))
|
|
.corner_radius(6.0)
|
|
.inner_margin(8.0)
|
|
.show(ui, |ui| {
|
|
ui.set_min_width(width - 6.0);
|
|
ui.horizontal_wrapped(|ui| {
|
|
ui.label(RichText::new(kind).small().strong().color(color));
|
|
ui.label(RichText::new(&problem.title).strong());
|
|
});
|
|
ui.add(egui::Label::new(&problem.detail).wrap());
|
|
});
|
|
ui.add_space(4.0);
|
|
}
|
|
});
|
|
}
|