Archived
dashboard: a history category wraps whole, and its break is a padded element
The summary line wrapped mid-figure: "ttft median 810" ended one line and "ms" started the next. A category that cannot fit should move to the next line intact, not break wherever the browser finds a space. Each category becomes one span with white-space:nowrap, so it is atomic, and the dot between categories becomes a padded element carried INSIDE the group it introduces -- as a sibling it could be left stranded at the end of a line when the group wrapped, which is the same orphan in a different place. This also corrects a false premise in the two commits before it. HTML collapses runs of whitespace, and .hsum sets no white-space, so the "wide" double-spaced separator those commits introduced never rendered wide: it collapsed to a single space exactly like the tight one. The spacing change was not subtle, it was zero -- which is why it looked identical. Width has to come from a padded element, not from spaces in the string. The pipe-within-category and dot-between-categories distinction is unaffected by this and stands. tests/js/history.test.js, 24 checks, drives the shipped assembly against a DOM stub and reads the shipped CSS: every category is a nowrap .hgrp, the break is a padded .hsep, the dot is the first child of its own group rather than a sibling, a category's own figures carry pipes and no dot, and the ttft category is a single text node so value and unit cannot split. Verified by mutation: dropping nowrap, dropping the padding, moving the dot to a sibling, turning the category break into a pipe, and splitting the value from its unit each fail the suite -- the last being the exact 810 / ms orphan this fixes. extremes 27, poll_spark 35, dashboard_test 241 over 8 cases, sched_test 62646 over 184, no failures. Not deployed. Goes to review with the separator commits. Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI
This commit is contained in:
1 parent
d5bb6a6c6e
commit
1554b451e1
2 files changed
+127
-3
No files matched your search
@@ -742,6 +742,12 @@ th + th, td + td { padding-left:14px; }
|
||||
margin-top:14px; padding-top:12px; border-top:1px solid var(--rule); }
|
||||
#hist .hhead { display:flex; align-items:baseline; gap:10px; margin-bottom:8px; }
|
||||
#hist .hsum { flex:1; font-family:var(--mono); font-size:11px; color:var(--dim); line-height:1.5; }
|
||||
/* Each category is one atomic unit: if it cannot fit on the line it moves whole, rather than
|
||||
* breaking mid-figure and orphaning a unit -- "810" at the end of one line, "ms" on the next.
|
||||
* The separator is its own element with padding because HTML collapses runs of spaces, so
|
||||
* spacing in the string could never have widened the category break. */
|
||||
#hist .hgrp { white-space:nowrap; }
|
||||
#hist .hsep { color:var(--faint); padding:0 9px; }
|
||||
#hist .hbtn { font-family:var(--mono); font-size:10px; color:var(--faint); cursor:pointer;
|
||||
user-select:none; padding:0 4px; }
|
||||
#hist .hbtn:hover { color:var(--bad); }
|
||||
@@ -2253,9 +2259,19 @@ function histRender(missed) {
|
||||
if (tpsV.length) parts.push(group(tpsV, tps, "tok/s"));
|
||||
if (pfV.length) parts.push(group(pfV, cnt3, "prefill"));
|
||||
if (tfs.length) parts.push("ttft median " + dur(tfs[Math.floor(tfs.length / 2)]));
|
||||
/* The wide dot is the page's major-break separator (the KV and version lines use it); the
|
||||
* tight dot inside each group stays tight, so group edges read heavier than window edges. */
|
||||
$("hsum").textContent = parts.join(" · ");
|
||||
/* One element per category so it wraps whole, and the dot between them is its own element so
|
||||
* its spacing survives. The dot marks a category change; the pipe inside each group marks a
|
||||
* different question about the same category. */
|
||||
const hsum = $("hsum");
|
||||
hsum.textContent = "";
|
||||
parts.forEach((p, i) => {
|
||||
const g = el("span", "hgrp");
|
||||
/* The dot travels WITH the category it introduces: as a sibling it could be left stranded
|
||||
* at the end of a line when the category wrapped, which is the orphan this avoids. */
|
||||
if (i) g.appendChild(el("span", "hsep", "\u00b7"));
|
||||
g.appendChild(document.createTextNode(p));
|
||||
hsum.appendChild(g);
|
||||
});
|
||||
|
||||
/* Newest first. The rows are rebuilt only when the set changes; a poll only rewrites the ages. */
|
||||
const body = $("hbody");
|
||||
|
||||
Reference in new issue
Block a user