From df6a406a89a06aaae08d7dffdd104a560786d98a Mon Sep 17 00:00:00 2001 From: openclaw-bot Date: Thu, 11 Jun 2026 06:11:40 +0000 Subject: [PATCH] test(1648): M2 emoji scan + sprite extension (red) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add failing emoji/misc-icon scan for M2 surfaces (analytics, nodes, packets, live, map, node-analytics, traces, perf, audio-lab) plus the 48 new Phosphor symbols needed for the M2 swaps. Test FAILS today by construction — every named M2 file still contains emoji codepoints. Red proof for #1648 M2 (Partial fix; tracker stays open). --- public/icons/phosphor-sprite.svg | 56 ++++++++++- test-all.sh | 1 + test-issue-1648-m2-emoji-scan.js | 156 +++++++++++++++++++++++++++++++ 3 files changed, 209 insertions(+), 4 deletions(-) create mode 100644 test-issue-1648-m2-emoji-scan.js diff --git a/public/icons/phosphor-sprite.svg b/public/icons/phosphor-sprite.svg index 67c5c3da..c1d31db6 100644 --- a/public/icons/phosphor-sprite.svg +++ b/public/icons/phosphor-sprite.svg @@ -1,36 +1,84 @@ \ No newline at end of file + + diff --git a/test-all.sh b/test-all.sh index b67c7dca..56b2dabb 100755 --- a/test-all.sh +++ b/test-all.sh @@ -29,6 +29,7 @@ node test-issue-1409-no-encrypted-flood.js node test-analytics-channels-integration.js node test-observers-headings.js node test-issue-1648-m1-emoji-scan.js +node test-issue-1648-m2-emoji-scan.js node test-traces.js # #1418 — route-view v2 (Tufte) coverage diff --git a/test-issue-1648-m2-emoji-scan.js b/test-issue-1648-m2-emoji-scan.js new file mode 100644 index 00000000..c8163e75 --- /dev/null +++ b/test-issue-1648-m2-emoji-scan.js @@ -0,0 +1,156 @@ +#!/usr/bin/env node +/* Issue #1648 — M2: emoji → Phosphor sprite migration (static scan). + * + * M2 covers page headers + table chrome surfaces: + * analytics.js, nodes.js, packets.js, live.js, map.js, + * node-analytics.js, traces.js, perf.js, audio-lab.js + * + * Asserts (per file): + * 1. Zero UI-iconography codepoints (U+1F300–1FAFF, U+2600–27BF, and + * Misc-Symbols: ◆●■▲★☆○✓✗⚠✉) outside an allowlist of contexts that are + * not UI iconography (CSS comments, JS comments referencing prior + * glyphs, console.log/debug strings, and explicitly tagged + * // EMOJI-OK lines). + * 2. At least N !txt.includes(`id="${id}"`)); + if (missing.length) throw new Error(`sprite missing M2 symbols: ${missing.join(', ')}`); +} + +function main() { + let failed = 0; + console.log('— Issue #1648 M2 — emoji/misc-icon scan'); + + try { + assertSpriteHasM2Icons(); + console.log(' ✓ sprite has required M2 symbols'); + } catch (e) { + console.error(` ✗ ${e.message}`); + failed++; + } + + for (const rel of M2_FILES) { + const hits = scanFile(rel); + if (hits.length === 0) { + console.log(` ✓ ${rel} clean (no emoji / misc-icon iconography)`); + } else { + console.error(` ✗ ${rel} has ${hits.length} emoji/misc-icon hit(s):`); + for (const h of hits.slice(0, 30)) console.error(` ${h.file}:${h.line} [${h.kind}] ${h.text}`); + if (hits.length > 30) console.error(` … (+${hits.length - 30} more)`); + failed++; + } + const useRefs = countUseRefs(rel); + const min = MIN_USE_REFS[rel] || 1; + if (useRefs < min) { + console.error(` ✗ ${rel} has only ${useRefs} refs (expected ≥${min})`); + failed++; + } else { + console.log(` ✓ ${rel} has ${useRefs} Phosphor refs (≥${min})`); + } + // Hard assertion (separate from logging) — file must be clean AND have enough swaps. + assert.strictEqual(hits.length, 0, + `${rel} must contain zero emoji/misc-icon iconography (got ${hits.length} hit(s))`); + assert.ok(useRefs >= min, + `${rel} must have ≥${min} refs (got ${useRefs})`); + } + + if (failed) { + console.error(`\nFAIL: ${failed} M2 check(s) failed`); + process.exit(1); + } + console.log('\nPASS: all M2 surfaces icon-free and Phosphor-swapped'); +} + +main();