From 12e6ee09290b9845a4803fd229d8d9f6a85ab6d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 27 Oct 2026 20:15:11 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20runner=20row=20shows=20?= =?UTF-8?q?running=20jobs=20as=20one=20pip=20per=20slot=20and=20a=20compac?= =?UTF-8?q?t=20joined=20Max=20stepper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/forge-web/src/pages/admin_runners.rs | 51 +++-- style/main.scss | 237 +++++++++++++------- 2 files changed, 199 insertions(+), 89 deletions(-) diff --git a/crates/forge-web/src/pages/admin_runners.rs b/crates/forge-web/src/pages/admin_runners.rs index f546448..9af5a4b 100644 --- a/crates/forge-web/src/pages/admin_runners.rs +++ b/crates/forge-web/src/pages/admin_runners.rs @@ -494,9 +494,13 @@ async fn restart_control( }) } -/// The load cell of a runner: the jobs running out of the concurrency, a meter of the two, and the -/// concurrency as a stepper. The − and + buttons step the input (nav.js); Save shows only once the -/// value has changed, and stays visible without JavaScript. A reset button shows while an override is set. +/// Above this many slots the running jobs show as a meter, not as one pip per slot. +const PIP_MAX: u32 = 16; + +/// The load cell of a runner, in two parts: the jobs running, as a pip per concurrency slot (a +/// meter past `PIP_MAX`), and the concurrency as a stepper. The − and + buttons step the input +/// (nav.js); Save shows only once the value has changed, and stays visible without JavaScript. A +/// reset button shows while an override is set. #[component] async fn concurrency_form( lang: Lang, @@ -510,26 +514,45 @@ async fn concurrency_form( running: u32, max: u32, ) -> Result { - let running = running.to_string(); + let running_text = running.to_string(); let meter_max = max.max(1).to_string(); + let use_pips = (1..=PIP_MAX).contains(&max); + let pips: Vec<&'static str> = (0..max) + .map(|slot| if slot < running { "runner-pip is-on" } else { "runner-pip" }) + .collect(); + let pips_label = match lang { + Lang::En => format!("{running} of {max} jobs running"), + Lang::Tr => format!("{running}/{max} iş çalışıyor"), + }; Ok(view! {
- (s(lang, "Jobs", "İşler")) -
- (running.as_str()) - "/" - - - - +
+ (running_text.as_str())" "(s(lang, "running", "çalışıyor")) + if use_pips { + + for pip in pips.iter() { + + } + + } else { + + } +
+
+ (s(lang, "Max", "En çok")) +
+ + + +
+ if has_override { - + }
- }) } diff --git a/style/main.scss b/style/main.scss index 00a06d6..6803b57 100644 --- a/style/main.scss +++ b/style/main.scss @@ -5313,26 +5313,22 @@ $ansi-colours: ( } } -// Admin runners: a vertical list, one card row per runner. Four columns: identity (dot, name, labels, -// last seen), load (the jobs meter and the concurrency stepper), version, and the actions menu. The -// load cell is the form that saves the concurrency. Its Save shows only once the value changes -// (nav.js sets data-dirty), and only where nav.js has run (html.js), so without JavaScript it stays. +// Admin runners: a list, one line per runner. Four columns: identity (dot, name, labels, last seen), +// load (the running pips and the concurrency stepper), version, and the actions menu. The load cell +// is the form that saves the concurrency. Its Save shows only once the value changes (nav.js sets +// data-dirty), and only where nav.js has run (html.js), so without JavaScript it stays. .runner-list { - margin: 0 -20px; + margin: 0; padding: 0; list-style: none; } .runner-row { display: grid; - grid-template-columns: minmax(180px, 1.4fr) 1fr 1fr auto; + grid-template-columns: minmax(180px, 1.3fr) minmax(260px, 1.4fr) auto auto; align-items: center; - column-gap: 16px; - padding: 14px 20px; - - &:hover { - background: var(--surface-2); - } + column-gap: 28px; + padding: 14px 0; > .row-menu { justify-self: end; @@ -5406,35 +5402,129 @@ $ansi-colours: ( font-family: var(--mono); } +// The load cell: the running status on the left, the concurrency stepper on the right. .runner-load { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16px; + min-width: 0; + margin: 0; +} + +.runner-running { display: flex; flex-direction: column; align-items: flex-start; - gap: 4px; + gap: 6px; + min-width: 0; +} + +.runner-count { + font-size: 0.875rem; + white-space: nowrap; +} + +.runner-n { + color: var(--text); + font-weight: 600; + font-variant-numeric: tabular-nums; +} + +// One pip per concurrency slot: accent when a job runs in it, a surface pip with an inset edge when free. +.runner-pips { + display: inline-flex; + gap: 3px; +} + +.runner-pip { + box-sizing: border-box; + width: 14px; + height: 6px; + border-radius: 2px; + background: var(--surface-2); + box-shadow: inset 0 0 0 1px var(--border); + + &.is-on { + background: var(--accent); + box-shadow: none; + } +} + +// The meter, for a concurrency past the pips: running jobs out of the concurrency, 80 by 4 pixels, +// accent fill on a surface track. +progress.runner-meter { + -webkit-appearance: none; + appearance: none; + display: block; + box-sizing: border-box; + width: 80px; + height: 4px; margin: 0; + border: 0; + border-radius: 2px; + overflow: hidden; + background: var(--surface-2); + color: var(--accent); + + &::-webkit-progress-bar { + background: var(--surface-2); + } + + &::-webkit-progress-value { + background: var(--accent); + } + + &::-moz-progress-bar { + background: var(--accent); + } +} + +// The concurrency: a small label, then one joined pill (− value +), then Save and the reset. +.runner-stepper { + display: flex; + flex: none; + align-items: center; + gap: 8px; } .runner-cap { font-size: 0.75rem; + white-space: nowrap; } -.runner-line { - display: flex; - flex-wrap: wrap; - align-items: center; - gap: 6px; +.runner-pill { + box-sizing: border-box; + display: inline-flex; + align-items: stretch; + height: 28px; + border: 1px solid var(--border-strong); + border-radius: var(--radius-md); + overflow: hidden; + background: var(--surface); input[type="number"] { box-sizing: border-box; - flex: none; - width: 44px; - height: var(--control-h); + width: 34px; + height: 100%; + margin: 0; padding: 0; - text-align: center; + border: 0; + border-left: 1px solid var(--border); + border-right: 1px solid var(--border); + border-radius: 0; + background: transparent; + color: var(--text); + font-weight: 600; font-variant-numeric: tabular-nums; + text-align: center; -moz-appearance: textfield; appearance: textfield; + &:focus-visible { + outline-offset: -2px; + } + &::-webkit-inner-spin-button, &::-webkit-outer-spin-button { -webkit-appearance: none; @@ -5442,76 +5532,73 @@ $ansi-colours: ( } } - .runner-count { - font-size: 0.9375rem; - font-variant-numeric: tabular-nums; - } - .runner-step { box-sizing: border-box; + display: inline-flex; + align-items: center; + justify-content: center; flex: none; - width: 32px; - height: var(--control-h); + width: 28px; + min-width: 28px; + height: 100%; padding: 0; + border: 0; + border-radius: 0; + background: none; + color: var(--muted); font-size: 1rem; line-height: 1; - } - .runner-save { - box-sizing: border-box; - height: var(--control-h); - } + &:hover { + background: var(--surface-2); + color: var(--text); + } - button[name="reset"] { - box-sizing: border-box; - min-width: var(--control-h); - height: var(--control-h); - padding: 0; + &:focus-visible { + outline-offset: -2px; + border-radius: 0; + } } } -html.js form.runner-load[data-dirty-form] .runner-save { - display: none; -} - -html.js form.runner-load[data-dirty-form][data-dirty] .runner-save { - display: inline-block; +.runner-save { + box-sizing: border-box; + height: 28px; + padding: 0 10px; + font-size: 0.8125rem; } -// The meter: running jobs out of the concurrency, 80 by 4 pixels, accent fill on a surface track. -progress.runner-meter { - -webkit-appearance: none; - appearance: none; - display: block; +.runner-reset { box-sizing: border-box; - width: 80px; - height: 4px; - margin: 2px 0 0; + flex: none; + width: 28px; + height: 28px; + padding: 0; border: 0; - border-radius: 2px; - overflow: hidden; - background: var(--surface-2); - color: var(--accent); + background: none; + color: var(--muted); - &::-webkit-progress-bar { + &:hover { background: var(--surface-2); + color: var(--text); } +} - &::-webkit-progress-value { - background: var(--accent); - } +html.js form.runner-load[data-dirty-form] .runner-save { + display: none; +} - &::-moz-progress-bar { - background: var(--accent); - } +html.js form.runner-load[data-dirty-form][data-dirty] .runner-save { + display: inline-block; } .runner-version { display: flex; - flex-wrap: wrap; + flex-wrap: nowrap; align-items: center; gap: 8px; justify-self: start; + white-space: nowrap; } .runner-hash { @@ -5536,10 +5623,10 @@ progress.runner-meter { color: var(--ok); } -// Phone: each runner is two rows. Identity and the menu, then the load and the version. -@media (max-width: 700px) { +// Phone: identity first, with the version and the menu on its right. The load cell takes the second line. +@media (max-width: 760px) { .runner-row { - grid-template-columns: minmax(0, 1fr) auto; + grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 12px; } @@ -5548,20 +5635,20 @@ progress.runner-meter { grid-row: 1; } - .runner-row > .row-menu { + .runner-version { grid-column: 2; grid-row: 1; + justify-self: end; } - .runner-load { - grid-column: 1; - grid-row: 2; + .runner-row > .row-menu { + grid-column: 3; + grid-row: 1; } - .runner-version { - grid-column: 2; + .runner-load { + grid-column: 1 / -1; grid-row: 2; - justify-self: end; } }