panel/dashboard: drop the caveat and the status line under the co-op chart
Nathan: the disclaimers are not necessary, especially now that reporting is in
place going forward — and then, on the status line under it: remove that too.
Gone from both apps: the explanatory note paragraph, its per-metric config
strings, the status line ("55 days - 2 not measured"), the now-orphaned CSS for
both, and the gaps counter that only fed the status line. The period toggles
still say what range is on screen, so no information is lost.
The harness assertions that described the status line are replaced by stronger
ones: the rendered chart must contain no caveat text at all, and the 30-day view
must still end at the most recent measured day.
This commit is contained in:
1 parent
8e8cb90d11
commit
a71271e35c
1 file changed
+3
-13
+3
-13
@@ -385,7 +385,6 @@ PAGE_HTML = """<!DOCTYPE html>
|
|||||||
.coop-trend { border: 1px solid var(--border, #e4e0d8); border-radius: 12px; padding: 14px 16px 12px; margin-bottom: 20px; }
|
.coop-trend { border: 1px solid var(--border, #e4e0d8); border-radius: 12px; padding: 14px 16px 12px; margin-bottom: 20px; }
|
||||||
.coop-trend-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
|
.coop-trend-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
|
||||||
.coop-trend-title { font-weight: 700; font-size: 15px; color: var(--ink, #2d3327); }
|
.coop-trend-title { font-weight: 700; font-size: 15px; color: var(--ink, #2d3327); }
|
||||||
.coop-trend-sub { color: var(--muted); font-size: 12px; }
|
|
||||||
.coop-trend-controls { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
|
.coop-trend-controls { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
|
||||||
.trend-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
|
.trend-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
|
||||||
.coop-trend-body svg { display: block; width: 100%; height: auto; overflow: visible; }
|
.coop-trend-body svg { display: block; width: 100%; height: auto; overflow: visible; }
|
||||||
@@ -562,7 +561,6 @@ PAGE_HTML = """<!DOCTYPE html>
|
|||||||
<div class="coop-trend">
|
<div class="coop-trend">
|
||||||
<div class="coop-trend-head">
|
<div class="coop-trend-head">
|
||||||
<span class="coop-trend-title" id="trend-title">The co-op over time</span>
|
<span class="coop-trend-title" id="trend-title">The co-op over time</span>
|
||||||
<span class="coop-trend-sub" id="trend-sub"></span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="coop-trend-controls">
|
<div class="coop-trend-controls">
|
||||||
<span class="trend-group">
|
<span class="trend-group">
|
||||||
@@ -579,7 +577,6 @@ PAGE_HTML = """<!DOCTYPE html>
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="trend-body" class="coop-trend-body"><div class="empty">Loading</div></div>
|
<div id="trend-body" class="coop-trend-body"><div class="empty">Loading</div></div>
|
||||||
<p class="board-note" id="trend-note" style="margin:8px 0 0;"></p>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="board-note">Usage across the co-op, last 30 days</div>
|
<div class="board-note">Usage across the co-op, last 30 days</div>
|
||||||
<div style="display:flex; align-items:center; gap:10px; margin-bottom:10px;">
|
<div style="display:flex; align-items:center; gap:10px; margin-bottom:10px;">
|
||||||
@@ -808,12 +805,9 @@ let trendMetric = "members"; // members | requests | spend
|
|||||||
let trendDays = 90; // 0 = all time
|
let trendDays = 90; // 0 = all time
|
||||||
|
|
||||||
const TREND_CONF = {
|
const TREND_CONF = {
|
||||||
members: { kind: "line", title: "The co-op over time",
|
members: { kind: "line", title: "The co-op over time" },
|
||||||
note: "How many members the co-op has had, day by day. A gap means days that were never measured, not zero members." },
|
requests: { kind: "bar", title: "Requests the co-op served" },
|
||||||
requests: { kind: "bar", title: "Requests the co-op served",
|
spend: { kind: "bar", title: "What the co-op spent" }
|
||||||
note: "AI requests served to members each day. Days we did not record are gaps, not zeroes." },
|
|
||||||
spend: { kind: "bar", title: "What the co-op spent",
|
|
||||||
note: "Spend charged to the co-op each day, in US dollars. Days we did not record are gaps, not zeroes." }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
async function loadMetrics() {
|
async function loadMetrics() {
|
||||||
@@ -882,10 +876,8 @@ function renderTrends() {
|
|||||||
const have = vals.filter(v => v !== null && v !== undefined);
|
const have = vals.filter(v => v !== null && v !== undefined);
|
||||||
if (have.length < 2) {
|
if (have.length < 2) {
|
||||||
host.innerHTML = "<div class=empty>Not enough history yet.</div>";
|
host.innerHTML = "<div class=empty>Not enough history yet.</div>";
|
||||||
$("trend-sub").textContent = "";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const gaps = vals.length - have.length;
|
|
||||||
const maxV = Math.max.apply(null, have);
|
const maxV = Math.max.apply(null, have);
|
||||||
const step = niceStep((maxV <= 0 ? 1 : maxV * 1.08) / 4);
|
const step = niceStep((maxV <= 0 ? 1 : maxV * 1.08) / 4);
|
||||||
const top = step * 4;
|
const top = step * 4;
|
||||||
@@ -941,8 +933,6 @@ function renderTrends() {
|
|||||||
}
|
}
|
||||||
parts.push("</svg>");
|
parts.push("</svg>");
|
||||||
host.innerHTML = parts.join("");
|
host.innerHTML = parts.join("");
|
||||||
$("trend-sub").textContent = rows.length + " days" + (gaps > 0 ? " - " + gaps + " not measured" : "");
|
|
||||||
$("trend-note").textContent = conf.note;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let usageMode = 'mine'; // 'mine' | 'coop'
|
let usageMode = 'mine'; // 'mine' | 'coop'
|
||||||
|
|||||||
Reference in new issue
Block a user