fix(hub): show who speaks for the whole message, not per sound

Since acf3925 a row sounds in steps (class word, then the text), and
each step cleared speech.current at its end, so the caption, the
speaking faces and the graph node blinked off between steps. One
speaker() helper reads the current step or the item being transmitted;
the caption, the faces and the graph node use it. The speech queue and
the bubbles stay as they are.

🎯 Fix: 85 %
💥 Break: 5 %
💸 Tokens: –
⏱️ Velocity: –
🛡️ Security: 100 %
🏆 Score: 81
🚦 Gate: ⛔ fix 85 % < 90

Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-23 11:19:59 +00:00
1 parent ccc80f17c1
commit 12ba051998
3 files changed
+7 -3

No files matched your search

+5 -1
View File
@@ -73,7 +73,11 @@
}
const faceParts = (key) => Faces.of(key).parts.map(([tag, attrs]) => s(tag, attrs));
const talking = (key) => Boolean(speech.current && speech.current.who === key);
const speaker = () => {
const now = speech.current || speech.item;
return now && now.who ? now : null;
};
const talking = (key) => Boolean(speaker() && speaker().who === key);
const face = (who, big) => {
const key = agentKey(who);
return h("span", {class: `avatar${big ? " big" : ""}${talking(key) ? " speaking" : ""}`, "data-face": key, "aria-hidden": "true"},
+1 -1
View File
@@ -121,7 +121,7 @@
function nodeMark(node, at, gap) {
const r = RADIUS[node.kind];
const classes = ["node", `k-${node.kind}`, node.claims.length ? "claimed" : "", speech.current && speech.current.who === node.id ? "speaking" : ""].filter(Boolean).join(" ");
const classes = ["node", `k-${node.kind}`, node.claims.length ? "claimed" : "", talking(node.id) ? "speaking" : ""].filter(Boolean).join(" ");
const tasks = node.tasks.length ? ` · ${node.tasks.length} tasks` : "";
return s("g", {
class: classes, transform: `translate(${fixed(at.x)} ${fixed(at.y)})`, tabindex: 0, role: "button", "aria-label": `${node.label}, ${NODE_KINDS[node.kind]}`, "data-pick": node.id,
+1 -1
View File
@@ -102,7 +102,7 @@
}
function drawSpeaker() {
const now = speech.current && speech.current.who ? speech.current : null;
const now = speaker();
for (const art of document.querySelectorAll(".avatar[data-face]")) {
art.classList.toggle("speaking", Boolean(now && art.dataset.face === now.who));
}