Merge branch 'fix/hub-speech-bubbles-hidden' into unify/skills-20261114

# Conflicts:
#	orchestrator/templates/page-bubbles.js
#	orchestrator/templates/page-speech.js
#	tests/test_hub_bubbles.py
This commit is contained in:
Kevin Veen-Birkenbach committed 2026-11-14 21:53:37 +00:00
commit 50bfed6751
10 files changed
+719 -26

No files matched your search

+31 -12
View File
@@ -41,8 +41,11 @@
}
}
function say(item) {
speech.pending = Voice.enqueue(speech.pending, item, SPEECH_QUEUE);
/**
* @param {...object} items the rows to read aloud.
*/
function say(...items) {
speech.pending = items.reduce((pending, item) => Voice.enqueue(pending, item, SPEECH_QUEUE), speech.pending);
pump();
drawBubbles();
}
@@ -70,8 +73,11 @@
speech.current = item;
speech.timer = window.setTimeout(() => {
Object.assign(speech, {current: null, timer: 0, item: null});
drawSpeaker();
next();
try {
drawSpeaker();
} finally {
next();
}
}, Math.max(0, item.started + item.duration * 1000 - performance.now()));
drawSpeaker();
}
@@ -257,8 +263,11 @@
readSilently(item, next);
return;
}
drawSpeaker();
next();
try {
drawSpeaker();
} finally {
next();
}
}
function cancelSpeech() {
@@ -274,14 +283,24 @@
drawSpeaker();
}
function speakRows(rows) {
for (const row of rows.filter((entry) => entry.ts >= state.now - SPEECH_FRESH)) {
const steps = RadioSet.plan(row, radioSet, liveSpeech());
if (steps.length || (settings.bubbles && Bubbles.picked(row, radioSet))) {
const line = row.text.split("\n").map((part) => part.trim()).find(Boolean) || "";
say({row, voice: row.voice, tone: Voice.toneOf(row, HUMAN), cls: row.class, who: row.source, sent: Boolean(RadioSet.ledgerOf(row, state.messages)), line: short(line), words: Bubbles.words(row.text), silent: !steps.length});
/**
* @param {Array<object>} rows the radio rows the page has not announced yet.
* @param {boolean} arrived whether they arrived while the page polled without a gap.
*/
function speakRows(rows, arrived) {
const [spoken, quiet] = [[], []];
for (const row of rows) {
const fresh = row.ts >= state.now - SPEECH_FRESH;
const steps = fresh ? RadioSet.plan(row, radioSet, liveSpeech()) : [];
const line = short(row.text.split("\n").map((part) => part.trim()).find(Boolean) || "");
if (fresh && (steps.length || (settings.bubbles && Bubbles.picked(row, radioSet)))) {
spoken.push({row, voice: row.voice, tone: Voice.toneOf(row, HUMAN), cls: row.class, who: row.source, sent: Boolean(RadioSet.ledgerOf(row, state.messages)), line, words: Bubbles.words(row.text), silent: !steps.length});
} else if (settings.bubbles && arrived && row.ts >= state.now - LIVE_GAP) {
quiet.push({who: row.source, cls: row.class, line, words: Bubbles.words(line), quiet: true});
}
}
quietBubbles(quiet);
say(...spoken);
}
function micGap() {