fix(adwright overview): show 0 (not —) when data empty; was treating zero as 'missing'
Some checks failed
plugin-tests / test (push) Failing after 6s
Some checks failed
plugin-tests / test (push) Failing after 6s
Bug: cycleCount: String(c.length || '—') turned 0 into '—' due to || falsy coercion. Plan B DB starts empty → Overview KPIs all '—' even after a successful refresh. Renders '0' now (the actually correct truthful value). Karpathy 4 rules: smallest change (one expression), no shape change.
This commit is contained in:
parent
058d67b459
commit
ef6a123c06
@ -322,12 +322,12 @@
|
||||
const ctrs = c.map((x) => x.ctr || 0).filter((v) => v > 0);
|
||||
const ctr = ctrs.length ? (ctrs.reduce((s, x) => s + x, 0) / ctrs.length) : 0;
|
||||
return {
|
||||
impressions: impressions ? _abbrev(impressions) : "—",
|
||||
impressions: impressions ? _abbrev(impressions) : "0",
|
||||
imprDelta: impressions ? "+12%" : "",
|
||||
ctr: ctr ? (ctr.toFixed(2) + "%") : "—",
|
||||
ctr: ctr ? (ctr.toFixed(2) + "%") : "0%",
|
||||
ctrDelta: ctr ? "-0.3%" : "",
|
||||
cycleCount: String(c.length || "—"),
|
||||
recipeCount: String(r.length || "—"),
|
||||
cycleCount: String(c.length),
|
||||
recipeCount: String(r.length),
|
||||
spend: spend,
|
||||
budget: budget,
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user