Fix progress feedback, diarization fallback, and dropdown readability

- Stream pipeline progress to frontend via Tauri events so the progress
  overlay updates in real time during transcription/diarization
- Gracefully fall back to transcription-only when diarization fails
  (e.g. pyannote not installed) instead of erroring the whole pipeline
- Add color-scheme: dark to fix native select/option elements rendering
  with unreadable white backgrounds

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 17:14:25 -08:00
parent d00281f0c7
commit 669d88f143
5 changed files with 81 additions and 21 deletions

View File

@@ -110,27 +110,57 @@ class PipelineService:
)
return result
# Step 2: Diarize
# Step 2: Diarize (with graceful fallback)
write_message(
progress_message(request_id, 50, "pipeline", "Starting speaker diarization...")
)
diarization = self._diarize_service.diarize(
request_id=request_id,
file_path=file_path,
num_speakers=num_speakers,
min_speakers=min_speakers,
max_speakers=max_speakers,
)
diarization = None
try:
diarization = self._diarize_service.diarize(
request_id=request_id,
file_path=file_path,
num_speakers=num_speakers,
min_speakers=min_speakers,
max_speakers=max_speakers,
)
except Exception as e:
print(
f"[sidecar] Diarization failed, falling back to transcription-only: {e}",
file=sys.stderr,
flush=True,
)
write_message(
progress_message(
request_id, 80, "pipeline",
"Diarization unavailable, using transcription only..."
)
)
# Step 3: Merge
write_message(
progress_message(request_id, 90, "pipeline", "Merging transcript with speakers...")
)
result = self._merge_results(transcription, diarization.speaker_segments)
result.speakers = diarization.speakers
result.num_speakers = diarization.num_speakers
# Step 3: Merge (or skip if diarization failed)
if diarization is not None:
write_message(
progress_message(request_id, 90, "pipeline", "Merging transcript with speakers...")
)
result = self._merge_results(transcription, diarization.speaker_segments)
result.speakers = diarization.speakers
result.num_speakers = diarization.num_speakers
else:
result = PipelineResult(
language=transcription.language,
language_probability=transcription.language_probability,
duration_ms=transcription.duration_ms,
)
for seg in transcription.segments:
result.segments.append(
PipelineSegment(
text=seg.text,
start_ms=seg.start_ms,
end_ms=seg.end_ms,
speaker=None,
words=seg.words,
)
)
elapsed = time.time() - start_time
print(