money chart: drop the caveat caption and the history-start legend note
The operator removed all caveats from the finance chart. Gone: the money-caption element, the caveat/stale/errors caption rendering, the .legend 'history begins' suffix and the orphaned CSS. Chart, legend keys, series and toggles untouched; balance_history_start stays in the payload. Harness now asserts no caveat text renders in any mode.
This commit is contained in:
1 parent
02fdd9f51c
commit
2904a4c2f8
2 files changed
+18
-16
No files matched your search
+5
-14
@@ -307,13 +307,11 @@ PAGE_HTML = """<!DOCTYPE html>
|
||||
.chart-tip .tip-row { display: flex; justify-content: space-between; gap: 14px; }
|
||||
.chart-tip .tip-row span { color: var(--muted); }
|
||||
.chart-tip .tip-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
|
||||
/* Money chart: legend keys + the honest-data caption. The caption is a
|
||||
deliberate exception to the no-caption rule for the Trends charts: the
|
||||
operator asked for the data-history limits to be stated IN this chart. */
|
||||
/* Money chart: legend keys. No caption — charts carry no explanatory text
|
||||
under them (the chart rule). */
|
||||
.money-legend { display: inline-flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-weight: 600; }
|
||||
.money-legend .key { display: inline-flex; align-items: center; gap: 5px; }
|
||||
.money-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
|
||||
.money-caption { color: var(--muted); font-size: 11px; margin: 8px 0 0; }
|
||||
@media (max-width: 600px) { .trend-controls { gap: 10px; } .trend-card { padding: 12px 10px; } }
|
||||
.num { font-variant-numeric: tabular-nums; }
|
||||
.remaining-col { font-weight: 700; color: var(--green-deep); background: #eaf3ea; }
|
||||
@@ -445,7 +443,6 @@ PAGE_HTML = """<!DOCTYPE html>
|
||||
<span id="money-legend" class="money-legend"></span>
|
||||
</div>
|
||||
<div id="money-body" class="trend-body"><p class="trend-empty">Loading</p></div>
|
||||
<p class="money-caption" id="money-caption"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -812,7 +809,8 @@ function renderTrends() {
|
||||
// One fetch at full range; the period and spend-mode toggles re-render
|
||||
// client-side. The balance series exists only from the daily-snapshot
|
||||
// deployment date onward (the OC API exposes just the CURRENT balance), so
|
||||
// it renders as a gap before that and the caption says so — never a zero.
|
||||
// it renders as a gap before that — never a zero. No caption under the chart:
|
||||
// the data explains itself (the operator dropped the balance-history caveat).
|
||||
let moneyData = null;
|
||||
let moneyLoaded = false;
|
||||
let moneyPeriod = 90; // 0 = all time
|
||||
@@ -898,12 +896,6 @@ function renderMoney() {
|
||||
const host = $("money-body");
|
||||
if (!host || !moneyData) return;
|
||||
hideChartTip();
|
||||
// The honest-limits caption, required by the operator: the payload carries
|
||||
// the balance-history caveat and any per-source failures.
|
||||
let cap = moneyData.caveat || "";
|
||||
if (moneyData.stale) cap = "(cached — last refresh failed) " + cap;
|
||||
if (moneyData.errors && moneyData.errors.length) cap += " Series unavailable: " + moneyData.errors.join("; ") + ".";
|
||||
$("money-caption").textContent = cap;
|
||||
renderMoneyLegend();
|
||||
const all = moneyData.series || [];
|
||||
const rows = moneyPeriod === 0 ? all : all.slice(-moneyPeriod);
|
||||
@@ -918,8 +910,7 @@ function renderMoneyLegend() {
|
||||
{ c: MONEY_COLORS.spend, t: moneySpendMode === "daily" ? "Token spend — daily" : "Token spend — cumulative" }
|
||||
];
|
||||
if (moneySpendMode !== "daily") {
|
||||
const start = moneyData.balance_history_start;
|
||||
items.push({ c: MONEY_COLORS.balance, t: "OC balance" + (start ? " — history begins " + start : "") });
|
||||
items.push({ c: MONEY_COLORS.balance, t: "OC balance" });
|
||||
}
|
||||
$("money-legend").innerHTML = items.map(it =>
|
||||
'<span class="key"><span class="sw" style="background:' + it.c + '"></span>' + esc(it.t) + '</span>'
|
||||
|
||||
Reference in new issue
Block a user