git-ents.gitmain
⌘K
foforge
commit 3d09261
fix: color and link each check in Recent runs, not just name and status text

The generic Render impl for a run collapsed it to one plain muted string like fmt pass test fail with no color and nowhere to click, inconsistent with the colored, linked treatment the Checks on HEAD card gives the same data. Recent runs now renders one badge per outcome via the same status_badge coloring, linked to its recording when it has one.

Assisted-by: Claude:claude-sonnet-5

Joseph D. Carpinelli · 1 month ago

Reviews

No reviews of this commit yet — record a verdict below.

Start a review

verdict

crates/git-ents-server/src/web/pages.rs @@ -998,7 +998,7 @@ @for run in &commit.runs { div.card-row.signer-row { code.key { (short_oid(&commit.commit)) } - (run.render()) + (super::render::run_row(rel, &commit.commit.to_string(), run)) } } }
crates/git-ents-server/src/web/render.rs @@ -159,11 +159,30 @@ } } -/// A run is a set of per-check outcomes; collapse them to one summary line -/// rather than a row per outcome. -impl Render for Run { - fn render(&self) -> Markup { - html! { span.muted { (run_summary(self)) } } +/// A run's per-check outcomes, each colored by [`status_badge`] and linked to +/// its recording when it has one — the same treatment "Checks on HEAD" gives +/// each check, rather than one plain summary line. +pub(super) fn run_row(rel: &str, commit_hex: &str, run: &Run) -> Markup { + html! { + div.run-results { + @for outcome in &run.results { + (run_result(rel, commit_hex, outcome)) + } + } + } +} + +/// One outcome within a run row: its check name and status badge, linked to +/// `/{rel}/checks/{commit_hex}/{name}` when there's a live view or a +/// recording behind it. +fn run_result(rel: &str, commit_hex: &str, outcome: &RunOutcome) -> Markup { + let href = format!("/{rel}/checks/{commit_hex}/{}", outcome.name); + html! { + @if outcome.recording.is_some() || is_in_progress(outcome.status) { + a.run-result href=(href) { (outcome.name) " " (status_badge(outcome.status)) } + } @else { + span.run-result { (outcome.name) " " (status_badge(outcome.status)) } + } } } @@ -240,15 +259,6 @@ } } -/// A one-line summary of a run's outcomes, e.g. `fmt pass · test fail`. -fn run_summary(run: &Run) -> String { - run.results - .iter() - .map(|result| format!("{} {}", result.name, result.status)) - .collect::<Vec<_>>() - .join(" · ") -} - /// Whether `status` is still on its way to a terminal outcome — the check has /// no recording yet, but its run page has a live view worth linking to. pub(super) fn is_in_progress(status: Status) -> bool {
crates/git-ents-server/src/web/style.css @@ -359,6 +359,11 @@ .status-fail { color: var(--s-keyword); font-weight: 600; } .status-running { color: var(--color-accent); font-weight: 600; } .status-pending { color: var(--color-text-muted); } + +.run-results { display: flex; flex-wrap: wrap; gap: .3rem .9rem; flex: 1; min-width: 0; } +.run-results .run-result { flex: none; color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; } +.run-results a.run-result { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 25%, transparent); } +.run-results a.run-result:hover { color: var(--color-accent); } .check-summary { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.25rem; font-family: var(--font-mono); font-size: .9rem; } .check-summary .btn-quiet { margin-left: auto; } .terminal-empty { color: var(--color-text-muted); font-size: .9rem; background: var(--color-code-bg); border: 1px dashed var(--color-border); border-radius: var(--radius-sm); padding: 1rem 1.2rem; }