Skip to content

Commit 3655bb5

Browse files
committed
feat(site): show the verified rate per product alongside per record
Most smartphone records are regional and RAM variants of one phone, and no source documents an individual SKU, so the per-record figure reads lower than how well the products in the dataset are actually sourced. The homepage now shows both readings of the same verifications, the per-product one as a secondary line under the headline. The block removes itself when the snapshot predates the field rather than rendering a zero. Refs #1
1 parent e3bce7e commit 3655bb5

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

site/src/pages/index.astro

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,13 @@ const endpoints = [
275275
<div class="verify-pct" id="verify-pct">—</div>
276276
<div class="verify-pct-l">records verified<br /><span id="verify-count">loading…</span></div>
277277
</div>
278+
<!-- Most smartphone records are regional/RAM variants of one phone,
279+
and no source documents an individual SKU — so the same
280+
verifications are also shown per product. -->
281+
<div class="verify-headline verify-models">
282+
<div class="verify-pct" id="verify-models-pct">—</div>
283+
<div class="verify-pct-l">models verified<br /><span id="verify-models-count">loading…</span></div>
284+
</div>
278285
<div class="verify-bar" id="verify-bar" role="img" aria-label="Verification band distribution">
279286
<span class="vb green" style="width:0%"></span>
280287
<span class="vb yellow" style="width:0%"></span>

site/src/scripts/techapi.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,20 @@ function countUp(node, target, opts = {}) {
500500

501501
countEl.textContent = `${(t.verified || 0).toLocaleString()} / ${total.toLocaleString()}`;
502502

503+
// Same verifications counted per product. Older snapshots predate the
504+
// field, so the block only appears once the numbers are actually there.
505+
const mTotal = t.models || 0;
506+
const mPctEl = document.getElementById("verify-models-pct");
507+
if (mPctEl && mTotal) {
508+
const mPct = t.verified_models_pct != null
509+
? t.verified_models_pct : (t.verified_models || 0) / mTotal * 100;
510+
mPctEl.textContent = mPct.toFixed(1) + "%";
511+
setText("verify-models-count",
512+
`${(t.verified_models || 0).toLocaleString()} / ${mTotal.toLocaleString()}`);
513+
} else if (mPctEl) {
514+
mPctEl.closest(".verify-models")?.remove();
515+
}
516+
503517
const g = t.green || 0, y = t.yellow || 0, r = t.red || 0;
504518
const sum = Math.max(1, g + y + r);
505519
const seg = bar.querySelectorAll(".vb");

site/src/styles/techapi.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,10 @@ section.block { padding: 76px 0; border-top: 1px solid var(--border); }
509509
.verify-pct { font-family: var(--mono); font-size: clamp(40px, 6vw, 60px); font-weight: 700; line-height: 1; letter-spacing: -.03em; color: var(--vg); }
510510
.verify-pct-l { color: var(--muted); font-size: 13px; line-height: 1.5; }
511511
.verify-pct-l span { color: var(--fg-2); font-family: var(--mono); }
512+
/* The per-product figure is the same verifications seen another way, so it sits
513+
under the headline as a secondary reading rather than competing with it. */
514+
.verify-models { margin-top: 14px; }
515+
.verify-models .verify-pct { font-size: clamp(24px, 3.4vw, 34px); color: var(--fg-2); }
512516
.verify-bar { display: flex; height: 14px; margin-top: 24px; border-radius: 4px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); }
513517
.verify-bar .vb { height: 100%; transition: width .9s cubic-bezier(.2,.7,.2,1); }
514518
.verify-bar .vb.green { background: var(--vg); }

0 commit comments

Comments
 (0)