From 70cbed18d7f19e5d2f7722cd3a6840ed38349b66 Mon Sep 17 00:00:00 2001 From: Harenome Ranaivoarivony-Razanajato Date: Tue, 24 Nov 2026 14:49:56 +0100 Subject: [PATCH 1/2] fix(runs): wrap stage labels, fit the trace waterfall and the token split to a narrow window A stage label wraps anywhere, and more than eight stages stack at any width. Under 640 px the waterfall's name column gives way and its axis keeps its first and last ticks. A token split that would open past the window's right edge opens leftwards. --- app/static/runs/board.js | 6 ++++++ app/static/style.css | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/static/runs/board.js b/app/static/runs/board.js index d15aea2b..249a53d1 100644 --- a/app/static/runs/board.js +++ b/app/static/runs/board.js @@ -128,6 +128,12 @@ r.style.transition = 'transform .28s var(--ease)'; r.style.transform = ''; }); })); + // a split that would open past the window's right edge (a narrow screen) opens leftwards instead + $$('.pop', page).forEach(d => d.addEventListener('toggle', () => { + const m = $('.popm', d); m.style.left = m.style.right = ''; + if (d.open && m.getBoundingClientRect().right > innerWidth) Object.assign(m.style, {left: 'auto', right: '0'}); + })); + // ---- Esc closes what is open, else clears the filters ---- document.addEventListener('keydown', e => { if (e.key !== 'Escape') return; diff --git a/app/static/style.css b/app/static/style.css index 830b5100..c7708ccb 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -767,6 +767,11 @@ button.seg:hover { filter: brightness(1.25); } .wf-tick:first-child { transform: none; } .wf-tick:last-child { transform: translateX(-100%); } .wf-head .wf-dur { text-align: right; } +/* a phone: the name column gives way, and the axis keeps its first and last ticks */ +@media (max-width: 640px) { + .wf-head, .wf-row { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) 5.5rem; } + .wf-tick:not(:first-child):not(:last-child) { display: none; } +} .wf-row { height: 24px; position: relative; } .wf-row:hover { background: var(--surface-2); } @@ -1714,7 +1719,8 @@ pre.instruction { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 32 .xs.running { color: var(--text); font-weight: 500; } .xs.waiting { color: var(--text-faint); } .xs-time { font-family: var(--mono); font-size: .75rem; font-weight: 400; color: var(--text-faint); } -.xs-detail { font-size: .75rem; font-weight: 400; color: var(--text-faint); overflow-wrap: anywhere; } +.xs-detail { font-size: .75rem; font-weight: 400; color: var(--text-faint); } +.xs-label, .xs-detail { overflow-wrap: anywhere; } @container xs (max-width: 44rem) { .xs-list { flex-direction: column; } .xs, .xs:last-child { flex: none; width: 100%; min-height: var(--mark); padding: .1rem 0 .95rem calc(var(--mark) + .7rem); } @@ -1722,6 +1728,12 @@ pre.instruction { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 32 .xs::before { top: calc(var(--mark) + .3rem); bottom: .3rem; left: calc(var(--mark) / 2 - 1px); right: auto; width: 2px; height: auto; } .xs i { position: absolute; top: 0; left: 0; margin: 0; } } +/* more stages than one row holds stack at any width */ +.xs-list:has(> :nth-child(9)) { flex-direction: column; } +.xs-list:has(> :nth-child(9)) > .xs { flex: none; width: 100%; min-height: var(--mark); padding: .1rem 0 .95rem calc(var(--mark) + .7rem); } +.xs-list:has(> :nth-child(9)) > .xs:last-child { padding-bottom: 0; } +.xs-list:has(> :nth-child(9)) > .xs::before { top: calc(var(--mark) + .3rem); bottom: .3rem; left: calc(var(--mark) / 2 - 1px); right: auto; width: 2px; height: auto; } +.xs-list:has(> :nth-child(9)) > .xs i { position: absolute; top: 0; left: 0; margin: 0; } .xs-units { display: flex; align-items: center; gap: 10px; margin-top: 8px; } .xs-units progress { flex: 1; max-width: 220px; height: 8px; accent-color: var(--ok); } @keyframes xs-beat { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 10%, transparent); } } From 915dfed5ff4a43ffff4dfc2fafc90449ef97910c Mon Sep 17 00:00:00 2001 From: Harenome Ranaivoarivony-Razanajato Date: Tue, 24 Nov 2026 15:30:16 +0100 Subject: [PATCH 2/2] fix(runs): show a stage's image digest short and scroll a long stage strip in its own box A stage label names its image by digest; it now shows sha256: and the first 12 hex, as docker images does, with the full label as its tooltip. More stages than the width holds scroll sideways inside the strip, each at least 7rem wide, instead of stacking into a vertical list at any width. --- app/nullius/progress.py | 9 +++++++-- app/static/style.css | 13 ++++--------- app/templates/runs/_execution.html | 4 ++-- app/tests/test_progress.py | 6 ++++++ 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/app/nullius/progress.py b/app/nullius/progress.py index 1208bb1f..8aa2d26c 100644 --- a/app/nullius/progress.py +++ b/app/nullius/progress.py @@ -52,6 +52,8 @@ _WORD = re.compile(r'([A-Za-z_][A-Za-z0-9_]*)=("(?:[^"\\]|\\.)*"|\S*)') _BARE = re.compile(r'^[^\s"=]+$') +# an image digest, shown short as ``docker images`` does: its first 12 hex +_DIGEST = re.compile(r"(sha256:[0-9a-f]{12})[0-9a-f]{52}") def _value(v) -> str: @@ -269,13 +271,16 @@ def fold(events: Iterable[dict]) -> dict: if key != st and st in stages and stages[st]["state"] == "waiting": stages = {(key if k == st else k): v for k, v in stages.items()} stages[key]["key"] = key - stages.setdefault(key, {"key": key, "stage": st, "label": label(ev), "state": "waiting"}) + stages.setdefault(key, {"key": key, "stage": st, "state": "waiting"}) row = stages[key] if state == "start": # A later part or retry starts this stage afresh. for field in ("seconds", "bytes", "total", "detail"): row.pop(field, None) - row["label"] = label(ev) + full = label(ev) + row["label"] = _DIGEST.sub(r"\1", full) + if row["label"] != full: + row["full"] = full if ev.get("detail") is not None: row["detail"] = ev["detail"] if state == "start": diff --git a/app/static/style.css b/app/static/style.css index c7708ccb..04ff2132 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -1704,8 +1704,9 @@ pre.instruction { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 32 .execution-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; } .run-delete { margin-left: auto; color: var(--text-dim); } .execution-stages { container: xs / inline-size; margin: 14px 0 8px; } -.xs-list { --mark: 1.6rem; list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-start; } -.xs { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding-right: .9rem; font-size: .82rem; line-height: 1.3; color: var(--text-dim); } +/* more stages than the width holds scroll inside the strip, never the page; the padding keeps the running mark's ring unclipped */ +.xs-list { --mark: 1.6rem; list-style: none; margin: -6px; padding: 6px; display: flex; align-items: flex-start; overflow-x: auto; } +.xs { position: relative; flex: 1 1 0; min-width: 7rem; display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding-right: .9rem; font-size: .82rem; line-height: 1.3; color: var(--text-dim); } .xs:last-child { flex: 0 1 auto; padding-right: 0; } .xs::before { content: ""; position: absolute; top: calc(var(--mark) / 2 - 1px); left: calc(var(--mark) + .4rem); right: .4rem; height: 2px; border-radius: 1px; background: var(--border-soft); transition: background .3s; } .xs:last-child::before { display: none; } @@ -1722,18 +1723,12 @@ pre.instruction { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 32 .xs-detail { font-size: .75rem; font-weight: 400; color: var(--text-faint); } .xs-label, .xs-detail { overflow-wrap: anywhere; } @container xs (max-width: 44rem) { - .xs-list { flex-direction: column; } + .xs-list { flex-direction: column; margin: 0; padding: 0; overflow: visible; } .xs, .xs:last-child { flex: none; width: 100%; min-height: var(--mark); padding: .1rem 0 .95rem calc(var(--mark) + .7rem); } .xs:last-child { padding-bottom: 0; } .xs::before { top: calc(var(--mark) + .3rem); bottom: .3rem; left: calc(var(--mark) / 2 - 1px); right: auto; width: 2px; height: auto; } .xs i { position: absolute; top: 0; left: 0; margin: 0; } } -/* more stages than one row holds stack at any width */ -.xs-list:has(> :nth-child(9)) { flex-direction: column; } -.xs-list:has(> :nth-child(9)) > .xs { flex: none; width: 100%; min-height: var(--mark); padding: .1rem 0 .95rem calc(var(--mark) + .7rem); } -.xs-list:has(> :nth-child(9)) > .xs:last-child { padding-bottom: 0; } -.xs-list:has(> :nth-child(9)) > .xs::before { top: calc(var(--mark) + .3rem); bottom: .3rem; left: calc(var(--mark) / 2 - 1px); right: auto; width: 2px; height: auto; } -.xs-list:has(> :nth-child(9)) > .xs i { position: absolute; top: 0; left: 0; margin: 0; } .xs-units { display: flex; align-items: center; gap: 10px; margin-top: 8px; } .xs-units progress { flex: 1; max-width: 220px; height: 8px; accent-color: var(--ok); } @keyframes xs-beat { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 10%, transparent); } } diff --git a/app/templates/runs/_execution.html b/app/templates/runs/_execution.html index d026880f..c4a424bd 100644 --- a/app/templates/runs/_execution.html +++ b/app/templates/runs/_execution.html @@ -27,7 +27,7 @@ {% set sp = ex.stages() %}
    {% for st in sp.stages %} -
  1. {{ st.label }} +
  2. {{ st.label }} {%- if st.state == 'cached' %}cached{% elif st.get('seconds') is not none and st.state in ('done', 'failed') %}{{ st.seconds|secs }}{% endif %} {%- if st.state in ('running', 'failed') and st.detail and st.detail != sp.detail %}{{ st.detail }}{% endif %}
  3. {% endfor %}
