Skip to content

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

feat: add button to fully quit openwhispr processes

Gabriel Stein3653f1027f76
diff --git a/package-lock.json b/package-lock.json
index ceea79b14..894fa270a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "open-whispr",
- "version": "1.0.12",
+ "version": "1.0.14",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "open-whispr",
- "version": "1.0.12",
+ "version": "1.0.14",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
diff --git a/preload.js b/preload.js
index a0bbd6361..43288a4e3 100644
--- a/preload.js
+++ b/preload.js
@@ -100,6 +100,7 @@ contextBridge.exposeInMainWorld("electronAPI", {
windowClose: () => ipcRenderer.invoke("window-close"),
windowIsMaximized: () => ipcRenderer.invoke("window-is-maximized"),
getPlatform: () => process.platform,
+ appQuit: () => ipcRenderer.invoke("app-quit"),
// Cleanup function
cleanupApp: () => ipcRenderer.invoke("cleanup-app"),
diff --git a/src/components/ControlPanel.tsx b/src/components/ControlPanel.tsx
index cd207c244..5cd7d9857 100644
--- a/src/components/ControlPanel.tsx
+++ b/src/components/ControlPanel.tsx
@@ -1,7 +1,7 @@
import { useState, useEffect } from "react";
import { Card, CardContent, CardHeader, CardTitle } from "./ui/card";
import { Button } from "./ui/button";
-import { Trash2, Settings, FileText, Mic, X } from "lucide-react";
+import { Trash2, Settings, FileText, Mic } from "lucide-react";
import SettingsModal from "./SettingsModal";
import TitleBar from "./TitleBar";
import SupportDropdown from "./ui/SupportDropdown";
@@ -28,7 +28,6 @@ export default function ControlPanel() {
updateDownloaded: false,
isDevelopment: false,
});
- const isWindows = typeof window !== "undefined" && window.electronAPI?.getPlatform?.() === "win32";
const {
confirmDialog,
@@ -39,10 +38,6 @@ export default function ControlPanel() {
hideAlertDialog,
} = useDialogs();
- const handleClose = () => {
- void window.electronAPI.windowClose();
- };
-
useEffect(() => {
loadTranscriptions();
@@ -205,19 +200,6 @@ export default function ControlPanel() {
>
<Settings size={16} />
</Button>
- {isWindows && (
- <div className="flex items-center gap-1 ml-2">
- <Button
- variant="ghost"
- size="icon"
- className="text-red-600 hover:text-red-700 hover:bg-red-50"
- onClick={handleClose}
- aria-label="Close window"
- >
- <X size={14} />
- </Button>
- </div>
- )}
</>
}
/>
diff --git a/src/components/TitleBar.tsx b/src/components/TitleBar.tsx
index 3b2a2fc9e..f40752dfd 100644
--- a/src/components/TitleBar.tsx
+++ b/src/components/TitleBar.tsx
@@ -1,5 +1,8 @@
-import React from "react";
+import React, { useState } from "react";
import WindowControls from "./WindowControls";
+import { Button } from "./ui/button";
+import { Power } from "lucide-react";
+import { ConfirmDialog } from "./ui/dialog";
interface TitleBarProps {
title?: string;
@@ -16,12 +19,22 @@ export default function TitleBar({
className = "",
actions,
}: TitleBarProps) {
+ const [showQuitConfirm, setShowQuitConfirm] = useState(false);
+
// Get platform info
const platform =
typeof window !== "undefined" && window.electronAPI?.getPlatform
? window.electronAPI.getPlatform()
: "darwin";
+ const handleQuit = async () => {
+ try {
+ await window.electronAPI?.appQuit?.();
+ } catch {
+ // Silently handle if API not available
+ }
+ };
+
return (
<div
className={`bg-white border-b border-gray-100 select-none ${className}`}
@@ -44,10 +57,30 @@ export default function TitleBar({
style={{ WebkitAppRegion: "no-drag" }}
>
{actions}
+ <Button
+ variant="ghost"
+ size="icon"
+ onClick={() => setShowQuitConfirm(true)}
+ className="h-8 w-8 text-red-600 hover:text-red-700 hover:bg-red-50"
+ title="Quit OpenWhispr"
+ aria-label="Quit OpenWhispr"
+ >
+ <Power size={16} />
+ </Button>
{/* Show window controls on Linux and Windows (macOS uses native controls) */}
{platform !== "darwin" && <WindowControls />}
</div>
</div>
+ <ConfirmDialog
+ open={showQuitConfirm}
+ onOpenChange={setShowQuitConfirm}
+ title="Quit OpenWhispr?"
+ description="This will close OpenWhispr and stop background processes."
+ confirmText="Quit"
+ cancelText="Cancel"
+ onConfirm={handleQuit}
+ variant="destructive"
+ />
</div>
);
}
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index 595902f8b..babe3e0af 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -44,6 +44,10 @@ class IPCHandlers {
return false;
});
+ ipcMain.handle("app-quit", () => {
+ app.quit();
+ });
+
ipcMain.handle("hide-window", () => {
if (process.platform === "darwin") {
this.windowManager.hideDictationPanel();
diff --git a/src/types/electron.ts b/src/types/electron.ts
index a54b6894e..2a1f9708a 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -231,6 +231,7 @@ declare global {
setMainWindowInteractivity: (interactive: boolean) => Promise<void>;
// App management
+ appQuit: () => Promise<void>;
cleanupApp: () => Promise<{ success: boolean; message: string }>;
getTranscriptionHistory: () => Promise<any[]>;
clearTranscriptionHistory: () => Promise<void>;