feat: Dictionary — custom replacements & spoken snippets - #105
Merged
Conversation
Adds a Dictionary sidebar screen where you map a spoken phrase to any text — say "my email" and get your address inserted, or fix a term the model keeps mishearing. Rules run fully offline as a post-processing pass. - DictionaryService: Codable entries persisted as JSON in UserDefaults (mirrors HistoryService); thread-safe static apply(to:); one-time migration of the old freeform `customReplacementRules` string into structured entries. - Applied in TranscriptionManager.transcribe so it covers BOTH engines (Whisper + Parakeet). Previously custom replacements were Whisper-only. - Removed the now-duplicated replacement code from WhisperService; filler-word removal stays behind the Auto Edit toggle. - New Dictionary sidebar item + screen with add/edit/delete and per-rule enable + whole-word toggles. Settings now points here instead of the old freeform text box.
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.
What
A Dictionary feature (inspired by Wispr Flow), reworked for a fully-local app. Map a spoken phrase to any output text:
Rules run offline as a post-processing pass on the final transcript.
How it works
DictionaryService—Codableentries persisted as JSON inUserDefaults(mirrorsHistoryService). Thread-safe staticapply(to:). One-time migration imports the old freeformcustomReplacementRulesstring into structured entries, so existing rules are preserved.TranscriptionManager.transcribeso it covers both engines (Whisper and Parakeet). The oldcustomReplacementRulesonly ran on the Whisper path — Parakeet silently skipped it. Removed that duplicated code fromWhisperService; filler-word removal stays behind the Auto Edit toggle.Notes
.glassEffectSDK issue, unrelated to this change.Test plan
customReplacementRulesmigrate into entries on first launch.