From 0660affb56697e8c9c0a38347f5524826e44b1fe Mon Sep 17 00:00:00 2001 From: Patrick Niebeling Date: Wed, 11 Nov 2026 13:59:40 +0100 Subject: [PATCH 1/3] Show the rating above the comment text The rating has the same height for every comment, so above the text it stays in place while the comments rotate; only the text changes. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 2 +- webroot/css/plenario.css | 4 ++-- webroot/js/plenario.js | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 5efd33d..71d2cba 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -225,7 +225,7 @@ tests/ PHPUnit; PlenarioTestTrait erzeugt Testdaten, Fixtures `Comments.delay()` = 2,5 s + 15 Zeichen/s, 5–30 s, geteilt durch das Tempo der Umfrage `polls.comment_speed` (Prozent aus `Poll::COMMENT_SPEEDS`, im State `poll.commentSpeed` als Faktor, Dashboard → „Einstellungen“); Vor/Zurück/Fortsetzen geben dem Kommentar wieder die volle Zeit; „Kommentar X von N“, vor/zurück/Pause, Laufbalken bis zum Wechsel (`Comments.progress()`, setzt nach dem Neu-Rendern per negativem - `animation-delay` fort, bei Pause unsichtbar), Zustand übersteht das Neu-Rendern beim Polling; die Box ist so hoch wie der längste Kommentar – alle liegen unsichtbar in derselben Grid-Zelle –, damit die zentrierte Bühne beim Wechsel nicht springt; höchstens `--comment-max` ≈ 5 Zeilen, längere Kommentare setzt `Comments.fit()` kleiner statt sie abzuschneiden). Bei internem Feedback erscheinen sie erst, + `animation-delay` fort, bei Pause unsichtbar), Zustand übersteht das Neu-Rendern beim Polling; die Box ist so hoch wie der längste Kommentar – alle liegen unsichtbar in derselben Grid-Zelle –, damit die zentrierte Bühne beim Wechsel nicht springt; höchstens `--comment-max` ≈ 5 Zeilen, längere Kommentare setzt `Comments.fit()` kleiner statt sie abzuschneiden; die Bewertung steht über dem Text, damit sie an fester Stelle bleibt). Bei internem Feedback erscheinen sie erst, wenn der Presenter die Ergebnisse einblendet. - **Sterne-Bewertung** (Skala mit Setting `style = stars`, `Slide::isStarRating()`, Standard `numbers`): immer 1 bis `scale_max` Sterne (`SlidesTable::sanitizeSettings()` erzwingt `scale_min = 1`), gespeichert wie jede Skala als `numeric_value`. diff --git a/webroot/css/plenario.css b/webroot/css/plenario.css index 59c981a..c0af4b4 100644 --- a/webroot/css/plenario.css +++ b/webroot/css/plenario.css @@ -585,13 +585,13 @@ button.qa-steps__step:hover:not(:disabled) { color: var(--text); border-color: v .comments__text { margin: 0; font-size: var(--comment-size); font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; } .comments__text::before { content: '„'; } .comments__text::after { content: '“'; } -.comments__value { margin: 6px 0 0; color: var(--muted); font-size: .9em; } +.comments__value { margin: 0 0 6px; color: var(--muted); font-size: .9em; } /* all comments share one grid cell (invisible sizers): the box keeps the height of the longest one */ .comments__body { display: grid; } .comments__body > * { grid-area: 1 / 1; min-width: 0; } .comments__sizer { visibility: hidden; } /* at most about 5 lines; longer comments are set smaller by Comments.fit() instead of being cut off */ -.comments { --comment-size: 1.25em; --comment-max: 11em; } +.comments { --comment-size: 1.25em; --comment-max: 9.5em; } .comments__sizer, .comments__current { max-height: var(--comment-max); overflow: hidden; } .comments__progress { height: 4px; margin-top: 14px; border-radius: 2px; background: var(--border); overflow: hidden; } .comments__progress[hidden] { display: block; visibility: hidden; } /* keeps the layout steady while paused */ diff --git a/webroot/js/plenario.js b/webroot/js/plenario.js index a93c93b..4fcac81 100644 --- a/webroot/js/plenario.js +++ b/webroot/js/plenario.js @@ -345,18 +345,18 @@ // Every comment sits invisibly in the same grid cell as the one shown, so the box is as // tall as the longest comment and the centred stage does not jump while they rotate. var sizers = items.length < 2 ? [] : items.map(function (item) { - var hasValue = item.value !== null && item.value !== undefined; return el('div', { class: 'comments__sizer', 'aria-hidden': 'true' }, [ - el('blockquote', { class: 'comments__text', text: item.text }), - hasValue ? el('p', { class: 'comments__value', text: 'Bewertung: ' + Comments.format(item.value) }) : null + el('blockquote', { class: 'comments__text', text: item.text }) ]); }); + // The rating (same height for every comment, all or none per slide) sits above the + // text, so it stays in place while the comments rotate. var node = el('section', { class: 'comments', 'data-comments': '', 'aria-label': 'Kommentare' }, [ el('p', { class: 'comments__counter', 'data-comment-counter': '' }), + el('p', { class: 'comments__value', 'data-comment-value': '' }), el('div', { class: 'comments__body' }, sizers.concat([ el('div', { class: 'comments__current' }, [ - el('blockquote', { class: 'comments__text', 'data-comment-text': '' }), - el('p', { class: 'comments__value', 'data-comment-value': '' }) + el('blockquote', { class: 'comments__text', 'data-comment-text': '' }) ]) ])), // Time left until the next comment; decorative, the counter carries the information. -- 2.54.1 From 12b10121ecaa768089190abd965be24ad26d9b22 Mon Sep 17 00:00:00 2001 From: Patrick Niebeling Date: Wed, 11 Nov 2026 14:00:43 +0100 Subject: [PATCH 2/3] Use the bottom edge of the comment box as progress bar The progress until the next comment no longer takes a row of its own; it runs along the bottom edge of the box. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 2 +- webroot/css/plenario.css | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 71d2cba..4438bf2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -225,7 +225,7 @@ tests/ PHPUnit; PlenarioTestTrait erzeugt Testdaten, Fixtures `Comments.delay()` = 2,5 s + 15 Zeichen/s, 5–30 s, geteilt durch das Tempo der Umfrage `polls.comment_speed` (Prozent aus `Poll::COMMENT_SPEEDS`, im State `poll.commentSpeed` als Faktor, Dashboard → „Einstellungen“); Vor/Zurück/Fortsetzen geben dem Kommentar wieder die volle Zeit; „Kommentar X von N“, vor/zurück/Pause, Laufbalken bis zum Wechsel (`Comments.progress()`, setzt nach dem Neu-Rendern per negativem - `animation-delay` fort, bei Pause unsichtbar), Zustand übersteht das Neu-Rendern beim Polling; die Box ist so hoch wie der längste Kommentar – alle liegen unsichtbar in derselben Grid-Zelle –, damit die zentrierte Bühne beim Wechsel nicht springt; höchstens `--comment-max` ≈ 5 Zeilen, längere Kommentare setzt `Comments.fit()` kleiner statt sie abzuschneiden; die Bewertung steht über dem Text, damit sie an fester Stelle bleibt). Bei internem Feedback erscheinen sie erst, + `animation-delay` fort, bei Pause unsichtbar), Zustand übersteht das Neu-Rendern beim Polling; die Box ist so hoch wie der längste Kommentar – alle liegen unsichtbar in derselben Grid-Zelle –, damit die zentrierte Bühne beim Wechsel nicht springt; höchstens `--comment-max` ≈ 5 Zeilen, längere Kommentare setzt `Comments.fit()` kleiner statt sie abzuschneiden; die Bewertung steht über dem Text, damit sie an fester Stelle bleibt; der Fortschrittsbalken ist die Unterkante der Box). Bei internem Feedback erscheinen sie erst, wenn der Presenter die Ergebnisse einblendet. - **Sterne-Bewertung** (Skala mit Setting `style = stars`, `Slide::isStarRating()`, Standard `numbers`): immer 1 bis `scale_max` Sterne (`SlidesTable::sanitizeSettings()` erzwingt `scale_min = 1`), gespeichert wie jede Skala als `numeric_value`. diff --git a/webroot/css/plenario.css b/webroot/css/plenario.css index c0af4b4..439b4b7 100644 --- a/webroot/css/plenario.css +++ b/webroot/css/plenario.css @@ -580,7 +580,7 @@ button.qa-steps__step:hover:not(:disabled) { color: var(--text); border-color: v .own-comment__edit { margin-top: 12px; } .own-comment__edit summary { cursor: pointer; color: var(--muted); width: max-content; max-width: 100%; } .own-comment__edit summary:hover { color: var(--text); } -.comments { margin-top: 20px; padding: 16px 20px; background: var(--surface-2); border-radius: 14px; } +.comments { position: relative; overflow: hidden; margin-top: 20px; padding: 16px 20px; background: var(--surface-2); border-radius: 14px; } .comments__counter { margin: 0 0 6px; font-size: .85em; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-variant-numeric: tabular-nums; } .comments__text { margin: 0; font-size: var(--comment-size); font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; } .comments__text::before { content: '„'; } @@ -593,8 +593,9 @@ button.qa-steps__step:hover:not(:disabled) { color: var(--text); border-color: v /* at most about 5 lines; longer comments are set smaller by Comments.fit() instead of being cut off */ .comments { --comment-size: 1.25em; --comment-max: 9.5em; } .comments__sizer, .comments__current { max-height: var(--comment-max); overflow: hidden; } -.comments__progress { height: 4px; margin-top: 14px; border-radius: 2px; background: var(--border); overflow: hidden; } -.comments__progress[hidden] { display: block; visibility: hidden; } /* keeps the layout steady while paused */ +/* progress until the next comment: the bottom edge of the box, takes no room of its own */ +.comments__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--border); } +.comments__progress[hidden] { display: block; visibility: hidden; } /* paused: the edge stays plain */ .comments__progress-fill { height: 100%; background: var(--primary); transform: scaleX(0); transform-origin: left; } @keyframes comment-progress { from { transform: scaleX(0); } -- 2.54.1 From 7a378a0bc57a36108addb9f0e29a8b353392bbca Mon Sep 17 00:00:00 2001 From: Patrick Niebeling Date: Wed, 11 Nov 2026 14:03:12 +0100 Subject: [PATCH 3/3] Run the comment progress around the border of the box Two lines start at opposite corners (top left along the top, bottom right along the bottom) and meet when the next comment is due. Drawn as an SVG outline with pathLength 100 and a dash pattern repeating every half perimeter, so it follows the rounded corners. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 2 +- webroot/css/plenario.css | 17 +++++++++++------ webroot/js/plenario.js | 24 +++++++++++++++++++----- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 4438bf2..a558a61 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -225,7 +225,7 @@ tests/ PHPUnit; PlenarioTestTrait erzeugt Testdaten, Fixtures `Comments.delay()` = 2,5 s + 15 Zeichen/s, 5–30 s, geteilt durch das Tempo der Umfrage `polls.comment_speed` (Prozent aus `Poll::COMMENT_SPEEDS`, im State `poll.commentSpeed` als Faktor, Dashboard → „Einstellungen“); Vor/Zurück/Fortsetzen geben dem Kommentar wieder die volle Zeit; „Kommentar X von N“, vor/zurück/Pause, Laufbalken bis zum Wechsel (`Comments.progress()`, setzt nach dem Neu-Rendern per negativem - `animation-delay` fort, bei Pause unsichtbar), Zustand übersteht das Neu-Rendern beim Polling; die Box ist so hoch wie der längste Kommentar – alle liegen unsichtbar in derselben Grid-Zelle –, damit die zentrierte Bühne beim Wechsel nicht springt; höchstens `--comment-max` ≈ 5 Zeilen, längere Kommentare setzt `Comments.fit()` kleiner statt sie abzuschneiden; die Bewertung steht über dem Text, damit sie an fester Stelle bleibt; der Fortschrittsbalken ist die Unterkante der Box). Bei internem Feedback erscheinen sie erst, + `animation-delay` fort, bei Pause unsichtbar), Zustand übersteht das Neu-Rendern beim Polling; die Box ist so hoch wie der längste Kommentar – alle liegen unsichtbar in derselben Grid-Zelle –, damit die zentrierte Bühne beim Wechsel nicht springt; höchstens `--comment-max` ≈ 5 Zeilen, längere Kommentare setzt `Comments.fit()` kleiner statt sie abzuschneiden; die Bewertung steht über dem Text, damit sie an fester Stelle bleibt; der Fortschritt läuft als Rahmen der Box: `Comments.progressBorder()`, SVG-Rechteck mit `pathLength` 100, zwei Linien ab gegenüberliegenden Ecken). Bei internem Feedback erscheinen sie erst, wenn der Presenter die Ergebnisse einblendet. - **Sterne-Bewertung** (Skala mit Setting `style = stars`, `Slide::isStarRating()`, Standard `numbers`): immer 1 bis `scale_max` Sterne (`SlidesTable::sanitizeSettings()` erzwingt `scale_min = 1`), gespeichert wie jede Skala als `numeric_value`. diff --git a/webroot/css/plenario.css b/webroot/css/plenario.css index 439b4b7..1377bdf 100644 --- a/webroot/css/plenario.css +++ b/webroot/css/plenario.css @@ -593,13 +593,18 @@ button.qa-steps__step:hover:not(:disabled) { color: var(--text); border-color: v /* at most about 5 lines; longer comments are set smaller by Comments.fit() instead of being cut off */ .comments { --comment-size: 1.25em; --comment-max: 9.5em; } .comments__sizer, .comments__current { max-height: var(--comment-max); overflow: hidden; } -/* progress until the next comment: the bottom edge of the box, takes no room of its own */ -.comments__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--border); } -.comments__progress[hidden] { display: block; visibility: hidden; } /* paused: the edge stays plain */ -.comments__progress-fill { height: 100%; background: var(--primary); transform: scaleX(0); transform-origin: left; } +/* progress until the next comment: the border of the box, two lines from opposite corners + (pathLength 100, dash pattern repeating every half perimeter) that meet when the time is up */ +.comments__progress { position: absolute; inset: 0; pointer-events: none; } +.comments__progress[hidden] { display: block; visibility: hidden; } /* paused: no border */ +.comments__progress svg { display: block; width: 100%; height: 100%; } +.comments__progress-fill { + x: 2px; y: 2px; width: calc(100% - 4px); height: calc(100% - 4px); rx: 12px; + fill: none; stroke: var(--primary); stroke-width: 4px; stroke-dasharray: 0 50; +} @keyframes comment-progress { - from { transform: scaleX(0); } - to { transform: scaleX(1); } + from { stroke-dasharray: 0 50; } + to { stroke-dasharray: 50 0; } } .comments__nav { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; } .comments__button { min-width: 44px; min-height: 44px; } diff --git a/webroot/js/plenario.js b/webroot/js/plenario.js index 4fcac81..f3eea85 100644 --- a/webroot/js/plenario.js +++ b/webroot/js/plenario.js @@ -360,9 +360,7 @@ ]) ])), // Time left until the next comment; decorative, the counter carries the information. - items.length < 2 ? null : el('div', { class: 'comments__progress', 'data-comment-progress': '', 'aria-hidden': 'true' }, [ - el('div', { class: 'comments__progress-fill' }) - ]), + items.length < 2 ? null : Comments.progressBorder(), items.length < 2 ? null : el('div', { class: 'comments__nav' }, [ button('prev', 'Vorheriger Kommentar', '‹'), button('toggle', '', ''), @@ -459,6 +457,22 @@ }, Comments.duration); }, + /** + * Progress as the border of the box: an SVG outline (follows the rounded corners) whose + * dash pattern repeats every half perimeter, so two lines start at opposite corners + * (top left along the top, bottom right along the bottom) and meet when the time is up. + */ + progressBorder: function () { + var ns = 'http://www.w3.org/2000/svg'; + var svg = document.createElementNS(ns, 'svg'); + var rect = document.createElementNS(ns, 'rect'); + rect.setAttribute('class', 'comments__progress-fill'); + rect.setAttribute('pathLength', '100'); + rect.setAttribute('data-comment-progress-fill', ''); + svg.appendChild(rect); + return el('div', { class: 'comments__progress', 'data-comment-progress': '', 'aria-hidden': 'true' }, [svg]); + }, + /** * Fills the progress bar over the remaining time of the current comment. * Picks up where it was after a re-render (negative animation delay); hidden while paused. @@ -468,10 +482,10 @@ if (!bar) { return; } - var fill = bar.firstChild; + var fill = bar.querySelector('[data-comment-progress-fill]'); bar.hidden = Comments.paused; fill.style.animation = 'none'; - void fill.offsetWidth; // restart the CSS animation + void fill.getBoundingClientRect(); // restart the CSS animation (SVG has no offsetWidth) if (!Comments.paused) { var elapsed = Math.min(Date.now() - Comments.startedAt, Comments.duration); fill.style.animation = 'comment-progress ' + Comments.duration + 'ms linear -' + elapsed + 'ms forwards'; -- 2.54.1