Make the comment rotation interval configurable
CI / Deploy / test (push) Successful in 50s
CI / Deploy / deploy (push) Skipped

Scale slides get the setting comment_interval (seconds per comment,
one of Slide::COMMENT_INTERVALS, default 8). The presenter state
carries it as results.commentInterval and the rotating comments use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-08 20:13:49 +01:00
1 parent cfb445123e
commit 2301f91457
7 files changed
+66 -5

No files matched your search

+13 -2
View File
@@ -304,7 +304,11 @@
items: [],
node: null,
render: function (items) {
/**
* @param {Array} items comments, oldest first
* @param {number} [seconds] time per comment (slide setting), default 8
*/
render: function (items, seconds) {
// A different first comment means a different slide (or a reset): start over.
var key = String(items[0].id);
if (key !== Comments.key) {
@@ -312,6 +316,13 @@
Comments.index = 0;
Comments.paused = false;
}
var intervalMs = seconds > 0 ? seconds * 1000 : 8000;
if (intervalMs !== Comments.intervalMs) {
// Setting changed (or another slide): apply it right away.
Comments.intervalMs = intervalMs;
clearInterval(Comments.timer);
Comments.timer = null;
}
Comments.items = items;
Comments.index = Math.min(Comments.index, items.length - 1);
@@ -518,7 +529,7 @@
]),
gauge
]);
var comments = results.comments && results.comments.length ? Comments.render(results.comments) : null;
var comments = results.comments && results.comments.length ? Comments.render(results.comments, results.commentInterval) : null;
return el('div', { class: 'scale-results' }, [average, columns, labels, comments]);
},