live: header says "a visitor's run" instead of "run ?" (visitor runs have no cycle number); plain-words voice off by default while it's tested (?voice=1 to see it)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EandClaude Opus 5.5 committed 2026-10-02 16:23:29 -04:00
1 parent 6657eed351
commit 89d29cc12b
1 file changed
+6 -2
+6 -2
View File
@@ -743,7 +743,9 @@ function nameFor(n){
} }
function headerFor(n){ function headerFor(n){
const nick = nameFor(n); const nick = nameFor(n);
return "the subject" + (nick ? ` ("${nick}")` : "") + " · run " + (n ?? "?"); // visitor-triggered runs carry no cycle number (n is null): say so
return "the subject" + (nick ? ` ("${nick}")` : "")
+ (n == null ? " · a visitor's run" : " · run " + n);
} }
const API = (new URLSearchParams(location.search)).get("api") || "/chamber"; const API = (new URLSearchParams(location.search)).get("api") || "/chamber";
const cardsEl = document.getElementById("cards"); const cardsEl = document.getElementById("cards");
@@ -910,8 +912,10 @@ function clearVoice(outEl){
const v = outEl && outEl.nextElementSibling; const v = outEl && outEl.nextElementSibling;
if (v && v.classList.contains("voice")) v.remove(); if (v && v.classList.contains("voice")) v.remove();
} }
// under test: off unless the page is opened with ?voice=1
const VOICE_ON = new URLSearchParams(location.search).get("voice") === "1";
function showVoice(outEl, text){ function showVoice(outEl, text){
if (!outEl || !text || text.trim().length < 30) return; if (!VOICE_ON || !outEl || !text || text.trim().length < 30) return;
const esc = t => String(t ?? "").replace(/[&<>"]/g, c => const esc = t => String(t ?? "").replace(/[&<>"]/g, c =>
({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[c])); ({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[c]));
let v = outEl.nextElementSibling; let v = outEl.nextElementSibling;