Skip to content

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

fix: grow preview window with text and add close button

Gabriel Steinff2b17aaf4d9
diff --git a/src/components/TranscriptionPreviewOverlay.tsx b/src/components/TranscriptionPreviewOverlay.tsx
index 3a1781fc1..e9e17e06f 100644
--- a/src/components/TranscriptionPreviewOverlay.tsx
+++ b/src/components/TranscriptionPreviewOverlay.tsx
@@ -1,4 +1,5 @@
import { useState, useEffect } from "react";
+import { X } from "lucide-react";
export default function TranscriptionPreviewOverlay() {
const [text, setText] = useState("");
@@ -42,14 +43,24 @@ export default function TranscriptionPreviewOverlay() {
isVisible ? "translate-y-0 opacity-100" : "translate-y-2 opacity-0",
].join(" ")}
>
- {text ? (
- <p className="text-[12px] text-foreground leading-snug line-clamp-3">{text}</p>
- ) : (
- <div className="flex items-center gap-1.5">
- <div className="w-1.5 h-1.5 rounded-full bg-primary animate-pulse" />
- <p className="text-[11px] text-muted-foreground">Listening...</p>
+ <div className="flex items-start gap-2">
+ <div className="flex-1 min-w-0">
+ {text ? (
+ <p className="text-[12px] text-foreground leading-snug">{text}</p>
+ ) : (
+ <div className="flex items-center gap-1.5">
+ <div className="w-1.5 h-1.5 rounded-full bg-primary animate-pulse" />
+ <p className="text-[11px] text-muted-foreground">Listening...</p>
+ </div>
+ )}
</div>
- )}
+ <button
+ onClick={() => window.electronAPI?.stopDictationPreview?.()}
+ className="shrink-0 text-muted-foreground/60 hover:text-foreground transition-colors p-0.5"
+ >
+ <X className="w-3.5 h-3.5" />
+ </button>
+ </div>
</div>
</div>
);
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index 84fabfe39..5ebdf5465 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -3061,10 +3061,16 @@ class IPCHandlers {
if (result?.success && result.text?.trim()) {
this.windowManager.appendTranscriptionPreview(result.text.trim());
+ } else if (result && !result.success) {
+ debugLogger.warn("Dictation preview chunk returned failure", {
+ error: result.error || result.message,
+ provider: dictationPreviewProvider,
+ });
}
} catch (error) {
debugLogger.error("Dictation preview transcription chunk failed", {
error: error.message,
+ provider: dictationPreviewProvider,
});
} finally {
dictationPreviewTranscribing = false;
diff --git a/src/helpers/windowConfig.js b/src/helpers/windowConfig.js
index 10e3e6f85..2054543f0 100644
--- a/src/helpers/windowConfig.js
+++ b/src/helpers/windowConfig.js
@@ -122,7 +122,7 @@ const NOTIFICATION_WINDOW_CONFIG = {
const TRANSCRIPTION_PREVIEW_CONFIG = {
width: 380,
- height: 100,
+ height: 200,
frame: false,
transparent: true,
alwaysOnTop: true,
@@ -131,6 +131,7 @@ const TRANSCRIPTION_PREVIEW_CONFIG = {
focusable: false,
hasShadow: false,
show: false,
+ acceptsFirstMouse: true,
webPreferences: {
preload: path.join(__dirname, "..", "..", "preload.js"),
nodeIntegration: false,
@@ -175,7 +176,7 @@ class WindowPositionUtil {
static getTranscriptionPreviewPosition(display, mainWindowBounds) {
const width = 380;
- const height = 100;
+ const height = 200;
const GAP = 8;
const workArea = display.workArea || display.bounds;