Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

Merge main into chore/update-reasoning-model-catalog

Gabriel Steinc6cc450e6249
diff --cc src/components/OnboardingFlow.tsx
index c52ea7403,66de81cae..780873a5d
--- a/src/components/OnboardingFlow.tsx
+++ b/src/components/OnboardingFlow.tsx
@@@ -33,14 -34,14 +34,16 @@@ import { usePython } from "../hooks/use
import { usePermissions } from "../hooks/usePermissions";
import { useClipboard } from "../hooks/useClipboard";
import { useSettings } from "../hooks/useSettings";
-import { getLanguageLabel, REASONING_PROVIDERS } from "../utils/languages";
+import { getLanguageLabel } from "../utils/languages";
+import { REASONING_PROVIDERS } from "../models/ModelRegistry";
import LanguageSelector from "./ui/LanguageSelector";
-import { UnifiedModelPickerCompact } from "./UnifiedModelPicker";
+import ModelCardList from "./ui/ModelCardList";
+const InteractiveKeyboard = React.lazy(() => import("./ui/Keyboard"));
import { setAgentName as saveAgentName } from "../utils/agentName";
- import { formatHotkeyLabel } from "../utils/hotkeys";
+ import { formatHotkeyLabel, getDefaultHotkey } from "../utils/hotkeys";
import { API_ENDPOINTS, buildApiUrl, normalizeBaseUrl } from "../config/constants";
+ import { HotkeyInput } from "./ui/HotkeyInput";
+ import { useHotkeyRegistration } from "../hooks/useHotkeyRegistration";
interface OnboardingFlowProps {
onComplete: () => void;
diff --cc src/components/SettingsPage.tsx
index dce4eec9c,c64345be0..ad1e9bebc
--- a/src/components/SettingsPage.tsx
+++ b/src/components/SettingsPage.tsx
@@@ -15,9 -18,11 +15,10 @@@ import { formatHotkeyLabel } from "../u
import LanguageSelector from "./ui/LanguageSelector";
import PromptStudio from "./ui/PromptStudio";
import { API_ENDPOINTS } from "../config/constants";
-import AIModelSelectorEnhanced from "./AIModelSelectorEnhanced";
-import { MarkdownRenderer } from "./ui/MarkdownRenderer";
+import ReasoningModelSelector from "./ReasoningModelSelector";
import type { UpdateInfoResult } from "../types/electron";
- const InteractiveKeyboard = React.lazy(() => import("./ui/Keyboard"));
+ import { HotkeyInput } from "./ui/HotkeyInput";
+ import { useHotkeyRegistration } from "../hooks/useHotkeyRegistration";
export type SettingsSectionType =
| "general"
@@@ -278,16 -296,21 +291,16 @@@ export default function SettingsPage(
}, [installInitiated, showAlertDialog]);
const saveReasoningSettings = useCallback(async () => {
- const normalizedReasoningBase = (cloudReasoningBaseUrl || '').trim();
+ const normalizedReasoningBase = (cloudReasoningBaseUrl || "").trim();
setCloudReasoningBaseUrl(normalizedReasoningBase);
- // Update reasoning settings including the base URL
updateReasoningSettings({
useReasoningModel,
reasoningModel,
- cloudReasoningBaseUrl: normalizedReasoningBase
+ cloudReasoningBaseUrl: normalizedReasoningBase,
});
- // Save API keys to backend based on provider (including custom)
- if (
- (localReasoningProvider === "openai" || localReasoningProvider === "custom") &&
- openaiApiKey
- ) {
+ if ((localReasoningProvider === "openai" || localReasoningProvider === "custom") && openaiApiKey) {
await window.electronAPI?.saveOpenAIKey(openaiApiKey);
}
if (localReasoningProvider === "anthropic" && anthropicApiKey) {
@@@ -504,14 -506,12 +485,11 @@@
case "general":
return (
<div className="space-y-8">
- {/* App Updates Section */}
<div className="space-y-6">
<div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">
- App Updates
- </h3>
+ <h3 className="text-lg font-semibold text-gray-900 mb-2">App Updates</h3>
<p className="text-sm text-gray-600 mb-4">
- Keep OpenWhispr up to date with the latest features and
- improvements.
+ Keep OpenWhispr up to date with the latest features and improvements.
</p>
</div>
<div className="flex items-center justify-between p-4 bg-neutral-50 rounded-lg">
@@@ -716,65 -710,29 +688,27 @@@
</div>
</div>
- {/* Hotkey Section */}
<div className="border-t pt-8">
<div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">
- Dictation Hotkey
- </h3>
+ <h3 className="text-lg font-semibold text-gray-900 mb-2">Dictation Hotkey</h3>
<p className="text-sm text-gray-600 mb-6">
- Configure the key you press to start and stop voice dictation.
+ Configure the key or key combination you press to start and stop voice dictation.
</p>
</div>
- <div className="space-y-4">
- <div>
- <label className="block text-sm font-medium text-gray-700 mb-2">
- Activation Key
- </label>
- <Input
- placeholder="Default: ` (backtick)"
- value={dictationKey}
- onChange={(e) => setDictationKey(e.target.value)}
- className="text-center text-lg font-mono"
- />
- <p className="text-xs text-gray-500 mt-2">
- Press this key from anywhere to start/stop dictation
- </p>
- </div>
- <div className="bg-gray-50 p-4 rounded-lg">
- <h4 className="font-medium text-gray-900 mb-3">
- Click any key to select it:
- </h4>
- <React.Suspense
- fallback={
- <div className="h-32 flex items-center justify-center text-gray-500">
- Loading keyboard...
- </div>
- }
- >
- <InteractiveKeyboard
- selectedKey={dictationKey}
- setSelectedKey={setDictationKey}
- />
- </React.Suspense>
- </div>
- <Button
- onClick={saveKey}
- disabled={!dictationKey.trim()}
- className="w-full"
- >
- Save Hotkey
- </Button>
- </div>
+ <HotkeyInput
+ value={dictationKey}
+ onChange={async (newHotkey) => {
+ await registerHotkey(newHotkey);
+ }}
+ disabled={isHotkeyRegistering}
+ />
</div>
- {/* Permissions Section */}
<div className="border-t pt-8">
<div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">
- Permissions
- </h3>
+ <h3 className="text-lg font-semibold text-gray-900 mb-2">Permissions</h3>
<p className="text-sm text-gray-600 mb-6">
- Test and manage app permissions for microphone and
- accessibility.
+ Test and manage app permissions for microphone and accessibility.
</p>
</div>
<div className="space-y-3">
@@@ -805,15 -770,13 +746,12 @@@
</div>
</div>
- {/* About Section */}
<div className="border-t pt-8">
<div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">
- About OpenWhispr
- </h3>
+ <h3 className="text-lg font-semibold text-gray-900 mb-2">About OpenWhispr</h3>
<p className="text-sm text-gray-600 mb-6">
- OpenWhispr converts your speech to text using AI. Press your
- hotkey, speak, and we'll type what you said wherever your
- cursor is.
+ OpenWhispr converts your speech to text using AI. Press your hotkey, speak, and
+ we'll type what you said wherever your cursor is.
</p>
</div>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 text-sm mb-6">
@@@ -928,88 -888,128 +862,76 @@@
return (
<div className="space-y-6">
<div>
- <h3 className="text-lg font-semibold text-gray-900 mb-4">
+ <h3 className="text-lg font-semibold text-gray-900 mb-2">
Speech to Text Processing
</h3>
- <ProcessingModeSelector
- useLocalWhisper={useLocalWhisper}
- setUseLocalWhisper={(value) => {
- setUseLocalWhisper(value);
- updateTranscriptionSettings({ useLocalWhisper: value });
- }}
- />
+ <p className="text-sm text-gray-600 mb-4">
+ Choose a cloud provider for fast transcription or use local Whisper models for complete privacy.
+ </p>
</div>
- {!useLocalWhisper && (
- <div className="space-y-4 p-4 bg-blue-50 border border-blue-200 rounded-xl">
- <h4 className="font-medium text-blue-900">OpenAI-Compatible Cloud Setup</h4>
- <ApiKeyInput
- apiKey={openaiApiKey}
- setApiKey={setOpenaiApiKey}
- helpText={
- <>
- Supports OpenAI or compatible endpoints.{" "}
- <a
- href="https://platform.openai.com"
- target="_blank"
- rel="noopener noreferrer"
- className="text-blue-600 underline"
- >
- Get an API key
- </a>
- .
- </>
- }
- />
- <div className="space-y-2">
- <label className="block text-sm font-medium text-blue-900">
- Custom Base URL (optional)
- </label>
- <Input
- value={cloudTranscriptionBaseUrl}
- onChange={(event) => setCloudTranscriptionBaseUrl(event.target.value)}
- placeholder="https://api.openai.com/v1"
- className="text-sm"
- />
- <div className="flex items-center gap-2">
- <Button
- type="button"
- variant="outline"
- size="sm"
- onClick={() => setCloudTranscriptionBaseUrl(API_ENDPOINTS.TRANSCRIPTION_BASE)}
- >
- Reset to Default
- </Button>
- </div>
- <p className="text-xs text-blue-800">
- Requests for cloud transcription use this OpenAI-compatible base URL. Leave
- empty to fall back to
- <code className="ml-1">{API_ENDPOINTS.TRANSCRIPTION_BASE}</code>.
- </p>
- </div>
- </div>
- )}
-
- {useLocalWhisper && whisperHook.whisperInstalled && (
- <div className="space-y-4 p-4 bg-purple-50 border border-purple-200 rounded-xl">
- <h4 className="font-medium text-purple-900">Local Whisper Model</h4>
- <WhisperModelPicker
- selectedModel={whisperModel}
- onModelSelect={setWhisperModel}
- variant="settings"
- />
- </div>
- )}
-
- <div className="space-y-4 p-4 bg-gray-50 border border-gray-200 rounded-xl">
- <h4 className="font-medium text-gray-900">Preferred Language</h4>
- <LanguageSelector
- value={preferredLanguage}
- onChange={(value) => {
- setPreferredLanguage(value);
- updateTranscriptionSettings({ preferredLanguage: value });
- }}
- className="w-full"
- />
- </div>
+ <TranscriptionModelPicker
+ selectedCloudProvider={cloudTranscriptionProvider}
+ onCloudProviderSelect={(providerId) => {
+ setCloudTranscriptionProvider(providerId);
+ const provider = getTranscriptionProviders().find(p => p.id === providerId);
+ if (provider) {
+ setCloudTranscriptionBaseUrl(provider.baseUrl);
+ }
+ }}
+ selectedCloudModel={cloudTranscriptionModel}
+ onCloudModelSelect={setCloudTranscriptionModel}
+ selectedLocalModel={whisperModel}
+ onLocalModelSelect={setWhisperModel}
+ useLocalWhisper={useLocalWhisper}
+ onModeChange={(isLocal) => {
+ setUseLocalWhisper(isLocal);
+ updateTranscriptionSettings({ useLocalWhisper: isLocal });
+ }}
+ openaiApiKey={openaiApiKey}
+ setOpenaiApiKey={setOpenaiApiKey}
+ groqApiKey={groqApiKey}
+ setGroqApiKey={setGroqApiKey}
+ variant="settings"
+ />
- <div className="space-y-4 p-4 bg-gray-50 border border-gray-200 rounded-xl">
- <h4 className="font-medium text-gray-900">Preferred Language</h4>
- <LanguageSelector
- value={preferredLanguage}
- onChange={(value) => {
- setPreferredLanguage(value);
- updateTranscriptionSettings({ preferredLanguage: value });
- }}
- className="w-full"
- />
- </div>
+ <Button
+ onClick={() => {
+ const normalizedTranscriptionBase = (cloudTranscriptionBaseUrl || "").trim();
+ setCloudTranscriptionBaseUrl(normalizedTranscriptionBase);
- <Button
- onClick={() => {
- const normalizedTranscriptionBase = (cloudTranscriptionBaseUrl || '').trim();
- setCloudTranscriptionBaseUrl(normalizedTranscriptionBase);
+ updateTranscriptionSettings({
+ useLocalWhisper,
+ whisperModel,
+ preferredLanguage,
+ cloudTranscriptionBaseUrl: normalizedTranscriptionBase,
+ });
- updateTranscriptionSettings({
- useLocalWhisper,
- whisperModel,
- preferredLanguage,
- cloudTranscriptionBaseUrl: normalizedTranscriptionBase,
- });
-
- if (!useLocalWhisper && openaiApiKey.trim()) {
- updateApiKeys({ openaiApiKey });
- }
+ if (!useLocalWhisper && openaiApiKey.trim()) {
+ updateApiKeys({ openaiApiKey });
+ }
- const descriptionParts = [
- `Transcription mode: ${useLocalWhisper ? 'Local Whisper' : 'Cloud'}.`,
- `Language: ${preferredLanguage}.`,
- ];
+ const descriptionParts = [
+ `Transcription mode: ${useLocalWhisper ? "Local Whisper" : "Cloud"}.`,
+ `Language: ${preferredLanguage}.`,
+ ];
- if (!useLocalWhisper) {
- const baseLabel = normalizedTranscriptionBase || API_ENDPOINTS.TRANSCRIPTION_BASE;
- descriptionParts.push(`Endpoint: ${baseLabel}.`);
- }
+ if (!useLocalWhisper) {
+ const baseLabel = normalizedTranscriptionBase || API_ENDPOINTS.TRANSCRIPTION_BASE;
+ descriptionParts.push(`Endpoint: ${baseLabel}.`);
+ }
- showAlertDialog({
- title: "Settings Saved",
- description: descriptionParts.join(' '),
- });
- }}
- className="w-full"
- >
- Save Transcription Settings
- </Button>
- </div>
- );
+ showAlertDialog({
+ title: "Settings Saved",
+ description: descriptionParts.join(" "),
+ });
+ }}
+ className="w-full"
+ >
+ Save Transcription Settings
+ </Button>
+ </div>
+ );
case "aiModels":
return (