diff --git a/internal/check-packet-render.mjs b/internal/check-packet-render.mjs index 8eb8bffc7..1c23a9b99 100644 --- a/internal/check-packet-render.mjs +++ b/internal/check-packet-render.mjs @@ -368,7 +368,15 @@ const r = await page.evaluate(() => { .filter((e) => { const r = e.getBoundingClientRect(); return r.width < 4 || r.height < 4 }).length, rhythms: RHYTHMS.filter((w) => body.includes(w)).length, rhythmsTotal: RHYTHMS.length, - wheelSegs: document.querySelectorAll('svg path[fill^="hsl"]').length, + // The segments are the wheel sheet's filled ARC paths (M centre L rim A …), whatever their colour notation: + // counting fill^="hsl" read 0 once the wheel took the source's hex palette, and the gate went red on every + // packet while the wheel was fine. The "Start here" arrow is a path too, but unfilled and arc-less. + wheelSegs: (() => { + const title = document.querySelector('.wheel-title') + const svg = title ? title.closest('.sheet')?.querySelector('svg') : null + return svg ? [...svg.querySelectorAll('path')].filter((p) => / A /.test(p.getAttribute('d') || '') + && (p.getAttribute('fill') || 'none') !== 'none').length : 0 + })(), // ⚠ COUNT THE WHEEL'S OWN LABELS, SCOPED TO THE WHEEL SHEET. `rhythms` below // searches document.body.innerText, and the SAME rhythm vocabulary is rendered // TWICE — once per wheel segment, and once per prayer point (each point prints @@ -389,11 +397,11 @@ const r = await page.evaluate(() => { const sheet = title ? title.closest('.sheet') : null const svg = sheet ? sheet.querySelector('svg') : null if (!svg) return -1 - // The segment labels are the non-numeric runs: the pips are all "5" and - // the footer reads "5 x 12". - return [...svg.querySelectorAll('text')] - .map((t) => (t.textContent || '').trim()) - .filter((s) => s && !/^\d+$/.test(s) && !/^\d[\s\S]*×\s*12$/.test(s)).length + // The segment labels are the wheel's own label runs (class="wheel-label", packet-render wheelPage), counted + // when they carry words. Counting every non-numeric read 25 once each rim badge gained its + // "minutes" tag and the wheel its "Start here": those are furniture, not segment labels. + return [...svg.querySelectorAll('text.wheel-label')] + .filter((t) => (t.textContent || '').trim()).length })(), // ⚠ NOT body.includes('Gadarenes'). That was an ENGLISH proper noun, so this // assertion would go RED on a correctly-translated packet and stays green today