Keep live Whisper segments on screen without a page refresh.

Treat streamed chunks as appends, stop Livewire from remorphing the Alpine tree, and hydrate from HTTP while a run is active so segment cards appear as they arrive.
This commit is contained in:
ben
2026-08-13 16:35:33 +02:00
parent 187b6b5d12
commit 3a9cf50529
7 changed files with 265 additions and 65 deletions
+8 -5
View File
@@ -60,7 +60,7 @@ class ShowTest extends TestCase
$this->assertDatabaseMissing('recordings', ['id' => $recording->id]);
}
public function test_show_polls_while_transcription_is_queued(): void
public function test_show_uses_alpine_hydrate_while_transcription_is_queued(): void
{
$user = User::factory()->create();
$this->actingAs($user);
@@ -79,12 +79,13 @@ class ShowTest extends TestCase
]);
Livewire::test(Show::class, ['recording' => $recording])
->assertSee('wire:poll', false)
->assertDontSee('echo-private', false)
->assertDontSee('wire:poll', false)
->assertSee('wire:ignore', false)
->assertSee('transcriptionMonitor', false)
->assertSee('Queued — waiting to start…');
}
public function test_show_does_not_poll_while_transcription_is_processing(): void
public function test_show_does_not_use_livewire_poll_while_transcription_is_processing(): void
{
$user = User::factory()->create();
$this->actingAs($user);
@@ -104,6 +105,7 @@ class ShowTest extends TestCase
Livewire::test(Show::class, ['recording' => $recording])
->assertDontSee('wire:poll', false)
->assertSee('wire:ignore', false)
->assertSee('userId', false);
}
@@ -166,6 +168,7 @@ class ShowTest extends TestCase
Livewire::test(Show::class, ['recording' => $recording])
->assertSee('whisper.segments', false)
->assertSee('whisper.language', false)
->assertSee('segmentDomKey', false)
->assertSee('Hello');
}
@@ -274,7 +277,7 @@ class ShowTest extends TestCase
]);
Livewire::test(Show::class, ['recording' => $recording])
->assertSee('wire:ignore.self', false)
->assertSee('wire:ignore', false)
->assertSee('transcription-ui-'.$recording->id.'-processing-', false)
->assertDontSee('transcription-ui-'.$recording->id.'-processing-62', false);
}