Skip to content

Add transcription language selection and fix app launch UX#36

Closed
volodymyr-malishevskyi wants to merge 4 commits intokaransinghgit:mainfrom
volodymyr-malishevskyi:feat/add-target-language
Closed

Add transcription language selection and fix app launch UX#36
volodymyr-malishevskyi wants to merge 4 commits intokaransinghgit:mainfrom
volodymyr-malishevskyi:feat/add-target-language

Conversation

@volodymyr-malishevskyi
Copy link
Contributor

@volodymyr-malishevskyi volodymyr-malishevskyi commented Mar 4, 2026

Summary

This PR adds language selection for transcription, so users dictating in
non-English can get accurate results. It also fixes two launch UX issues:
the dashboard was hidden on startup and the menu bar "Open Dashboard"
button could silently fail.

Problems & Solutions

1. Non-English dictation produced incorrect or mixed-language output

Problem: WhisperKit supports 98 languages and can auto-detect the
spoken language, but auto-detection is unreliable for short phrases or
accented speech. There was no way for users to lock the language.

Solution:

  • Added a Transcription Language dropdown in Settings → General with
    all 98 Whisper-supported languages and an "Auto-detect" default.
  • Added a compact language chip in the mini recorder overlay so users
    can switch language mid-session without opening Settings.
  • The last 5 used languages appear at the top of both menus for fast
    re-selection.
  • WhisperService.transcribe() now accepts a language parameter.
    Passing "auto" sends nil to WhisperKit, preserving the existing
    auto-detect behavior.

Note: Language selection only takes effect with multilingual models
(Large v3 Turbo, Medium). English-only (.en) models ignore it — a
hint is shown in Settings.


2. The app started invisible — users had no window on launch

Problem: On first launch (and after quitting all windows), the app
ran as a background process (.accessory activation policy). The only
way to open the dashboard was to discover the menu bar icon, which is
not obvious to new users.

Solution:

  • Removed the hardcoded .accessory policy on startup. macOS defaults
    to .regular, so SwiftUI's WindowGroup now opens the dashboard
    automatically.
  • The Dock icon now appears reactively: it shows when any titled window
    is visible and hides when all windows are closed, using
    windowDidBecomeKey / windowWillClose observers in AppDelegate.

3. "Open Dashboard" in the menu bar could silently fail

Problem: Clicking "Open Dashboard" in the menu bar extra used
NSWorkspace.shared.open(URL(string: "speaktype://open")) — a URL-scheme
trick that relied on the app handling the URL. If the URL handler wasn't
registered or was slow, nothing happened.

Solution: Replaced with a direct SwiftUI openWindow(id: "main-dashboard")
call, followed by NSApp.activate() to bring the window to the front.

Notes

  • AppStorage key for selected language: "transcriptionLanguage" (default "auto")
  • AppStorage key for recents: "recentTranscriptionLanguages" (comma-separated, max 5)

Files changed

File Change
speaktype/Services/WhisperService.swift Added language param; maps "auto"nil for WhisperKit
speaktype/Views/Screens/Settings/SettingsView.swift Transcription Language section with 98-language dropdown
speaktype/Views/Overlays/MiniRecorderView.swift Language chip with recent-languages menu
speaktype/Views/Screens/Dashboard/DashboardView.swift Pass transcriptionLanguage to transcribe()
speaktype/Views/TranscribeAudioView.swift Pass transcriptionLanguage to transcribe()
speaktype/App/AppDelegate.swift Reactive dock policy via window observers; NSApp.activate() on launch
speaktype/App/speaktypeApp.swift Replace URL hack with openWindow(id:)

@volodymyr-malishevskyi volodymyr-malishevskyi changed the title Add target transcription language Feat: add transcription language selection and fix app launch/dock behavior Mar 4, 2026
@volodymyr-malishevskyi volodymyr-malishevskyi marked this pull request as ready for review March 4, 2026 17:56
@volodymyr-malishevskyi volodymyr-malishevskyi changed the title Feat: add transcription language selection and fix app launch/dock behavior Add transcription language selection and fix app launch UX Mar 4, 2026
@karansinghgit
Copy link
Owner

changes incorporated in PR #37

Thank you for your contributions!

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.

2 participants