|
@@ -1589,3 +1589,36 @@ def test_maximize_restore_with_chat_content_keeps_chat_visible(server):
|
|
|
assert observed["maximized"] is None
|
|
assert observed["maximized"] is None
|
|
|
assert observed["triage_display"] is True
|
|
assert observed["triage_display"] is True
|
|
|
assert observed["chat_display"] is True
|
|
assert observed["chat_display"] is True
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def test_transcript_pane_keeps_updating_past_cap(server):
|
|
|
|
|
+ """Regression: past MAX_TRANSCRIPTS the running log must still append."""
|
|
|
|
|
+ pytest.importorskip("textual")
|
|
|
|
|
+ from textual.widgets import RichLog
|
|
|
|
|
+
|
|
|
|
|
+ from stt_daemon.tui.app import AssistantTUI
|
|
|
|
|
+ from stt_daemon.tui.state import MAX_TRANSCRIPTS
|
|
|
|
|
+
|
|
|
|
|
+ path, _service = server
|
|
|
|
|
+ app = AssistantTUI(path)
|
|
|
|
|
+ observed: dict = {}
|
|
|
|
|
+
|
|
|
|
|
+ async def scenario():
|
|
|
|
|
+ async with app.run_test(size=(80, 40)) as pilot:
|
|
|
|
|
+ await pilot.pause()
|
|
|
|
|
+ app._timer.stop() # no background drain: server status must not clobber state
|
|
|
|
|
+ app._drain()
|
|
|
|
|
+ for i in range(MAX_TRANSCRIPTS + 5):
|
|
|
|
|
+ app.state.ingest({"type": "transcript", "text": f"t{i}", "lang": "en"})
|
|
|
|
|
+ app._render()
|
|
|
|
|
+ await pilot.pause()
|
|
|
|
|
+
|
|
|
|
|
+ app.state.ingest({"type": "transcript", "text": "after cap", "lang": "en"})
|
|
|
|
|
+ app._render()
|
|
|
|
|
+ await pilot.pause()
|
|
|
|
|
+ log = app.query_one("#transcript", RichLog)
|
|
|
|
|
+ observed["lines"] = [str(line) for line in log.lines]
|
|
|
|
|
+
|
|
|
|
|
+ asyncio.run(scenario())
|
|
|
|
|
+ assert any("after cap" in line for line in observed["lines"])
|
|
|
|
|
+ assert len(observed["lines"]) > MAX_TRANSCRIPTS
|