Skip to content

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

feat: increase window size for dication panel, allow click passthrough

Gabriel Steinb61fb3fe7081
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1dac79a97..ec44057e3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,13 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.0.6] - 2025-09-11
+### Added
+- **Dictation Panel Command Menu**: Clicking the floating panel reveals quick actions, including a one-click "Hide this for now" option.
+
### Changed
- **Dictation Overlay Placement**: Window now anchors to the active workspace's bottom-right corner with a safety margin, preventing it from sliding off-screen on multi-monitor setups.
+- **Dictation Overlay Canvas**: Enlarged the floating window so tooltips, menus, and error states render without being clipped while keeping click-through behaviour outside interactive elements.
### Fixed
- **macOS Window Lifecycle**: Ensured the dictation panel keeps the app visible in Dock and Command-Tab while retaining floating behaviour across spaces.
- **Control Panel Stability**: Reworked close/minimize handling so the panel stays interactive when switching apps and reopens cleanly without spawning duplicate windows.
- **Always-On-Top Enforcement**: Centralised the logic that reapplies floating window levels, eliminating redundant timers and focus quirks.
+- **Menu Labelling**: macOS application menu items now display the correct OpenWhispr casing instead of "open-whispr".
## [1.0.5] - 2025-09-10
diff --git a/main.js b/main.js
index 46b97a835..905461c96 100644
--- a/main.js
+++ b/main.js
@@ -1,5 +1,10 @@
const { app, globalShortcut, BrowserWindow } = require("electron");
+// Ensure macOS menus use the proper casing for the app name
+if (process.platform === "darwin" && app.getName() !== "OpenWhispr") {
+ app.setName("OpenWhispr");
+}
+
// Add global error handling for uncaught exceptions
process.on("uncaughtException", (error) => {
console.error("Uncaught Exception:", error);
diff --git a/preload.js b/preload.js
index 1e67c09ae..3db1d3d34 100644
--- a/preload.js
+++ b/preload.js
@@ -67,6 +67,8 @@ contextBridge.exposeInMainWorld("electronAPI", {
updateHotkey: (hotkey) => ipcRenderer.invoke("update-hotkey", hotkey),
startWindowDrag: () => ipcRenderer.invoke("start-window-drag"),
stopWindowDrag: () => ipcRenderer.invoke("stop-window-drag"),
+ setMainWindowInteractivity: (interactive) =>
+ ipcRenderer.invoke("set-main-window-interactivity", interactive),
// Update functions
checkForUpdates: () => ipcRenderer.invoke("check-for-updates"),
diff --git a/src/App.jsx b/src/App.jsx
index 68208713f..e83cd3ab9 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -78,15 +78,35 @@ export default function App() {
const [transcript, setTranscript] = useState("");
const [error, setError] = useState("");
const [isHovered, setIsHovered] = useState(false);
+ const [isCommandMenuOpen, setIsCommandMenuOpen] = useState(false);
const mediaRecorderRef = useRef(null);
const audioChunksRef = useRef([]);
+ const commandMenuRef = useRef(null);
+ const buttonRef = useRef(null);
const { toast } = useToast();
const { hotkey } = useHotkey();
- const { isDragging, handleMouseDown, handleMouseUp, handleClick } =
+ const { isDragging, handleMouseDown, handleMouseUp } =
useWindowDrag();
const [dragStartPos, setDragStartPos] = useState(null);
const [hasDragged, setHasDragged] = useState(false);
+ const setWindowInteractivity = React.useCallback((shouldCapture) => {
+ window.electronAPI?.setMainWindowInteractivity?.(shouldCapture);
+ }, []);
+
+ useEffect(() => {
+ setWindowInteractivity(false);
+ return () => setWindowInteractivity(false);
+ }, [setWindowInteractivity]);
+
+ useEffect(() => {
+ if (isCommandMenuOpen) {
+ setWindowInteractivity(true);
+ } else if (!isHovered) {
+ setWindowInteractivity(false);
+ }
+ }, [isCommandMenuOpen, isHovered, setWindowInteractivity]);
+
const startRecording = async () => {
try {
setError("");
@@ -194,9 +214,35 @@ export default function App() {
window.electronAPI.hideWindow();
};
+ useEffect(() => {
+ setWindowInteractivity(false);
+ return () => setWindowInteractivity(false);
+ }, [setWindowInteractivity]);
+
+ useEffect(() => {
+ if (!isCommandMenuOpen) {
+ return;
+ }
+
+ const handleClickOutside = (event) => {
+ if (
+ commandMenuRef.current &&
+ !commandMenuRef.current.contains(event.target) &&
+ buttonRef.current &&
+ !buttonRef.current.contains(event.target)
+ ) {
+ setIsCommandMenuOpen(false);
+ }
+ };
+
+ document.addEventListener("mousedown", handleClickOutside);
+ return () => document.removeEventListener("mousedown", handleClickOutside);
+ }, [isCommandMenuOpen]);
+
useEffect(() => {
let recording = false;
const handleToggle = () => {
+ setIsCommandMenuOpen(false);
if (!recording && !isRecording && !isProcessing) {
startRecording();
recording = true;
@@ -212,6 +258,7 @@ export default function App() {
}, [isRecording, isProcessing]);
const toggleListening = () => {
+ setIsCommandMenuOpen(false);
if (!isRecording && !isProcessing) {
startRecording();
} else if (isRecording) {
@@ -219,16 +266,20 @@ export default function App() {
}
};
- const handleKeyPress = (e) => {
- if (e.key === "Escape") {
- handleClose();
- }
- };
-
useEffect(() => {
+ const handleKeyPress = (e) => {
+ if (e.key === "Escape") {
+ if (isCommandMenuOpen) {
+ setIsCommandMenuOpen(false);
+ } else {
+ handleClose();
+ }
+ }
+ };
+
document.addEventListener("keydown", handleKeyPress);
return () => document.removeEventListener("keydown", handleKeyPress);
- }, []);
+ }, [isCommandMenuOpen]);
// Determine current mic state
const getMicState = () => {
@@ -282,87 +333,139 @@ export default function App() {
<>
{/* Fixed bottom-right voice button */}
<div className="fixed bottom-6 right-6 z-50">
- <Tooltip content={micProps.tooltip}>
- <button
- onMouseDown={(e) => {
- const rect = e.currentTarget.getBoundingClientRect();
- setDragStartPos({ x: e.clientX, y: e.clientY });
- setHasDragged(false);
- handleMouseDown(e);
- }}
- onMouseMove={(e) => {
- if (dragStartPos && !hasDragged) {
- const distance = Math.sqrt(
- Math.pow(e.clientX - dragStartPos.x, 2) +
- Math.pow(e.clientY - dragStartPos.y, 2)
- );
- if (distance > 5) {
- // 5px threshold for drag
- setHasDragged(true);
+ <div className="relative">
+ <Tooltip content={micProps.tooltip}>
+ <button
+ ref={buttonRef}
+ onMouseDown={(e) => {
+ setIsCommandMenuOpen(false);
+ setDragStartPos({ x: e.clientX, y: e.clientY });
+ setHasDragged(false);
+ handleMouseDown(e);
+ }}
+ onMouseMove={(e) => {
+ if (dragStartPos && !hasDragged) {
+ const distance = Math.sqrt(
+ Math.pow(e.clientX - dragStartPos.x, 2) +
+ Math.pow(e.clientY - dragStartPos.y, 2)
+ );
+ if (distance > 5) {
+ // 5px threshold for drag
+ setHasDragged(true);
+ }
}
- }
- }}
- onMouseUp={(e) => {
- handleMouseUp(e);
- setDragStartPos(null);
- }}
- onClick={(e) => {
- if (!hasDragged) {
- toggleListening();
- }
- e.preventDefault();
- }}
- onMouseEnter={() => setIsHovered(true)}
- onMouseLeave={() => setIsHovered(false)}
- onFocus={() => setIsHovered(true)}
- onBlur={() => setIsHovered(false)}
- className={micProps.className}
- disabled={micState === "processing"}
- style={{
- ...micProps.style,
- cursor:
- micState === "processing"
- ? "not-allowed !important"
- : isDragging
- ? "grabbing !important"
- : "pointer !important",
- transition:
- "transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s ease-out",
- }}
- >
- {/* Background effects */}
- <div
- className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent transition-opacity duration-150"
- style={{ opacity: micState === "hover" ? 0.8 : 0 }}
- ></div>
- <div
- className="absolute inset-0 transition-colors duration-150"
+ }}
+ onMouseUp={(e) => {
+ handleMouseUp(e);
+ setDragStartPos(null);
+ }}
+ onClick={(e) => {
+ if (!hasDragged) {
+ setIsCommandMenuOpen(false);
+ toggleListening();
+ }
+ e.preventDefault();
+ }}
+ onContextMenu={(e) => {
+ e.preventDefault();
+ if (!hasDragged) {
+ setWindowInteractivity(true);
+ setIsCommandMenuOpen((prev) => !prev);
+ }
+ }}
+ onMouseEnter={() => {
+ setIsHovered(true);
+ setWindowInteractivity(true);
+ }}
+ onMouseLeave={() => {
+ setIsHovered(false);
+ if (!isCommandMenuOpen) {
+ setWindowInteractivity(false);
+ }
+ }}
+ onFocus={() => setIsHovered(true)}
+ onBlur={() => setIsHovered(false)}
+ className={micProps.className}
style={{
- backgroundColor:
- micState === "hover" ? "rgba(0,0,0,0.1)" : "transparent",
+ ...micProps.style,
+ cursor:
+ micState === "processing"
+ ? "not-allowed !important"
+ : isDragging
+ ? "grabbing !important"
+ : "pointer !important",
+ transition:
+ "transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s ease-out",
}}
- ></div>
-
- {/* Dynamic content based on state */}
- {micState === "idle" || micState === "hover" ? (
- <SoundWaveIcon size={micState === "idle" ? 12 : 14} />
- ) : micState === "recording" ? (
- <LoadingDots />
- ) : micState === "processing" ? (
- <VoiceWaveIndicator isListening={true} />
- ) : null}
-
- {/* State indicator ring for recording */}
- {micState === "recording" && (
- <div className="absolute inset-0 rounded-full border-2 border-blue-300 animate-pulse"></div>
- )}
-
- {/* State indicator ring for processing */}
- {micState === "processing" && (
- <div className="absolute inset-0 rounded-full border-2 border-purple-300 opacity-50"></div>
- )}
- </button>
- </Tooltip>
+ >
+ {/* Background effects */}
+ <div
+ className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent transition-opacity duration-150"
+ style={{ opacity: micState === "hover" ? 0.8 : 0 }}
+ ></div>
+ <div
+ className="absolute inset-0 transition-colors duration-150"
+ style={{
+ backgroundColor:
+ micState === "hover" ? "rgba(0,0,0,0.1)" : "transparent",
+ }}
+ ></div>
+
+ {/* Dynamic content based on state */}
+ {micState === "idle" || micState === "hover" ? (
+ <SoundWaveIcon size={micState === "idle" ? 12 : 14} />
+ ) : micState === "recording" ? (
+ <LoadingDots />
+ ) : micState === "processing" ? (
+ <VoiceWaveIndicator isListening={true} />
+ ) : null}
+
+ {/* State indicator ring for recording */}
+ {micState === "recording" && (
+ <div className="absolute inset-0 rounded-full border-2 border-blue-300 animate-pulse"></div>
+ )}
+
+ {/* State indicator ring for processing */}
+ {micState === "processing" && (
+ <div className="absolute inset-0 rounded-full border-2 border-purple-300 opacity-50"></div>
+ )}
+ </button>
+ </Tooltip>
+ {isCommandMenuOpen && (
+ <div
+ ref={commandMenuRef}
+ className="absolute bottom-full right-0 mb-3 w-48 rounded-lg border border-white/10 bg-neutral-900/95 text-white shadow-lg backdrop-blur-sm"
+ onMouseEnter={() => {
+ setWindowInteractivity(true);
+ }}
+ onMouseLeave={() => {
+ if (!isHovered) {
+ setWindowInteractivity(false);
+ }
+ }}
+ >
+ <button
+ className="w-full px-3 py-2 text-left text-sm font-medium hover:bg-white/10 focus:bg-white/10 focus:outline-none"
+ onClick={() => {
+ toggleListening();
+ }}
+ >
+ {isRecording ? "Stop listening" : "Start listening"}
+ </button>
+ <div className="h-px bg-white/10" />
+ <button
+ className="w-full px-3 py-2 text-left text-sm hover:bg-white/10 focus:bg-white/10 focus:outline-none"
+ onClick={() => {
+ setIsCommandMenuOpen(false);
+ setWindowInteractivity(false);
+ handleClose();
+ }}
+ >
+ Hide this for now
+ </button>
+ </div>
+ )}
+ </div>
</div>
</>
);
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index 527868d65..4d0fd2743 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -57,6 +57,11 @@ class IPCHandlers {
this.windowManager.showDictationPanel();
});
+ ipcMain.handle("set-main-window-interactivity", (event, shouldCapture) => {
+ this.windowManager.setMainWindowInteractivity(Boolean(shouldCapture));
+ return { success: true };
+ });
+
// Environment handlers
ipcMain.handle("get-openai-key", async (event) => {
return this.environmentManager.getOpenAIKey();
diff --git a/src/helpers/windowConfig.js b/src/helpers/windowConfig.js
index 5cccf8173..2975eab9b 100644
--- a/src/helpers/windowConfig.js
+++ b/src/helpers/windowConfig.js
@@ -2,8 +2,8 @@ const path = require("path");
// Main dictation window configuration
const MAIN_WINDOW_CONFIG = {
- width: 100,
- height: 100,
+ width: 240,
+ height: 240,
webPreferences: {
preload: path.join(__dirname, "..", "..", "preload.js"),
nodeIntegration: false,
diff --git a/src/helpers/windowManager.js b/src/helpers/windowManager.js
index 46a19ea64..a06a05fc0 100644
--- a/src/helpers/windowManager.js
+++ b/src/helpers/windowManager.js
@@ -17,6 +17,7 @@ class WindowManager {
this.hotkeyManager = new HotkeyManager();
this.dragManager = new DragManager();
this.isQuitting = false;
+ this.isMainWindowInteractive = false;
app.on("before-quit", () => {
this.isQuitting = true;
@@ -36,6 +37,7 @@ class WindowManager {
this.mainWindow.setSkipTaskbar(false);
}
+ this.setMainWindowInteractivity(false);
this.registerMainWindowEvents();
await this.loadMainWindow();
@@ -76,6 +78,20 @@ class WindowManager {
);
}
+ setMainWindowInteractivity(shouldCapture) {
+ if (!this.mainWindow || this.mainWindow.isDestroyed()) {
+ return;
+ }
+
+ if (shouldCapture) {
+ this.mainWindow.setIgnoreMouseEvents(false);
+ } else {
+ this.mainWindow.setIgnoreMouseEvents(true, { forward: true });
+ }
+
+ this.isMainWindowInteractive = shouldCapture;
+ }
+
async loadMainWindow() {
const appUrl = DevServerManager.getAppUrl(false);
if (process.env.NODE_ENV === "development") {
@@ -217,6 +233,7 @@ class WindowManager {
this.mainWindow.on("closed", () => {
this.dragManager.cleanup();
this.mainWindow = null;
+ this.isMainWindowInteractive = false;
});
}
diff --git a/src/types/electron.ts b/src/types/electron.ts
index 06fff41b5..bb25cb7e1 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -205,6 +205,7 @@ declare global {
windowIsMaximized: () => Promise<boolean>;
startWindowDrag: () => Promise<void>;
stopWindowDrag: () => Promise<void>;
+ setMainWindowInteractivity: (interactive: boolean) => Promise<void>;
// App management
cleanupApp: () => Promise<{ success: boolean; message: string }>;