Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
Fix hotkey tooltip display and add cross-window settings sync
Gabriel Steinecfaa0adfb7f
diff --git a/preload.js b/preload.jsindex a17e5b70c..dbffd87ae 100644--- a/preload.js+++ b/preload.js@@ -520,6 +520,11 @@ contextBridge.exposeInMainWorld("electronAPI", {ipcRenderer.on("hotkey-registration-failed", listener);return () => ipcRenderer.removeListener("hotkey-registration-failed", listener);},+ onSettingUpdated: (callback) => {+ const listener = (_event, data) => callback?.(data);+ ipcRenderer.on("setting-updated", listener);+ return () => ipcRenderer.removeListener("setting-updated", listener);+ },onWindowsPushToTalkUnavailable: registerListener("windows-ptt-unavailable"),// Accessibility permission events (macOS)diff --git a/src/App.jsx b/src/App.jsxindex 7bc72af4f..abf508d68 100644--- a/src/App.jsx+++ b/src/App.jsx@@ -5,6 +5,7 @@ import { X } from "lucide-react";import { useToast } from "./components/ui/Toast";import { LoadingDots } from "./components/ui/LoadingDots";import { useHotkey } from "./hooks/useHotkey";+import { formatHotkeyLabel } from "./utils/hotkeys";import { useWindowDrag } from "./hooks/useWindowDrag";import { useAudioRecording } from "./hooks/useAudioRecording";import { useSettingsStore } from "./stores/settingsStore";@@ -46,7 +47,7 @@ const VoiceWaveIndicator = ({ isListening }) => {);};-// Enhanced Tooltip Component+// Tooltip Componentconst Tooltip = ({ children, content, emoji }) => {const [isVisible, setIsVisible] = useState(false);@@ -56,10 +57,7 @@ const Tooltip = ({ children, content, emoji }) => {{children}</div>{isVisible && (- <div- className="absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-1 py-1 text-popover-foreground bg-popover border border-border rounded-md whitespace-nowrap z-10 transition-opacity duration-150 shadow-lg"- style={{ fontSize: "9.7px", maxWidth: "96px" }}- >+ <div className="absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-1.5 py-1 text-[10px] text-popover-foreground bg-popover border border-border rounded-md whitespace-nowrap z-10 shadow-lg transition-opacity duration-150">{emoji && <span className="mr-1">{emoji}</span>}{content}<div className="absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-2 border-r-2 border-t-2 border-transparent border-t-popover"></div>@@ -279,7 +277,7 @@ export default function App() {case "hover":return {className: `${baseClasses} bg-black/50 cursor-pointer`,- tooltip: t("app.mic.hotkeyToSpeak", { hotkey }),+ tooltip: formatHotkeyLabel(hotkey),};case "recording":return {diff --git a/src/helpers/hotkeyManager.js b/src/helpers/hotkeyManager.jsindex 4c61957c1..4e999a093 100644--- a/src/helpers/hotkeyManager.js+++ b/src/helpers/hotkeyManager.js@@ -573,26 +573,19 @@ class HotkeyManager {}async saveHotkeyToRenderer(hotkey) {- const escapedHotkey = hotkey.replace(/\\/g, "\\\\").replace(/"/g, '\\"');-await this._persistHotkeyToEnvFile(hotkey);- // Also save to localStorage for backwards compatibilityif (this.mainWindow && !this.mainWindow.isDestroyed()) {try {- await this.mainWindow.webContents.executeJavaScript(- `localStorage.setItem("dictationKey", "${escapedHotkey}"); true;`- );- debugLogger.log(`[HotkeyManager] Saved hotkey "${hotkey}" to localStorage`);+ this.mainWindow.webContents.send("setting-updated", { key: "dictationKey", value: hotkey });+ debugLogger.log(`[HotkeyManager] Sent dictationKey update to main window`);return true;} catch (err) {- debugLogger.error("[HotkeyManager] Failed to save hotkey to localStorage:", err.message);+ debugLogger.error("[HotkeyManager] Failed to send dictationKey update:", err.message);return false;}} else {- debugLogger.warn(- "[HotkeyManager] Main window not available for saving hotkey to localStorage"- );+ debugLogger.warn("[HotkeyManager] Main window not available for setting sync");return false;}}diff --git a/src/stores/settingsStore.ts b/src/stores/settingsStore.tsindex d27898d47..808cf13b5 100644--- a/src/stores/settingsStore.ts+++ b/src/stores/settingsStore.ts@@ -795,4 +795,19 @@ export async function initializeSettings(): Promise<void> {void i18n.changeLanguage(value);}});++ // Sync settings pushed from main process (e.g., hotkey changed in control panel)+ window.electronAPI?.onSettingUpdated?.((data: { key: string; value: unknown }) => {+ const state = useSettingsStore.getState();+ if (+ data.key in state &&+ typeof (state as unknown as Record<string, unknown>)[data.key] !== "function"+ ) {+ localStorage.setItem(+ data.key,+ typeof data.value === "string" ? data.value : JSON.stringify(data.value)+ );+ useSettingsStore.setState({ [data.key]: data.value });+ }+ });}diff --git a/src/types/electron.ts b/src/types/electron.tsindex ec2404dd8..dfde4dd35 100644--- a/src/types/electron.ts+++ b/src/types/electron.ts@@ -665,6 +665,7 @@ declare global {onHotkeyRegistrationFailed?: (callback: (data: { hotkey: string; error: string; suggestions: string[] }) => void) => () => void;+ onSettingUpdated?: (callback: (data: { key: string; value: unknown }) => void) => () => void;// Accessibility permission events (macOS)onAccessibilityMissing?: (callback: () => void) => () => void;