From 1d0b6920286266ca6b8143d2e8226289d34eaff0 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Fri, 13 Jun 2025 19:01:05 -0700 Subject: [PATCH] Prevent downgrading DiagResult in progress screen --- boot_diags/src/components/progress.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/boot_diags/src/components/progress.rs b/boot_diags/src/components/progress.rs index 3ab25ea..7c1bcf8 100644 --- a/boot_diags/src/components/progress.rs +++ b/boot_diags/src/components/progress.rs @@ -86,8 +86,23 @@ impl Component for Progress { &result, &text ); if let Some(line) = self.lines.last_mut() { - line.result = result; - line.text = text; + let old_result = line.result.clone(); + match (old_result, result.clone()) { + (DiagResult::Pass, _) => { + line.result = result; + line.text = text; + } + (DiagResult::Warn, DiagResult::Pass | DiagResult::Warn) => { + line.text = String::from("Unknown"); + } + (DiagResult::Warn, DiagResult::Fail) => { + line.result = DiagResult::Fail; + line.text = String::from("Unknown"); + } + (DiagResult::Fail, _) => { + line.text = String::from("Unknown"); + } + }; } } Action::DiagLineEnd { text } => {