check:packet-render counts the prayer wheel the way it is drawn now: its filled arc segments and its wheel-label runs
The wheel took the source's hex palette, rim badges with a minutes tag and a Start-here mark; the gate still counted fill^=hsl paths (0) and every non-numeric text (25), so it failed every packet with a correct wheel, the pilot's included. Two-sided: PASS on the lightweight packet in en and ar; FAIL on a copy with the segment labels blanked (0 labels) and on one with the segments unfilled (0 segments).
This commit is contained in:
parent
8dcbba6dbe
commit
b95607cadc
1 changed files with 14 additions and 6 deletions
|
|
@ -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 <text> runs: the pips are all "5" and
|
||||
// the footer reads "5 <minutes> 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 <text> 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
|
||||
|
|
|
|||
Loading…
Reference in a new issue