Add transcription language selection and fix app launch UX#36
Closed
volodymyr-malishevskyi wants to merge 4 commits intokaransinghgit:mainfrom
Closed
Add transcription language selection and fix app launch UX#36volodymyr-malishevskyi wants to merge 4 commits intokaransinghgit:mainfrom
volodymyr-malishevskyi wants to merge 4 commits intokaransinghgit:mainfrom
Conversation
Owner
|
changes incorporated in PR #37 Thank you for your contributions! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
all 98 Whisper-supported languages and an "Auto-detect" default.
can switch language mid-session without opening Settings.
re-selection.
WhisperService.transcribe()now accepts alanguageparameter.Passing
"auto"sendsnilto WhisperKit, preserving the existingauto-detect behavior.
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 (
.accessoryactivation policy). The onlyway to open the dashboard was to discover the menu bar icon, which is
not obvious to new users.
Solution:
.accessorypolicy on startup. macOS defaultsto
.regular, so SwiftUI'sWindowGroupnow opens the dashboardautomatically.
is visible and hides when all windows are closed, using
windowDidBecomeKey/windowWillCloseobservers inAppDelegate.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-schemetrick 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
AppStoragekey for selected language:"transcriptionLanguage"(default"auto")AppStoragekey for recents:"recentTranscriptionLanguages"(comma-separated, max 5)Files changed
speaktype/Services/WhisperService.swiftlanguageparam; maps"auto"→nilfor WhisperKitspeaktype/Views/Screens/Settings/SettingsView.swiftspeaktype/Views/Overlays/MiniRecorderView.swiftspeaktype/Views/Screens/Dashboard/DashboardView.swifttranscriptionLanguagetotranscribe()speaktype/Views/TranscribeAudioView.swifttranscriptionLanguagetotranscribe()speaktype/App/AppDelegate.swiftNSApp.activate()on launchspeaktype/App/speaktypeApp.swiftopenWindow(id:)