Hide exit 0 from successful job headers
Filter exit_code through .filter(|&c| c != 0) so passing jobs dont
show a redundant exit 0 tag. Failures still display the exit code.

Assisted-by: GLM-5.1 via pi
change ulklxyvytoxtwqptupsmttlzqvxmqtup
commit d18bd6ed9104cf0bf9f8729441faf9889df6bb44
author Alpha Chen <alpha@kejadlen.dev>
date
parent ktzxnmsz
diff --git a/src/quire/web/templates.rs b/src/quire/web/templates.rs
index 6aa337e..fc77141 100644
--- a/src/quire/web/templates.rs
+++ b/src/quire/web/templates.rs
@@ -187,10 +187,8 @@ impl DetailJob {
         format::format_duration(self.started_at_ms, self.finished_at_ms)
     }
 
-    pub fn exit_display(&self) -> String {
-        self.exit_code
-            .map(|c| format!(" · exit {c}"))
-            .unwrap_or_default()
+    pub fn exit_code_filter_nonzero(&self) -> Option<i32> {
+        self.exit_code.filter(|&c| c != 0)
     }
 }
 
diff --git a/templates/ci/run_detail.html b/templates/ci/run_detail.html
index 339d0d3..2c84cfd 100644
--- a/templates/ci/run_detail.html
+++ b/templates/ci/run_detail.html
@@ -24,7 +24,7 @@
 {% for job in jobs %}
 <div class="ci-job">
   <div class="ci-job-header">
-    {{ job.job_id }} · {{ job.duration_display() }}{{ job.exit_display() }}
+    {{ job.job_id }} · {{ job.duration_display() }}{% if let Some(code) = job.exit_code_filter_nonzero() %} · exit {{ code }}{% endif %}
     · <span class="{{ job.state_class() }}">{{ job.state }}</span>
   </div>
   {% for sh in job.sh_events %}