fix: theme the check-run terminal view and box its empty-output state
commit
ba707a4fix: theme the check-run terminal view and box its empty-output state
- dark-mode
- attribute) always got acdc's --light class, painting the terminal
acdc’s terminal player has no way to know the browser’s prefers-color-scheme at render time, so our synthesized [terminal]/[terminal%replay] source (no :dark-mode: attribute) always got acdc’s --light class, painting the terminal box with a fixed light background no matter the site’s theme.
fix: repaint .terminal-view--{light,dark} with the site’s own --color-code-bg/--color-text variables instead of acdc’s hardcoded hex pair
style: box the no-output and waiting-for-output placeholders in a dashed .terminal-empty callout so they read as "nothing recorded" rather than blank output
Assisted-by: Claude:claude-sonnet-5
Reviews
No reviews of this commit yet — record a verdict below.
Start a review
crates/git-ents-server/src/asciidoc.rs
@@ -63,14 +63,18 @@
/// CSS for the `.terminal-view` player acdc's HTML converter emits, vendored
/// here because embedded-fragment output carries no `<head>` to link or inline
/// it from (see [`to_html`]'s doctitle note for the same embedded-mode gap).
-/// Lifted verbatim from acdc's built-in stylesheet; keep in sync if it drifts.
+/// Based on acdc's built-in stylesheet (keep the box/layout rules in sync if it
+/// drifts), but `--light`/`--dark` are repainted with the site's own theme
+/// variables (`crates/git-ents-server/src/web/style.css`) rather than acdc's
+/// fixed hex pair: our synthesized `[terminal]`/`[terminal%replay]` source never
+/// carries a `:dark-mode:` attribute, so acdc always picks `--light`, which
+/// otherwise renders a fixed light-on-light box no matter the browser's theme.
pub(crate) const TERMINAL_VIEW_CSS: &str = "\
-.terminal-view{margin:1.25em 0;max-width:100%;overflow:auto;border-radius:8px;box-shadow:0 16px 50px rgba(0,0,0,.18)}
-.terminal-view__screen{margin:0;padding:18px;font:14px/1.45 ui-monospace,SFMono-Regular,\"SF Mono\",Menlo,Consolas,\"Liberation Mono\",monospace;white-space:pre;tab-size:4}
-.terminal-view--light{background-color:#f6f8fa;color:#1f2328}
-.terminal-view--dark{background-color:#0d1117;color:#e6edf3}
+.terminal-view{margin:1.25em 0;max-width:100%;overflow:auto;border-radius:var(--radius-sm);border:1px solid var(--color-border);box-shadow:var(--shadow-sm)}
+.terminal-view__screen{margin:0;padding:18px;font:14px/1.45 var(--font-mono);white-space:pre;tab-size:4}
+.terminal-view--light,.terminal-view--dark{background-color:var(--color-code-bg);color:var(--color-text)}
.terminal-view__viewport{overflow:auto;max-width:100%;padding:0 18px 18px}
-.terminal-view__stream{margin:0;padding:0;width:max-content;font-family:ui-monospace,SFMono-Regular,\"SF Mono\",Menlo,Consolas,\"Liberation Mono\",monospace;font-size:14px;line-height:1.2;white-space:normal;tab-size:4}
+.terminal-view__stream{margin:0;padding:0;width:max-content;font-family:var(--font-mono);font-size:14px;line-height:1.2;white-space:normal;tab-size:4}
.terminal-view__row{white-space:pre;min-height:1.2em}
";
crates/git-ents-server/src/web/render.rs
@@ -323,12 +323,16 @@
/// The best-possible-UX fallback for a settled check with nothing to replay:
/// its exit code when the command actually ran, or just its status when it
-/// didn't (a composite, or an infra failure before any command started).
+/// didn't (a composite, or an infra failure before any command started). Boxed
+/// distinctly from a real terminal (dashed border, no fixed light background)
+/// so it reads as "nothing recorded" rather than as an empty transcript.
fn no_output_notice(outcome: &RunOutcome) -> Markup {
html! {
- @match outcome.exit_code {
- Some(code) => p.muted { "Check finished with exit code " code { (code) } " without output." }
- None => p.muted { "This check produced no terminal output." }
+ div.terminal-empty {
+ @match outcome.exit_code {
+ Some(code) => { "Check finished with exit code " code { (code) } " without output." }
+ None => { "This check produced no terminal output." }
+ }
}
}
}
@@ -343,6 +347,6 @@
.and_then(|recording| asciidoc::render_live(&recording));
match rendered {
Some(player) => html! { (PreEscaped(player)) },
- None => html! { p.muted { "Waiting for output…" } },
+ None => html! { div.terminal-empty { "Waiting for output…" } },
}
}
crates/git-ents-server/src/web/style.css
@@ -351,6 +351,7 @@
.status-pending { color: var(--color-text-muted); }
.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; }
.site-footer { border-top: 1px solid var(--color-border); color: var(--color-text-muted); font-size: .8rem; margin-top: auto; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 2rem 1.5rem; text-align: center; }