Add hiding slides from the presentation
CI / Deploy / test (push) Successful in 57s
CI / Deploy / deploy (push) Skipped

Hidden slides stay prepared in the dashboard but are skipped when
presenting (start, next/prev, goto), can not go live via embed and are
left out of the PDF export. Hiding the live or paused slide pauses the
poll like deleting it and resumes with the next visible slide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-11 15:25:41 +01:00
1 parent e2f24877dd
commit 3c978e6f22
15 files changed
+333 -35

No files matched your search

+4 -1
View File
@@ -83,7 +83,8 @@ class PollStateService
public function forPresenter(Poll $poll): array
{
$this->Polls->pauseIfEmbedStale($poll);
$slides = $this->Slides->listForPoll($poll->id);
// The presentation consists of the visible slides only.
$slides = $this->Slides->listForPoll($poll->id, true);
$current = null;
$index = null;
foreach ($slides as $i => $slide) {
@@ -102,6 +103,7 @@ class PollStateService
], $slides),
'index' => $index,
'count' => count($slides),
'hiddenCount' => $this->Slides->find()->where(['poll_id' => $poll->id, 'is_hidden' => true])->count(),
'slide' => $current ? $this->slidePayload($current) : null,
'results' => $current ? $this->results->forSlide($current) : null,
];
@@ -123,6 +125,7 @@ class PollStateService
return [
'poll' => $this->pollPayload($poll),
'isLive' => $poll->current_slide_id === $slide->id,
'isHidden' => $slide->is_hidden,
'index' => null,
'count' => null,
'slide' => $this->slidePayload($slide),
+2 -2
View File
@@ -16,7 +16,7 @@ use Cake\ORM\Locator\LocatorAwareTrait;
* screen. With $includeInternal it also contains their answers, distribution and comments –
* that version is meant for the poll owner only.
*
* Per slide: ['slide' => Slide, 'number' => int (position in the poll, 1-based),
* Per slide: ['slide' => Slide, 'number' => int (position in the presentation, 1-based; hidden slides are left out),
* 'internal' => bool (private slide), 'withheld' => bool (private and left out),
* 'results' => ResultsService::forSlide() shape, where
* open: 'answers' contains all texts (not only the newest ones), and
@@ -49,7 +49,7 @@ class ReportService
*/
public function build(Poll $poll, bool $includeInternal): array
{
$slides = $this->Slides->listForPoll($poll->id);
$slides = $this->Slides->listForPoll($poll->id, true);
$includeInternal = $includeInternal
&& array_filter($slides, fn(Slide $slide) => $slide->isInteractive() && $slide->isPrivate()) !== [];
$sections = [];