From ef6a123c06b3e2dc126096ee9465a943512ddf58 Mon Sep 17 00:00:00 2001 From: Svrnty Date: Sun, 24 May 2026 14:45:20 -0400 Subject: [PATCH] =?UTF-8?q?fix(adwright=20overview):=20show=200=20(not=20?= =?UTF-8?q?=E2=80=94)=20when=20data=20empty;=20was=20treating=20zero=20as?= =?UTF-8?q?=20'missing'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- static/adwright.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/adwright.js b/static/adwright.js index 212ea76..60d44d8 100644 --- a/static/adwright.js +++ b/static/adwright.js @@ -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, };