Skip to content

Fix web app speaker diarization and language handling#4285

Merged
smian1 merged 3 commits intoBasedHardware:mainfrom
smian1:main
Jan 18, 2026
Merged

Fix web app speaker diarization and language handling#4285
smian1 merged 3 commits intoBasedHardware:mainfrom
smian1:main

Conversation

@smian1
Copy link
Copy Markdown
Collaborator

@smian1 smian1 commented Jan 18, 2026

Fix web app speaker diarization and language handling
Issues:

  1. Speaker diarization: Web app checked for 'speakerId' (camelCase) but
    backend sends 'speaker_id' (snake_case). This caused all speakers to
    be identified as speaker 0 because the fallback string parsing
    incorrectly assumed 1-indexed speakers when Deepgram uses 0-indexed.

  2. Language support: Web app always used 'multi' regardless of user's
    language preference, unlike mobile/desktop which fetch user settings.
    This caused issues for users with single_language_mode enabled.

Fixes:

  • Add 'speaker_id' (snake_case) to the fallback chain in segment parsing
  • Fetch user's language preference before creating transcription socket

claude and others added 2 commits January 18, 2026 15:09
Issues:
1. Speaker diarization: Web app checked for 'speakerId' (camelCase) but
   backend sends 'speaker_id' (snake_case). This caused all speakers to
   be identified as speaker 0 because the fallback string parsing
   incorrectly assumed 1-indexed speakers when Deepgram uses 0-indexed.

2. Language support: Web app always used 'multi' regardless of user's
   language preference, unlike mobile/desktop which fetch user settings.
   This caused issues for users with single_language_mode enabled.

Fixes:
- Add 'speaker_id' (snake_case) to the fallback chain in segment parsing
- Fetch user's language preference before creating transcription socket
Copilot AI review requested due to automatic review settings January 18, 2026 16:36
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to fix speaker diarization and language handling in the web app. The change for speaker diarization correctly adds speaker_id to the fallback chain, addressing the issue with backend data. However, the language handling fix appears to be incomplete. It fetches the user's language but doesn't consider the single_language_mode preference, which could lead to incorrect language settings for transcription. I've added comments with suggestions to fully implement the intended logic by fetching the complete transcription preferences.

Comment thread web/app/src/hooks/useRecording.ts Outdated
Comment thread web/app/src/hooks/useRecording.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes two issues in the web app's transcription functionality: speaker diarization field name mismatch and missing language preference handling.

Changes:

  • Added speaker_id (snake_case) to the speaker field fallback chain in transcription socket message handling
  • Fetched user's language preference before creating transcription socket with appropriate error handling and 'multi' fallback

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
web/app/src/lib/transcriptionSocket.ts Added speaker_id field to fallback chain when parsing speaker information from WebSocket messages
web/app/src/hooks/useRecording.ts Imported and called getUserLanguage to fetch user language preference before creating transcription socket

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@smian1 smian1 merged commit acbe65d into BasedHardware:main Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants