Let the dashboard follow the presenter
The live marker in the slide list stayed on the last known slide when the presenter moved on in another window or with a clicker. The dashboard now polls a cheap version fingerprint (admin:live) and reloads the lists when it changes, but never under an open dialog, a pending request or a drag. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9c6a19f0de
commit
8c7818ee40
7 files changed
+104
-1
No files matched your search
@@ -184,4 +184,30 @@ class PollResetTest extends TestCase
|
||||
$this->get("/admin/$token");
|
||||
$this->assertResponseContains("/admin/$token/reset\"");
|
||||
}
|
||||
|
||||
public function testDashboardLiveVersionFollowsThePresenter(): void
|
||||
{
|
||||
[$poll, $token] = $this->createPoll();
|
||||
$first = $this->createSlide($poll, Slide::TYPE_CHOICE);
|
||||
$second = $this->createSlide($poll, Slide::TYPE_CHOICE);
|
||||
$version = function () use ($token): string {
|
||||
$this->configRequest(['headers' => ['Accept' => 'application/json']]);
|
||||
$this->get("/admin/$token/live");
|
||||
$this->assertResponseOk();
|
||||
|
||||
return json_decode((string)$this->_response->getBody(), true)['version'];
|
||||
};
|
||||
|
||||
$start = $version();
|
||||
$this->assertSame($start, $version(), 'stable while nothing happens');
|
||||
|
||||
$poll = $this->goLive($poll, $first);
|
||||
$live = $version();
|
||||
$this->assertNotSame($start, $live, 'live slide changed');
|
||||
|
||||
$this->goLive($poll, $second);
|
||||
$this->assertNotSame($live, $version(), 'live marker moved');
|
||||
|
||||
$this->assertStringNotContainsString($token, (string)$this->_response->getBody());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user