Settings Views
Relevant source files
The following files were used as context for generating this wiki page:
- VoiceInk/Views/Settings/SettingsView.swift
- VoiceInk/Services/ImportExportService.swift
- VoiceInk/Views/ContentView.swift
- VoiceInk/Views/Dictionary/DictionarySettingsView.swift
- VoiceInk/PowerMode/PowerModeConfigView.swift
- VoiceInk/Views/ModelSettingsView.swift
- VoiceInk/Whisper/WhisperState+LocalModelManager.swift
The Settings views in VoiceInk provide a centralized and comprehensive interface for users to customize the application's behavior. These views allow configuration of everything from core functionality like hotkeys and recorder behavior to advanced features such as AI model selection, data management, and context-aware Power Modes. The settings are modular, with a main SettingsView acting as a hub for general preferences and linking to more specialized configuration screens for features like the Dictionary, Power Modes, and Audio Inputs.
This modularity is managed through the main ContentView, which uses a NavigationSplitView to present a sidebar of options that navigate the user to the appropriate settings panel. This design ensures that the wide array of options is organized logically, making it easy for users to find and adjust the settings they need.
Sources: VoiceInk/Views/Settings/SettingsView.swift, VoiceInk/Views/ContentView.swift:13-36
Navigation and Structure
The primary navigation to all settings and feature views is handled by the ContentView, which populates a DynamicSidebar with various destinations.
This diagram illustrates the navigation flow from the main sidebar to the different settings-related views.
Main Settings View (SettingsView)
The SettingsView is the central panel for most user-facing configurations. It is built using a reusable SettingsSection component that visually groups related settings.
Sources: VoiceInk/Views/Settings/SettingsView.swift:11-344
The view is organized into the following sections:
| Section Title | Description | Relevant Components |
|---|---|---|
| VoiceInk Shortcuts | Configures the primary and secondary hotkeys for triggering the recorder. Supports adding a second hotkey and choosing from predefined modifier keys or a custom shortcut. | hotkeyManager, KeyboardShortcuts.Recorder |
| Other App Shortcuts | Manages additional global shortcuts for actions like pasting transcripts, retrying transcription, and canceling recording. | KeyboardShortcuts.Recorder, InfoTip |
| Recording Feedback | Toggles for audible sound feedback, muting system audio during recording, and preserving the transcript in the clipboard. | SoundManager, MediaController |
| Power Mode | A link to the dedicated Power Mode settings. | PowerModeSettingsSection |
| Experimental Features | A section for toggling experimental application features. | ExperimentalFeaturesSection |
| Recorder Style | Allows the user to choose between the "Notch Recorder" and "Mini Recorder" UI. | whisperState.recorderType |
| Paste Method | A toggle to switch between the default paste mechanism and an AppleScript-based method for non-standard keyboard layouts. | UserDefaults |
| General | Contains general app settings like hiding the dock icon, launching at login, and managing automatic updates. | MenuBarManager, LaunchAtLogin.Toggle, UpdaterViewModel |
| Data & Privacy | Manages transcript history and audio file cleanup rules. | AudioCleanupSettingsView |
| Data Management | Provides buttons to import and export application settings. | ImportExportService |
Sources: VoiceInk/Views/Settings/SettingsView.swift:22-344
Keyboard Shortcuts
The application defines several customizable keyboard shortcuts. The main recorder can be triggered by two separate hotkeys, while other actions have their own dedicated shortcuts.
| Shortcut Name | KeyboardShortcuts.Name | Description |
|---|---|---|
| Hotkey 1 / Hotkey 2 | .toggleMiniRecorder / .toggleMiniRecorder2 | Toggles the recorder. A quick tap starts/stops hands-free recording; a long press enables push-to-talk. |
| Paste Last Transcript (Original) | .pasteLastTranscription | Pastes the most recent original transcription. |
| Paste Last Transcript (Enhanced) | .pasteLastEnhancement | Pastes the AI-enhanced transcript if available; otherwise, falls back to the original. |
| Retry Last Transcription | .retryLastTranscription | Re-transcribes the last audio recording and copies the result. |
| Custom Cancel Shortcut | .cancelRecorder | Cancels the current recording session. Defaults to double-tapping Escape if not set. |
Sources: VoiceInk/Views/Settings/SettingsView.swift:30-159
Middle-Click Toggle
In addition to keyboard shortcuts, users can enable a middle-mouse-click to toggle recording. An activation delay can be configured in milliseconds to prevent accidental triggers.
Sources: VoiceInk/Views/Settings/SettingsView.swift:162-192
Data Management (ImportExportService)
The ImportExportService provides the logic for backing up and restoring user configurations. This service is invoked from the "Data Management" section within SettingsView.
Sources: VoiceInk/Services/ImportExportService.swift
Exported Data Structure
When a user exports their settings, the data is serialized into a JSON file using the VoiceInkExportedSettings structure. Notably, sensitive information like API keys is not included in the export.
The diagram above shows the main components of the VoiceInkExportedSettings data structure.
Sources: VoiceInk/Services/ImportExportService.swift:9-30
Export Process
The export process gathers settings from various managers and services, encodes them into JSON, and prompts the user to save the file.
This sequence diagram outlines the steps involved in exporting user settings.
Sources: VoiceInk/Services/ImportExportService.swift:69-130
Import Process
The import process reads a JSON backup file, decodes it into the VoiceInkExportedSettings structure, and applies the settings to the relevant application components. A warning is shown if the settings file version does not match the current app version.
This sequence diagram outlines the steps for importing user settings from a backup file.
Sources: VoiceInk/Services/ImportExportService.swift:133-277
Dictionary Settings
The DictionarySettingsView allows users to "teach" VoiceInk new vocabulary to improve transcription accuracy. It is split into two main sections, selected via SectionCard buttons.
This diagram shows the structure of the Dictionary Settings screen.
Sources: VoiceInk/Views/Dictionary/DictionarySettingsView.swift:8-59
- Word Replacements: Allows automatic replacement of specific words or phrases with custom formatted text.
- Correct Spellings: Allows adding custom words to help the transcription model recognize them correctly. This interacts with the
WhisperPromptobject.
Sources: VoiceInk/Views/Dictionary/DictionarySettingsView.swift:11-25
Power Mode Configuration
The ConfigurationView for Power Modes is a detailed settings panel for creating context-aware configurations that are automatically applied based on the active application or website.
Sources: VoiceInk/PowerMode/PowerModeConfigView.swift
A single PowerModeConfig contains the following customizable settings:
- Triggers:
- A list of
AppConfigitems (application bundle identifiers). - A list of
URLConfigitems (website domains).
- A list of
- Transcription:
- A specific transcription model (
selectedTranscriptionModelName). - A specific language (
selectedLanguage).
- A specific transcription model (
- AI Enhancement:
- A toggle to enable/disable enhancement (
isAIEnhancementEnabled). - A selected AI provider and model (
selectedAIProvider,selectedAIModel). - A specific enhancement prompt (
selectedPrompt). - A toggle for "Context Awareness" (screen capture) (
useScreenCapture).
- A toggle to enable/disable enhancement (
- Advanced:
- A toggle for "Auto Send" which presses Enter after pasting (
isAutoSendEnabled).
- A toggle for "Auto Send" which presses Enter after pasting (
- General:
- A name and emoji for identification.
- A flag to set it as the default mode (
isDefault).
Sources: VoiceInk/PowerMode/PowerModeConfigView.swift:204-325, 411-423, 584-666
Model Output Settings
The ModelSettingsView provides options to control the format and behavior of the transcription output.
- Output Format Prompt: Users can edit a custom prompt that guides the style of the Whisper model's output. The view provides a text editor to modify the prompt for the currently selected language.
- Add space after paste: A toggle (
appendTrailingSpace) to automatically add a trailing space after pasting text. - Automatic text formatting: A toggle (
isTextFormattingEnabled) to apply intelligent formatting to break up large blocks of text. - Voice Activity Detection (VAD): A toggle (
isVADEnabled) to filter out silence and improve the accuracy of local models.