@@ -60,7 +60,7 @@ if (!mark) { mark = el('i'); mark.setAttribute('aria-hidden', 'true'); li.append(mark); } mark.textContent = {done: '', cached: '', failed: '✕'}[st.state] ?? String(n + 1); while (mark.nextSibling) mark.nextSibling.remove(); - li.append(el('span', 'xs-label', st.label)); + const name = li.appendChild(el('span', 'xs-label', st.label)); if (st.full) name.title = st.full; if (st.state === 'cached') li.append(el('span', 'xs-time', 'cached')); else if (st.state === 'running' && st.t) li.append(el('span', 'xs-time', clock(Math.max(0, Date.now() / 1000 - st.t)))); else if (st.seconds != null && (st.state === 'done' || st.state === 'failed')) li.append(el('span', 'xs-time', secs(st.seconds))); diff --git a/app/tests/test_progress.py b/app/tests/test_progress.py index a7c33d12..4df04980 100644 --- a/app/tests/test_progress.py +++ b/app/tests/test_progress.py @@ -106,6 +106,12 @@ def test_a_planned_stage_said_with_what_it_is_of_takes_its_place(self): got = progress.fold([ev("plan", stages="install,units"), ev("install", "start", agent="codex@2.2.2")]) self.assertEqual([(s["key"], s["label"]) for s in got["stages"]], [("install:codex@2.2.2", "Install codex@2.2.2"), ("units", "Units")]) + def test_an_image_digest_is_shown_short_with_the_full_label_kept(self): + digest = "sha256:" + "0123456789ab" + "c" * 52 + got = progress.fold([ev("environment", "start", name="tasks@" + digest), ev("install", "start", agent="terminus-2")]) + self.assertEqual([(s["label"], s.get("full")) for s in got["stages"]], + [("Environment tasks@sha256:0123456789ab", "Environment tasks@" + digest), ("Install terminus-2", None)]) + def test_a_planned_stage_a_later_one_overtook_was_not_needed(self): got = progress.fold([ev("plan", stages="image,dataset,install"), ev("image", "cached"), ev("install", "start", agent="a")]) self.assertEqual([s["stage"] for s in got["stages"]], ["image", "install"])