Remove progress throttle so every segment emits a progress update

Previously, progress messages were only sent every 5th segment due to
a `segment_count % 5` guard. This made the UI feel unresponsive for
short recordings with few segments. Now every segment emits a progress
update with a more descriptive message including the segment number
and audio percentage.

Adds a test verifying that all 8 mock segments produce progress
messages, not just every 5th.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude
2026-03-20 13:49:14 -07:00
parent d00281f0c7
commit 6eb13bce63
2 changed files with 61 additions and 9 deletions

View File

@@ -145,16 +145,14 @@ class TranscribeService:
)
)
# Send progress every few segments
if segment_count % 5 == 0:
write_message(
progress_message(
request_id,
progress_pct,
"transcribing",
f"Processed {segment_count} segments...",
)
write_message(
progress_message(
request_id,
progress_pct,
"transcribing",
f"Transcribing segment {segment_count} ({progress_pct}% of audio)...",
)
)
elapsed = time.time() - start_time
print(