Files
threshing-atlas/scripts/qa/mapcheck.js
T
ekcSchianoandClaude Opus 5.5 7366af2f7d Release pass: wording, colour-blind-safe colours, map visibility, phone layout
Walked every tab on desktop and phone, clicked every link and button:
- Colours: new map inks and page colours, checked with simulated
  protanopia/deuteranopia/tritanopia (worst pair ~12 CIEDE2000, was 1.4 for
  Red/Green on the map and 9.7 for Orange/Brown on the page). Map label text
  is always dark ink; dragon colour goes on borders. docs/COLOURS.md and
  research/python/check_colours.py.
- Valley map: dragons get a paper halo and a visibility floor (faded ones never
  drop below 0.3; bonding dragons start at 0.5); "no shadow" roll labelled
  correctly.
- Wording: methods updated (strata, the newer form's questions, missing
  answers, a new section on the solver, The Odds cards and genuine attempts);
  findings use readable factor names and no longer claim a date adjustment;
  'Load a newer route export above'; code links include solver.js and
  explorer.js; The Odds shows 93% instead of '1 in 1'.
- Deep Dive route map treats all six dragons alike ('Bond a dragon' row,
  default 'Bond any dragon'; rare sightings separate).
- Phone: Deep Dive no longer overflows (sections and selects can shrink).
- scripts/qa/crawl.js and mapcheck.js for future release checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
2026-11-02 17:57:51 +00:00

42 lines
2.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Valley map QA: for idle and every dragon/route, find text or labels that overlap, fall outside the map, or are too faint.
const { chromium } = require("playwright");
const OUT = process.argv[2];
(async () => {
const b = await chromium.launch();
const p = await b.newPage({ viewport: { width: 1440, height: 1000 } });
const states = [["idle", "#valley"]];
for (const c of ["red", "orange", "brown", "green", "blue", "black"]) states.push([c, "#valley/" + c]);
const extra = { blue: ["shadow-Blue"], red: ["tree-Red"], orange: ["tree-Greens"], brown: ["tree-Greens"] };
for (const [c, encs] of Object.entries(extra)) encs.forEach((e) => states.push([c + "/" + e, `#valley/${c}/${e}`]));
for (const [name, hash] of states) {
await p.goto("http://localhost:8765/" + hash); await p.waitForTimeout(1800);
const res = await p.evaluate(() => {
const svg = document.querySelector("#ex-map"), S = svg.getBoundingClientRect();
const items = [];
svg.querySelectorAll("text").forEach((t) => {
const r = t.getBoundingClientRect();
if (!r.width) return;
// walk up for opacity
let op = 1; for (let e = t; e && e !== svg; e = e.parentElement) op *= parseFloat(getComputedStyle(e).opacity || 1) * parseFloat(e.getAttribute("fill-opacity") || 1);
items.push({ kind: "text", txt: t.textContent.trim(), r: { l: r.left, t: r.top, rr: r.right, b: r.bottom }, op });
});
const out = [], over = [];
items.forEach((a) => { if (a.r.l < S.left - 1 || a.r.rr > S.right + 1 || a.r.t < S.top - 1 || a.r.b > S.bottom + 1) out.push(a.txt); });
for (let i = 0; i < items.length; i++) for (let j = i + 1; j < items.length; j++) {
const A = items[i].r, B = items[j].r;
const ix = Math.min(A.rr, B.rr) - Math.max(A.l, B.l), iy = Math.min(A.b, B.b) - Math.max(A.t, B.t);
if (ix > 3 && iy > 3 && items[i].txt !== items[j].txt) over.push(`"${items[i].txt}" × "${items[j].txt}"`);
}
const dragons = [...svg.querySelectorAll(".ex-dragon")].map((d) => ({ l: d.getAttribute("aria-label") || "twin", op: +d.getAttribute("opacity") })).filter((d) => d.op < 0.3);
const card = document.querySelector(".ex-route-card.on");
return { out, over, faint: dragons.map((d) => `${d.l.split(".")[0]} ${d.op}`), focus: card ? card.innerText.split("\n")[0] : "" };
});
console.log(`\n[${name}] ${res.focus}`);
if (res.out.length) console.log(" outside:", res.out.join(" | "));
if (res.over.length) console.log(" overlaps:", [...new Set(res.over)].join(" | "));
if (res.faint.length) console.log(" faint (<0.3):", res.faint.join(" | "));
await p.locator("#ex-map").screenshot({ path: `${OUT}/map-${name.replace("/", "_")}.png` });
}
await b.close();
})();