Skip to content

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

fix: app does not dissappear from dock

Gabriel Stein4e6482316ba6
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9235421e8..1dac79a97 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [1.0.6] - 2025-09-11
+
+### 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.
+
+### 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.
+
+## [1.0.5] - 2025-09-10
+
+### Fixed
+- **Build System**: Fixed native module signing conflicts on macOS
+ - Added `npmRebuild: true` to force rebuild of native modules during packaging
+ - Added `buildDependenciesFromSource: true` to compile native dependencies from source
+ - Added `better-sqlite3` to `asarUnpack` array to properly unpack SQLite3 native module
+ - Resolves "different Team IDs" error when launching notarized macOS apps
+- **CI/CD Pipeline**: Fixed automated release workflow issues
+ - Removed automatic version update step from release workflow (version should be set before tagging)
+ - Added `contents: write` permission to allow workflow to create GitHub releases
+ - Fixes "Resource not accessible by integration" error during releases
+
+### Technical Details
+- This is a maintenance release focusing on build reliability and deployment infrastructure
+- No feature changes or user-facing functionality updates
+- All changes related to packaging, signing, and automated release processes
+
## [1.0.4] - 2025-09-09
### Added
diff --git a/electron-builder.json b/electron-builder.json
index 7f747bf1c..90c643f46 100644
--- a/electron-builder.json
+++ b/electron-builder.json
@@ -44,7 +44,7 @@
"entitlementsInherit": "resources/mac/entitlements.mac.plist",
"identity": "HeroTools Inc. (9R85XFMH59)",
"extendInfo": {
- "LSUIElement": true,
+ "LSUIElement": false,
"NSMicrophoneUsageDescription": "OpenWhispr needs microphone access for speech-to-text transcription.",
"NSAccessibilityUsageDescription": "OpenWhispr needs accessibility permissions to paste transcribed text into other applications."
}
diff --git a/main.js b/main.js
index 88a7b1044..46b97a835 100644
--- a/main.js
+++ b/main.js
@@ -78,9 +78,11 @@ async function startApp() {
await new Promise((resolve) => setTimeout(resolve, 2000));
}
- // Ensure dock is visible on macOS
+ // Ensure dock is visible on macOS and stays visible
if (process.platform === 'darwin' && app.dock) {
app.dock.show();
+ // Prevent dock from hiding when windows use setVisibleOnAllWorkspaces
+ app.setActivationPolicy('regular');
}
// Initialize Whisper manager at startup (don't await to avoid blocking)
@@ -122,19 +124,60 @@ async function startApp() {
// App event handlers
app.whenReady().then(() => {
+ // Hide dock icon on macOS for a cleaner experience
+ // The app will still show in the menu bar and command bar
+ if (process.platform === 'darwin' && app.dock) {
+ // Keep dock visible for now to maintain command bar access
+ // We can hide it later if needed: app.dock.hide()
+ }
startApp();
});
app.on("window-all-closed", () => {
+ // Don't quit on macOS when all windows are closed
+ // The app should stay in the dock/menu bar
if (process.platform !== "darwin") {
app.quit();
}
+ // On macOS, keep the app running even without windows
+});
+
+// Re-apply always-on-top when app becomes active
+app.on("browser-window-focus", (event, window) => {
+ // Only apply always-on-top to the dictation window, not the control panel
+ if (windowManager && windowManager.mainWindow && !windowManager.mainWindow.isDestroyed()) {
+ // Check if the focused window is the dictation window
+ if (window === windowManager.mainWindow) {
+ windowManager.enforceMainWindowOnTop();
+ }
+ }
+
+ // Control panel doesn't need any special handling on focus
+ // It should behave like a normal window
});
app.on("activate", () => {
+ // On macOS, re-create windows when dock icon is clicked
if (BrowserWindow.getAllWindows().length === 0) {
- windowManager.createMainWindow();
+ if (windowManager) {
+ windowManager.createMainWindow();
+ windowManager.createControlPanelWindow();
+ }
+ } else {
+ // Show control panel when dock icon is clicked (most common user action)
+ if (windowManager && windowManager.controlPanelWindow && !windowManager.controlPanelWindow.isDestroyed()) {
+ windowManager.controlPanelWindow.show();
+ windowManager.controlPanelWindow.focus();
+ } else if (windowManager) {
+ // If control panel doesn't exist, create it
+ windowManager.createControlPanelWindow();
+ }
+
+ // Ensure dictation panel maintains its always-on-top status
+ if (windowManager && windowManager.mainWindow && !windowManager.mainWindow.isDestroyed()) {
+ windowManager.enforceMainWindowOnTop();
+ }
}
});
diff --git a/package.json b/package.json
index 48347b9dd..a37fc45c0 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "open-whispr",
- "version": "1.0.5",
+ "version": "1.0.6",
"description": "A desktop dictation application using OpenAI Whisper for speech-to-text transcription",
"main": "main.js",
"private": true,
diff --git a/src/components/SettingsPage.tsx b/src/components/SettingsPage.tsx
index dfb71842c..21022564e 100644
--- a/src/components/SettingsPage.tsx
+++ b/src/components/SettingsPage.tsx
@@ -149,7 +149,7 @@ export default function SettingsPage({
const subscribeToUpdates = () => {
if (window.electronAPI) {
const handleUpdateAvailable = (event, info) => {
- setUpdateStatus((prev) => ({ ...prev, updateAvailable: true }));
+ setUpdateStatus((prev) => ({ ...prev, updateAvailable: true, updateDownloaded: false }));
if (info) {
setUpdateInfo({
version: info.version || 'unknown',
@@ -379,17 +379,18 @@ export default function SettingsPage({
await window.electronAPI?.checkForUpdates();
if (result?.updateAvailable) {
setUpdateInfo({
- version: result.version,
+ version: result.version || 'unknown',
releaseDate: result.releaseDate,
releaseNotes: result.releaseNotes,
});
setUpdateStatus((prev) => ({
...prev,
updateAvailable: true,
+ updateDownloaded: false,
}));
showAlertDialog({
title: "Update Available",
- description: `Update available: v${result.version}`,
+ description: `Update available: v${result.version || 'new version'}`,
});
} else {
showAlertDialog({
@@ -449,7 +450,7 @@ export default function SettingsPage({
) : (
<>
<Download size={16} className="mr-2" />
- Download Update {updateInfo.version ? `v${updateInfo.version}` : ''}
+ Download Update{updateInfo.version ? ` v${updateInfo.version}` : ''}
</>
)}
</Button>
diff --git a/src/helpers/menuManager.js b/src/helpers/menuManager.js
index 12cfea782..e1141d575 100644
--- a/src/helpers/menuManager.js
+++ b/src/helpers/menuManager.js
@@ -9,6 +9,12 @@ class MenuManager {
submenu: [
{ role: "about" },
{ type: "separator" },
+ { role: "services" },
+ { type: "separator" },
+ { role: "hide" },
+ { role: "hideOthers" },
+ { role: "unhide" },
+ { type: "separator" },
{ role: "quit", label: "Quit OpenWhispr" },
],
},
@@ -19,47 +25,124 @@ class MenuManager {
}
static setupControlPanelMenu(controlPanelWindow) {
- const template = [
- {
- label: "File",
- submenu: [{ role: "close", label: "Close Window" }],
- },
- {
- label: "Edit",
- submenu: [
- { role: "undo", label: "Undo" },
- { role: "redo", label: "Redo" },
- { type: "separator" },
- { role: "cut", label: "Cut" },
- { role: "copy", label: "Copy" },
- { role: "paste", label: "Paste" },
- { role: "pasteAndMatchStyle", label: "Paste and Match Style" },
- { type: "separator" },
- { role: "selectall", label: "Select All" },
- ],
- },
- {
- label: "View",
- submenu: [
- { role: "reload", label: "Reload" },
- { role: "forceReload", label: "Force Reload" },
- { role: "toggleDevTools", label: "Toggle Developer Tools" },
- { type: "separator" },
- { role: "resetZoom", label: "Actual Size" },
- { role: "zoomIn", label: "Zoom In" },
- { role: "zoomOut", label: "Zoom Out" },
- { type: "separator" },
- { role: "togglefullscreen", label: "Toggle Full Screen" },
- ],
- },
- ];
-
- const menu = Menu.buildFromTemplate(template);
- controlPanelWindow.setMenu(menu);
-
- // Also set as application menu on macOS for clipboard access
if (process.platform === "darwin") {
+ // On macOS, create a proper application menu
+ const template = [
+ {
+ label: "OpenWhispr",
+ submenu: [
+ { role: "about" },
+ { type: "separator" },
+ { role: "services" },
+ { type: "separator" },
+ { role: "hide" },
+ { role: "hideOthers" },
+ { role: "unhide" },
+ { type: "separator" },
+ { role: "quit", label: "Quit OpenWhispr" },
+ ],
+ },
+ {
+ label: "Edit",
+ submenu: [
+ { role: "undo" },
+ { role: "redo" },
+ { type: "separator" },
+ { role: "cut" },
+ { role: "copy" },
+ { role: "paste" },
+ { role: "pasteAndMatchStyle" },
+ { role: "delete" },
+ { role: "selectAll" },
+ { type: "separator" },
+ {
+ label: "Speech",
+ submenu: [
+ { role: "startSpeaking" },
+ { role: "stopSpeaking" },
+ ],
+ },
+ ],
+ },
+ {
+ label: "View",
+ submenu: [
+ { role: "reload" },
+ { role: "forceReload" },
+ { role: "toggleDevTools" },
+ { type: "separator" },
+ { role: "resetZoom" },
+ { role: "zoomIn" },
+ { role: "zoomOut" },
+ { type: "separator" },
+ { role: "togglefullscreen" },
+ ],
+ },
+ {
+ label: "Window",
+ submenu: [
+ { role: "minimize" },
+ { role: "close" },
+ { type: "separator" },
+ { role: "front" },
+ { type: "separator" },
+ { role: "window" },
+ ],
+ },
+ {
+ label: "Help",
+ submenu: [
+ {
+ label: "Learn More",
+ click: async () => {
+ const { shell } = require("electron");
+ await shell.openExternal("https://github.com/HeroTools/open-whispr");
+ },
+ },
+ ],
+ },
+ ];
+
+ const menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
+ } else {
+ // For Windows/Linux, keep the window-specific menu
+ const template = [
+ {
+ label: "File",
+ submenu: [{ role: "close", label: "Close Window" }],
+ },
+ {
+ label: "Edit",
+ submenu: [
+ { role: "undo" },
+ { role: "redo" },
+ { type: "separator" },
+ { role: "cut" },
+ { role: "copy" },
+ { role: "paste" },
+ { type: "separator" },
+ { role: "selectAll" },
+ ],
+ },
+ {
+ label: "View",
+ submenu: [
+ { role: "reload" },
+ { role: "forceReload" },
+ { role: "toggleDevTools" },
+ { type: "separator" },
+ { role: "resetZoom" },
+ { role: "zoomIn" },
+ { role: "zoomOut" },
+ { type: "separator" },
+ { role: "togglefullscreen" },
+ ],
+ },
+ ];
+
+ const menu = Menu.buildFromTemplate(template);
+ controlPanelWindow.setMenu(menu);
}
}
}
diff --git a/src/helpers/tray.js b/src/helpers/tray.js
index 686ea2295..3a7c62800 100644
--- a/src/helpers/tray.js
+++ b/src/helpers/tray.js
@@ -28,7 +28,6 @@ class TrayManager {
return;
}
- trayIcon.setTemplateImage(true);
this.tray = new Tray(trayIcon);
this.tray.setIgnoreDoubleClickEvents(true);
@@ -48,35 +47,39 @@ class TrayManager {
);
if (fs.existsSync(iconPath)) {
- return nativeImage.createFromPath(iconPath);
+ const icon = nativeImage.createFromPath(iconPath);
+ icon.setTemplateImage(true);
+ return icon;
} else {
console.error("Tray icon not found at:", iconPath);
return this.createFallbackIcon();
}
} else {
+ // In production, the icon should be in extraResources
const possiblePaths = [
+ // Most likely location: extraResources
+ path.join(process.resourcesPath, "src", "assets", "[email protected]"),
+ // Alternative locations
path.join(process.resourcesPath, "assets", "[email protected]"),
path.join(
process.resourcesPath,
"app.asar.unpacked",
+ "src",
"assets",
),
- path.join(__dirname, "..", "..", "assets", "[email protected]"),
- path.join(
- process.resourcesPath,
- "app",
- "assets",
- ),
- path.join(app.getPath("exe"), "..", "Resources", "assets", "[email protected]"),
- path.join(app.getAppPath(), "assets", "[email protected]"),
+ path.join(__dirname, "..", "..", "src", "assets", "[email protected]"),
+ path.join(app.getAppPath(), "src", "assets", "[email protected]"),
];
+ console.log("Looking for tray icon in production...");
for (const testPath of possiblePaths) {
try {
if (fs.existsSync(testPath)) {
- return nativeImage.createFromPath(testPath);
+ console.log("✅ Found tray icon at:", testPath);
+ const icon = nativeImage.createFromPath(testPath);
+ icon.setTemplateImage(true);
+ return icon;
}
} catch (e) {
console.log("❌ Error checking path:", testPath, e.message);
diff --git a/src/helpers/windowConfig.js b/src/helpers/windowConfig.js
index 3cac348c6..5cccf8173 100644
--- a/src/helpers/windowConfig.js
+++ b/src/helpers/windowConfig.js
@@ -4,7 +4,6 @@ const path = require("path");
const MAIN_WINDOW_CONFIG = {
width: 100,
height: 100,
- type: 'panel',
webPreferences: {
preload: path.join(__dirname, "..", "..", "preload.js"),
nodeIntegration: false,
@@ -16,11 +15,14 @@ const MAIN_WINDOW_CONFIG = {
alwaysOnTop: true,
resizable: false,
transparent: true,
- show: true,
- skipTaskbar: false,
+ show: false, // Start hidden, show after setup
+ skipTaskbar: false, // Keep visible in Dock/taskbar so app stays discoverable
focusable: true,
visibleOnAllWorkspaces: true,
- hiddenInMissionControl: false,
+ fullScreenable: false,
+ hasShadow: false, // Remove shadow for cleaner look
+ acceptsFirstMouse: true, // Accept clicks even when not focused
+ type: process.platform === 'darwin' ? 'panel' : 'normal', // Panel on macOS preserves floating behavior
};
// Control panel window configuration
@@ -35,14 +37,6 @@ const CONTROL_PANEL_CONFIG = {
sandbox: false,
webSecurity: false,
spellcheck: false,
- experimentalFeatures: false,
- allowRunningInsecureContent: false,
- enableWebSQL: false,
- enableBlinkFeatures: "",
- defaultEncoding: "UTF-8",
- disableHtmlFullscreenWindowResize: false,
- enableClipboardAccess: true,
- clipboard: true,
},
title: "OpenWhispr Control Panel",
resizable: true,
@@ -56,28 +50,63 @@ const CONTROL_PANEL_CONFIG = {
maximizable: true,
closable: true,
fullscreenable: true,
+ skipTaskbar: false, // Ensure control panel stays in taskbar
+ alwaysOnTop: false, // Control panel should not be always on top
+ visibleOnAllWorkspaces: false, // Control panel should stay in its workspace
+ type: 'normal', // Ensure it's a normal window, not a panel
};
// Window positioning utilities
class WindowPositionUtil {
static getMainWindowPosition(display) {
const { width, height } = MAIN_WINDOW_CONFIG;
+ const MARGIN = 20;
const x = Math.max(
0,
- display.bounds.x + display.workArea.width - width - 20
+ display.bounds.x + display.workArea.width - width - MARGIN
+ );
+ const workArea = display.workArea || display.bounds;
+ const y = Math.max(
+ 0,
+ workArea.y + workArea.height - height - MARGIN
);
- const y = Math.max(0, display.bounds.y + display.workArea.height);
return { x, y, width, height };
}
static setupAlwaysOnTop(window) {
if (process.platform === 'darwin') {
- window.setAlwaysOnTop(true, "screen-saver", 1);
- window.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
+ // macOS: Use panel level for proper floating behavior
+ // This ensures the window stays on top across spaces and fullscreen apps
+ window.setAlwaysOnTop(true, "floating", 1);
+ window.setVisibleOnAllWorkspaces(true, {
+ visibleOnFullScreen: true,
+ skipTransformProcessType: true, // Keep Dock/Command-Tab behaviour
+ });
window.setFullScreenable(false);
+
+ // Ensure window level is maintained
+ if (window.isVisible()) {
+ window.setAlwaysOnTop(true, "floating", 1);
+ }
+ } else if (process.platform === 'win32') {
+ // Windows-specific always-on-top
+ window.setAlwaysOnTop(true, "screen-saver");
+ // Don't skip taskbar on Windows to maintain visibility
} else {
- window.setAlwaysOnTop(true);
+ // Linux and other platforms
+ window.setAlwaysOnTop(true, "screen-saver");
}
+
+ // Bring window to front if visible
+ if (window.isVisible()) {
+ window.moveTop();
+ }
+ }
+
+ static setupControlPanel(window) {
+ // Control panel should behave like a normal application window
+ // This is only called once during window creation
+ // No need to repeatedly set these values
}
}
diff --git a/src/helpers/windowManager.js b/src/helpers/windowManager.js
index f0ad2daa7..46a19ea64 100644
--- a/src/helpers/windowManager.js
+++ b/src/helpers/windowManager.js
@@ -1,4 +1,4 @@
-const { screen, BrowserWindow } = require("electron");
+const { app, screen, BrowserWindow } = require("electron");
const HotkeyManager = require("./hotkeyManager");
const DragManager = require("./dragManager");
const MenuManager = require("./menuManager");
@@ -16,6 +16,11 @@ class WindowManager {
this.tray = null;
this.hotkeyManager = new HotkeyManager();
this.dragManager = new DragManager();
+ this.isQuitting = false;
+
+ app.on("before-quit", () => {
+ this.isQuitting = true;
+ });
}
async createMainWindow() {
@@ -27,6 +32,12 @@ class WindowManager {
...position,
});
+ if (process.platform === "darwin") {
+ this.mainWindow.setSkipTaskbar(false);
+ }
+
+ this.registerMainWindowEvents();
+
await this.loadMainWindow();
await this.initializeHotkey();
this.dragManager.setTargetWindow(this.mainWindow);
@@ -57,21 +68,12 @@ class WindowManager {
}
);
- this.mainWindow.webContents.on("did-finish-load", () => {
- // Ensure window is visible after loading
- setTimeout(() => {
- if (!this.mainWindow.isVisible()) {
- this.mainWindow.show();
- this.mainWindow.focus();
- }
- }, 1000);
- });
-
- // Ensure window is always on top, even above fullscreen apps
- WindowPositionUtil.setupAlwaysOnTop(this.mainWindow);
- this.mainWindow.on("show", () => {
- WindowPositionUtil.setupAlwaysOnTop(this.mainWindow);
- });
+ this.mainWindow.webContents.on(
+ "did-finish-load",
+ () => {
+ this.enforceMainWindowOnTop();
+ }
+ );
}
async loadMainWindow() {
@@ -117,6 +119,9 @@ class WindowManager {
async createControlPanelWindow() {
if (this.controlPanelWindow && !this.controlPanelWindow.isDestroyed()) {
+ if (this.controlPanelWindow.isMinimized()) {
+ this.controlPanelWindow.restore();
+ }
if (!this.controlPanelWindow.isVisible()) {
this.controlPanelWindow.show();
}
@@ -126,18 +131,31 @@ class WindowManager {
this.controlPanelWindow = new BrowserWindow(CONTROL_PANEL_CONFIG);
- console.log("📱 Loading control panel content...");
- await this.loadControlPanel();
-
- // Set up menu for control panel to ensure text input works
- MenuManager.setupControlPanelMenu(this.controlPanelWindow);
+ this.controlPanelWindow.once("ready-to-show", () => {
+ this.controlPanelWindow.show();
+ this.controlPanelWindow.focus();
+ });
- this.controlPanelWindow.show();
- this.controlPanelWindow.focus();
+ this.controlPanelWindow.on("close", (event) => {
+ if (!this.isQuitting) {
+ event.preventDefault();
+ if (process.platform === "darwin") {
+ this.controlPanelWindow.minimize();
+ } else {
+ this.controlPanelWindow.hide();
+ }
+ }
+ });
this.controlPanelWindow.on("closed", () => {
this.controlPanelWindow = null;
});
+
+ // Set up menu for control panel to ensure text input works
+ MenuManager.setupControlPanelMenu(this.controlPanelWindow);
+
+ console.log("📱 Loading control panel content...");
+ await this.loadControlPanel();
}
async loadControlPanel() {
@@ -156,11 +174,57 @@ class WindowManager {
showDictationPanel() {
if (this.mainWindow && !this.mainWindow.isDestroyed()) {
if (!this.mainWindow.isVisible()) {
- this.mainWindow.show();
+ if (typeof this.mainWindow.showInactive === "function") {
+ this.mainWindow.showInactive();
+ } else {
+ this.mainWindow.show();
+ }
}
this.mainWindow.focus();
}
}
+
+ registerMainWindowEvents() {
+ if (!this.mainWindow) {
+ return;
+ }
+
+ this.mainWindow.once("ready-to-show", () => {
+ this.enforceMainWindowOnTop();
+ if (!this.mainWindow.isVisible()) {
+ if (typeof this.mainWindow.showInactive === "function") {
+ this.mainWindow.showInactive();
+ } else {
+ this.mainWindow.show();
+ }
+ }
+ });
+
+ this.mainWindow.on("show", () => {
+ this.enforceMainWindowOnTop();
+ });
+
+ this.mainWindow.on("focus", () => {
+ this.enforceMainWindowOnTop();
+ });
+
+ this.mainWindow.on("blur", () => {
+ setTimeout(() => {
+ this.enforceMainWindowOnTop();
+ }, 100);
+ });
+
+ this.mainWindow.on("closed", () => {
+ this.dragManager.cleanup();
+ this.mainWindow = null;
+ });
+ }
+
+ enforceMainWindowOnTop() {
+ if (this.mainWindow && !this.mainWindow.isDestroyed()) {
+ WindowPositionUtil.setupAlwaysOnTop(this.mainWindow);
+ }
+ }
}
module.exports = WindowManager;